Interface IService

All Superinterfaces:
Runnable
All Known Implementing Classes:
ExecutableService, ServiceImpl

public interface IService extends Runnable
  • Method Summary

    Modifier and Type
    Method
    Description
    static @NotNull org.bukkit.NamespacedKey
     
    long
     
    org.bukkit.NamespacedKey
     
    reactor.core.publisher.Mono<ServicePool>
     
    long
     
    org.bukkit.plugin.java.JavaPlugin
     
    boolean
     
    default void
    run()
     
    reactor.core.publisher.Mono<Void>
    The actual start method for the service.
    reactor.core.publisher.Mono<Void>
    The actual end method for the service.
  • Method Details

    • getDefaultNamespacedKey

      @Contract(" -> new") @NotNull static @NotNull org.bukkit.NamespacedKey getDefaultNamespacedKey()
    • getNamespacedKey

      org.bukkit.NamespacedKey getNamespacedKey()
      Returns:
      The NamespacedKey of this service.
    • 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.
    • run

      default void run()
      Specified by:
      run in interface Runnable