Package org.jolokia.service.jsr160
Class Jsr160RequestHandler
java.lang.Object
org.jolokia.server.core.service.api.AbstractJolokiaService<org.jolokia.server.core.service.request.RequestHandler>
org.jolokia.server.core.service.request.AbstractRequestHandler
org.jolokia.service.jsr160.Jsr160RequestHandler
- All Implemented Interfaces:
Comparable<org.jolokia.server.core.service.request.RequestHandler>,org.jolokia.server.core.service.api.JolokiaService<org.jolokia.server.core.service.request.RequestHandler>,org.jolokia.server.core.service.request.RequestHandler
public class Jsr160RequestHandler
extends org.jolokia.server.core.service.request.AbstractRequestHandler
Dispatcher for calling JSR-160 connectors
- Since:
- Nov 11, 2009
- Author:
- roland
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jolokia.server.core.service.api.JolokiaService
org.jolokia.server.core.service.api.JolokiaService.Init -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanHandle(org.jolokia.server.core.request.JolokiaRequest pJolokiaRequest) The request can be handled when a target configuration is given.voiddestroy()<R extends org.jolokia.server.core.request.JolokiaRequest>
ObjecthandleRequest(R pJmxReq, Object pPreviousResult) Call a remote connector based on the connection information contained in the request.voidinit(org.jolokia.server.core.service.api.JolokiaContext pContext) InitializationprepareEnv(Map<String, String> pTargetConfig) Override this if a special environment setup is required for JSR-160 connectionMethods inherited from class org.jolokia.server.core.service.request.AbstractRequestHandler
checkProvider, getRuntimeInfoMethods inherited from class org.jolokia.server.core.service.api.AbstractJolokiaService
compareTo, getJolokiaContext, getOrder, getType, isEnabled, registerJolokiaMBean, unregisterJolokiaMBeanMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface org.jolokia.server.core.service.api.JolokiaService
getOrder, getType, isEnabled
-
Field Details
-
ALLOWED_TARGETS_SYSPROP
- See Also:
-
ALLOWED_TARGETS_ENV
- See Also:
-
-
Constructor Details
-
Jsr160RequestHandler
public Jsr160RequestHandler(int pOrder) Create this request handler as service- Parameters:
pOrder- service order as given during construction.
-
-
Method Details
-
init
public void init(org.jolokia.server.core.service.api.JolokiaContext pContext) Initialization- Specified by:
initin interfaceorg.jolokia.server.core.service.api.JolokiaService<org.jolokia.server.core.service.request.RequestHandler>- Overrides:
initin classorg.jolokia.server.core.service.api.AbstractJolokiaService<org.jolokia.server.core.service.request.RequestHandler>- Parameters:
pContext- the jolokia context
-
handleRequest
public <R extends org.jolokia.server.core.request.JolokiaRequest> Object handleRequest(R pJmxReq, Object pPreviousResult) throws InstanceNotFoundException, AttributeNotFoundException, ReflectionException, MBeanException, IOException, org.jolokia.server.core.request.NotChangedException, org.jolokia.server.core.request.EmptyResponseException Call a remote connector based on the connection information contained in the request.- Parameters:
pJmxReq- the request to dispatch- Returns:
- result object
- Throws:
InstanceNotFoundExceptionAttributeNotFoundExceptionReflectionExceptionMBeanExceptionIOExceptionorg.jolokia.server.core.request.NotChangedExceptionorg.jolokia.server.core.request.EmptyResponseException
-
prepareEnv
Override this if a special environment setup is required for JSR-160 connection- Parameters:
pTargetConfig- the target configuration as obtained from the request- Returns:
- the prepared environment
-
canHandle
public boolean canHandle(org.jolokia.server.core.request.JolokiaRequest pJolokiaRequest) The request can be handled when a target configuration is given. The provider name space is optional here for backwards compatibility.- Specified by:
canHandlein interfaceorg.jolokia.server.core.service.request.RequestHandler- Overrides:
canHandlein classorg.jolokia.server.core.service.request.AbstractRequestHandler
-
getProvider
- Specified by:
getProviderin interfaceorg.jolokia.server.core.service.request.RequestHandler- Overrides:
getProviderin classorg.jolokia.server.core.service.request.AbstractRequestHandler
-
destroy
- Specified by:
destroyin interfaceorg.jolokia.server.core.service.api.JolokiaService<org.jolokia.server.core.service.request.RequestHandler>- Overrides:
destroyin classorg.jolokia.server.core.service.api.AbstractJolokiaService<org.jolokia.server.core.service.request.RequestHandler>- Throws:
JMException
-