Class ServiceManager

java.lang.Object
com.thewinterframework.service.ServiceManager

public class ServiceManager extends Object

This class is responsible for managing services.

  • Constructor Details

    • ServiceManager

      public ServiceManager()
  • Method Details

    • registerService

      public void registerService(@NotNull @NotNull Class<?> service) throws IllegalAccessException, NoSuchMethodException
      Register a service with the service manager.
      Parameters:
      service - The service to register.
      Throws:
      IllegalAccessException
      NoSuchMethodException
    • loadHandlers

      public void loadHandlers(WinterPlugin plugin)
      Load all plugin service handlers.
      Parameters:
      plugin - The plugin to load handlers for.
    • configureHandlers

      public void configureHandlers(com.google.inject.Binder binder)
      Configure all plugin service handlers.
      Parameters:
      binder - The binder to configure handlers with.
    • startHandlers

      public void startHandlers(WinterPlugin plugin)
      Start all plugin service handlers.
      Parameters:
      plugin - The plugin to start handlers for.
    • stopHandlers

      public void stopHandlers(WinterPlugin plugin)
      Stop all plugin service handlers.
      Parameters:
      plugin - The plugin to stop handlers for.
    • getHandler

      @Nullable public <T extends ServiceDecoratorHandler<?>> T getHandler(Class<T> handlerClass)
      Get a handler by its class.
      Type Parameters:
      T - The type of the handler.
      Parameters:
      handlerClass - The handler class.
      Returns:
      The handler instance or null if not found.
    • services

      public Set<Class<?>> services()
      Get the services.
      Returns:
      The services.