Package io.github.simplexdevelopment.api
Interface IService
- All Superinterfaces:
Identifier
,Runnable
- All Known Implementing Classes:
ExecutableService
,ServiceImpl
Represents a service that can be registered to a
ServicePool
.
This interface provides surface level methods to be used by the ServicePool
associated to each service.
-
Method Summary
Modifier and TypeMethodDescriptionlong
getDelay()
reactor.core.publisher.Mono<ServicePool>
long
org.bukkit.plugin.java.JavaPlugin
boolean
default void
run()
reactor.core.publisher.Mono<Void>
setParentPool
(ServicePool servicePool) Sets the parent pool for this service.reactor.core.publisher.Mono<Void>
start()
The actual start method for the service.reactor.core.publisher.Mono<Void>
stop()
The actual end method for the service.Methods inherited from interface io.github.simplexdevelopment.api.Identifier
getName, getNumericalId, getUniqueId
-
Method Details
-
isPeriodic
boolean isPeriodic()- Returns:
- If the service should be scheduled for repeated executions or not.
-
getPeriod
long getPeriod()- Returns:
- How long the service should wait between subsequent executions.
-
getDelay
long getDelay()- Returns:
- How long the service should wait before executing the first time.
-
start
reactor.core.publisher.Mono<Void> start()The actual start method for the service. This should be overridden by subclasses, and should include all the required code necessary to execute when the service is queued.- Returns:
- An encapsulated Mono object representing the start method for the service.
-
stop
reactor.core.publisher.Mono<Void> stop()The actual end method for the service. This should be overridden by subclasses, and should include all the required code necessary to execute when the service is stopped.- Returns:
- An encapsulated Mono object representing the end method for the service.
-
getPlugin
org.bukkit.plugin.java.JavaPlugin getPlugin()- Returns:
- The plugin which was defined in the constructor. This should be an instance of your main plugin class.
-
getParentPool
reactor.core.publisher.Mono<ServicePool> getParentPool()- Returns:
- The
ServicePool
which this service is executing on.
-
setParentPool
Sets the parent pool for this service.- Parameters:
servicePool
- The service pool to attach this service to.- Returns:
- An encapsulated Mono object representing the set operation.
-
run
default void run()
-