Interface ModuleServicesManager
public interface ModuleServicesManager
- 
Method SummaryModifier and TypeMethodDescription<T extends ModuleService>
 TgetService(Class<T> serviceClass) Retrieves aModuleServiceindicated by the givenserviceClass.voidnotifyServiceReady(ModuleService service) To be called by aModuleServiceafter it is first ready for use.voidnotifyServiceShutdown(ModuleService service) To be called by aModuleServicewhen it is longer ready for use.voidregisterService(Class<? extends ModuleService> serviceClass, ModuleService service) Registers aModuleServicefor use.voidsubscribe(Class<? extends ModuleService> serviceClass, ModuleServiceConsumer consumer) Indicate that the givenModuleServiceConsumeris interested in using theModuleServiceindicated byserviceClass.voidunregisterService(Class<? extends ModuleService> serviceClass) Unregisters aModuleServicewith the givenserviceClass.voidunsubscribe(Class<? extends ModuleService> serviceClass, ModuleServiceConsumer consumer) Indicate that the givenModuleServiceConsumeris no longer interested in theModuleServiceindicated byserviceClass.
- 
Method Details- 
registerServiceRegisters aModuleServicefor use.- Parameters:
- serviceClass- the Class- ModuleServiceConsumers will request this service by.
- service- the- ModuleServiceprovided.
 
- 
unregisterServiceUnregisters aModuleServicewith the givenserviceClass.- Parameters:
- serviceClass- the- ModuleServiceClass to unregister.
 
- 
getServiceRetrieves aModuleServiceindicated by the givenserviceClass. AModuleServiceshould not be retrieved by aModuleServiceConsumeruntil it has been notified of its availability.- Parameters:
- serviceClass- the Class linked to the desired- ModuleService.
- Returns:
- the ModuleServiceindicated byserviceClass.
 
- 
subscribeIndicate that the givenModuleServiceConsumeris interested in using theModuleServiceindicated byserviceClass. TheModuleServiceConsumerwill be notified when theModuleServiceis ready for use.- Parameters:
- serviceClass- the Class used to indicate the- ModuleService.
- consumer- the- ModuleServiceConsumerinterested in the- ModuleService.
 
- 
unsubscribeIndicate that the givenModuleServiceConsumeris no longer interested in theModuleServiceindicated byserviceClass.- Parameters:
- serviceClass- the Class used to indicate the- ModuleService.
- consumer-- ModuleServiceConsumerto unsubscribe.
 
- 
notifyServiceReadyTo be called by aModuleServiceafter it is first ready for use.All ModuleServiceConsumers that subscribed prior to this call will be notified that the service is ready.- Parameters:
- service- the- ModuleServicethat is ready.
 
- 
notifyServiceShutdownTo be called by aModuleServicewhen it is longer ready for use.All subscribed ModuleServiceConsumers will be notified of the shutdown.- Parameters:
- service- the- ModuleServicethat is no longer ready for use.
 
 
-