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: Every registered service or lookup participate in the lifecycle of this JolokiaServiceManager. I.e. their init() method is called during start() and their destroy() method during stop().
Since:
22.04.13
Author:
roland
  • Method Details

    • addService

      void addService(JolokiaService<?> pService)
      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

      void addServiceLookup(JolokiaServiceLookup pLookup)
      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

      void addServices(JolokiaServiceCreator pServiceCreator)
      A JolokiaServiceCreator is responsible for creating one or more service. These will be created right during this call and have the same lifecycle as static services added with addService(JolokiaService)
      Parameters:
      pServiceCreator - creator for creating the service
    • start

      Start up the service manager. All static services are initialized via its lifecycle method JolokiaService.init(JolokiaContext). For dynamic services, the lookup service obtains a handle to the created JolokiaContext via JolokiaServiceLookup.init(JolokiaContext). This method is omnipotent as it can be called multiple in sequence returning always the same JolokiaContext.
      Returns:
      the created jolokia context which can be used directly
    • stop

      void stop()
      Stop the service manager and all services by calling their lifecycle methods JolokiaService.destroy() and JolokiaServiceLookup.destroy() on all static and dynamic services. The Jolokia context returned on start is not valid anymore.