Class AbstractJolokiaService<T extends JolokiaService<?>>
java.lang.Object
org.jolokia.server.core.service.api.AbstractJolokiaService<T>
- All Implemented Interfaces:
Comparable<T>,JolokiaService<T>
- Direct Known Subclasses:
AbstractRequestHandler,DebugStore,VersionRequestHandler
public abstract class AbstractJolokiaService<T extends JolokiaService<?>>
extends Object
implements JolokiaService<T>
Abstract base class for
JolokiaServices.- Since:
- 22.04.13
- Author:
- roland
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jolokia.server.core.service.api.JolokiaService
JolokiaService.Init -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractJolokiaService(Class<T> pType, int pOrderId) Construction of a base service for a given type and order -
Method Summary
Modifier and TypeMethodDescriptionintvoiddestroy()Override for hooking into the lifecycleprotected JolokiaContextintgetOrder()Order of the service.getType()The service type which is used to distinguish the various services.voidinit(JolokiaContext pJolokiaContext) Override if access to the JolokiaContext is required.protected ObjectNameregisterJolokiaMBean(String pName, Object pMBean) Register an MBean with a unique qualifier for this agent.protected voidunregisterJolokiaMBean(ObjectName oName) Unregister MBean with the given name.
-
Constructor Details
-
AbstractJolokiaService
Construction of a base service for a given type and order- Parameters:
pType- service typepOrderId- order id. A user of JolokiaService must ensure that the given order id is unique for the given type. It used for ordering the services but is also used as an id when storing it in a set.
-
-
Method Details
-
getOrder
public int getOrder()Order of the service. The higher the number, the later in the list of services this service appears. Default order is 100.- Specified by:
getOrderin interfaceJolokiaService<T extends JolokiaService<?>>- Returns:
- the order of this service
-
getType
The service type which is used to distinguish the various services. The service type is an extension of this base interface and add service specific methods to it- Specified by:
getTypein interfaceJolokiaService<T extends JolokiaService<?>>- Returns:
- service type
-
destroy
Override for hooking into the lifecycle- Specified by:
destroyin interfaceJolokiaService<T extends JolokiaService<?>>- Throws:
Exception
-
init
Override if access to the JolokiaContext is required.- Specified by:
initin interfaceJolokiaService<T extends JolokiaService<?>>- Parameters:
pJolokiaContext- JolokiaContext used
-
compareTo
- Specified by:
compareToin interfaceComparable<T extends JolokiaService<?>>
-
registerJolokiaMBean
Register an MBean with a unique qualifier for this agent.- Parameters:
pName- name of the MBean to registerpMBean- the MBean to register
-
unregisterJolokiaMBean
Unregister MBean with the given name. If it hasn't been registered before withregisterJolokiaMBean(String, Object)then this is a no-op. Also, any error is logged but wont result in any exception- Parameters:
oName- name as returned during registration. If null, nothing happens
-
getJolokiaContext
-