Interface ModuleServicesManager
- 
 public interface ModuleServicesManager
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description <T extends ModuleService>
 TgetService(java.lang.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(java.lang.Class<? extends ModuleService> serviceClass, ModuleService service)Registers aModuleServicefor use.voidsubscribe(java.lang.Class<? extends ModuleService> serviceClass, ModuleServiceConsumer consumer)Indicate that the givenModuleServiceConsumeris interested in using theModuleServiceindicated byserviceClass.voidunregisterService(java.lang.Class<? extends ModuleService> serviceClass)Unregisters aModuleServicewith the givenserviceClass.voidunsubscribe(java.lang.Class<? extends ModuleService> serviceClass, ModuleServiceConsumer consumer)Indicate that the givenModuleServiceConsumeris no longer interested in theModuleServiceindicated byserviceClass.
 
- 
- 
- 
Method Detail- 
registerServicevoid registerService(java.lang.Class<? extends ModuleService> serviceClass, ModuleService service) Registers aModuleServicefor use.- Parameters:
- serviceClass- the Class- ModuleServiceConsumers will request this service by.
- service- the- ModuleServiceprovided.
 
 - 
unregisterServicevoid unregisterService(java.lang.Class<? extends ModuleService> serviceClass) Unregisters aModuleServicewith the givenserviceClass.- Parameters:
- serviceClass- the- ModuleServiceClass to unregister.
 
 - 
getService<T extends ModuleService> T getService(java.lang.Class<T> serviceClass) Retrieves 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.
 
 - 
subscribevoid subscribe(java.lang.Class<? extends ModuleService> serviceClass, ModuleServiceConsumer consumer) Indicate 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.
 
 - 
unsubscribevoid unsubscribe(java.lang.Class<? extends ModuleService> serviceClass, ModuleServiceConsumer consumer) Indicate that the givenModuleServiceConsumeris no longer interested in theModuleServiceindicated byserviceClass.- Parameters:
- serviceClass- the Class used to indicate the- ModuleService.
- consumer-- ModuleServiceConsumerto unsubscribe.
 
 - 
notifyServiceReadyvoid notifyServiceReady(ModuleService service) To 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.
 
 - 
notifyServiceShutdownvoid notifyServiceShutdown(ModuleService service) To 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.
 
 
- 
 
-