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
The proxy Jolokia
RequestHandler, which
invokes an operation on a single MBeanServerConnection using JMXConnector.- 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 -
Constructor Summary
ConstructorsConstructorDescriptionJsr160RequestHandler(int pOrder) Create a new proxy request handler which accesses remote MBeans. -
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
-
Constructor Details
-
Jsr160RequestHandler
public Jsr160RequestHandler(int pOrder) Create a new proxy request handler which accesses remote MBeans.- 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
-
canHandle
public boolean canHandle(org.jolokia.server.core.request.JolokiaRequest pJolokiaRequest) The request can be handled when a target configuration is given. The provider namespace 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
-
handleRequest
public <R extends org.jolokia.server.core.request.JolokiaRequest> Object handleRequest(R pJmxReq, Object pPreviousResult) throws IOException, JMException, JMRuntimeException, org.jolokia.server.core.request.NotChangedException, org.jolokia.server.core.request.BadRequestException, 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:
InstanceNotFoundExceptionAttributeNotFoundExceptionReflectionExceptionMBeanExceptionIOExceptionJMExceptionJMRuntimeExceptionorg.jolokia.server.core.request.NotChangedExceptionorg.jolokia.server.core.request.BadRequestExceptionorg.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
-
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
-