Package com.avrix.plugin
Class ServiceManager
java.lang.Object
com.avrix.plugin.ServiceManager
The service manager allows you to register services by their interfaces and access them
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic <T> TgetService(Class<T> serviceInterface) Returns the registered service by its interface.static <T> voidRegisters a service by its interface.static <T> voidunregister(Class<T> serviceInterface) Removes a service from the list of registered ones
- 
Constructor Details- 
ServiceManagerpublic ServiceManager()
 
- 
- 
Method Details- 
registerRegisters a service by its interface.- Type Parameters:
- T- service type
- Parameters:
- serviceInterface- service interface
- serviceImplementation- service implementation
 
- 
unregisterRemoves a service from the list of registered ones- Type Parameters:
- T- service type
- Parameters:
- serviceInterface- service interface
 
- 
getServiceReturns the registered service by its interface.- Type Parameters:
- T- service type
- Parameters:
- serviceInterface- service interface
- Returns:
- an instance of the service corresponding to the specified interface, or nullif the service is not found
 
 
-