Interface JolokiaServiceManager
- All Known Implementing Classes:
JolokiaServiceManagerImpl
public interface JolokiaServiceManager
The service manager is responsible for building/looking up
JolokiaServices and for creating a
JolokiaContext.
Service can be added or created in various ways:
addService(JolokiaService)adds static services which already exist.addServices(JolokiaServiceCreator)can be used to add a bunch of static services via an lookupaddServiceLookup(JolokiaServiceLookup)add as a lookup handler which will check for services each timeJolokiaContext.getServices(Class)is called
init() method is called during start() and their destroy() method during stop().- Since:
- 22.04.13
- Author:
- roland
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddService(JolokiaService<?> pService) Add a single service.voidaddServiceLookup(JolokiaServiceLookup pLookup) Add a service factory for dynamically looking up services.voidaddServices(JolokiaServiceCreator pServiceCreator) AJolokiaServiceCreatoris responsible for creating one or more service.start()Start up the service manager.voidstop()Stop the service manager and all services by calling their lifecycle methodsJolokiaService.destroy()andJolokiaServiceLookup.destroy()on all static and dynamic services.
-
Method Details
-
addService
Add a single service. This service is static in so far as it is in use until the end of this service manager- Parameters:
pService- service to add
-
addServiceLookup
Add a service factory for dynamically looking up services. This is especially useful when services can come and go dynamically.JolokiaServiceLookup.getServices(Class)will be always called when looking up services within the core.- Parameters:
pLookup- lookup for services to add.
-
addServices
AJolokiaServiceCreatoris responsible for creating one or more service. These will be created right during this call and have the same lifecycle as static services added withaddService(JolokiaService)- Parameters:
pServiceCreator- creator for creating the service
-
start
JolokiaContext start()Start up the service manager. All static services are initialized via its lifecycle methodJolokiaService.init(JolokiaContext). For dynamic services, the lookup service obtains a handle to the createdJolokiaContextviaJolokiaServiceLookup.init(JolokiaContext). This method is omnipotent as it can be called multiple in sequence returning always the sameJolokiaContext.- Returns:
- the created jolokia context which can be used directly
-
stop
void stop()Stop the service manager and all services by calling their lifecycle methodsJolokiaService.destroy()andJolokiaServiceLookup.destroy()on all static and dynamic services. The Jolokia context returned on start is not valid anymore.
-