Package com.thewinterframework.service
Class ServiceManager
java.lang.Object
com.thewinterframework.service.ServiceManager
This class is responsible for managing services.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigureHandlers(com.google.inject.Binder binder) Configure all plugin service handlers.<T extends ServiceDecoratorHandler<?>>
TgetHandler(Class<T> handlerClass) Get a handler by its class.voidloadHandlers(WinterPlugin plugin) Load all plugin service handlers.voidregisterService(@NotNull Class<?> service) Register a service with the service manager.services()Get the services.voidstartHandlers(WinterPlugin plugin) Start all plugin service handlers.voidstopHandlers(WinterPlugin plugin) Stop all plugin service handlers.
-
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:
IllegalAccessExceptionNoSuchMethodException
-
loadHandlers
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
Start all plugin service handlers.- Parameters:
plugin- The plugin to start handlers for.
-
stopHandlers
Stop all plugin service handlers.- Parameters:
plugin- The plugin to stop handlers for.
-
getHandler
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
Get the services.- Returns:
- The services.
-