Class VersionRequestHandler
java.lang.Object
org.jolokia.server.core.service.api.AbstractJolokiaService<RequestHandler>
org.jolokia.server.core.service.impl.VersionRequestHandler
- All Implemented Interfaces:
Comparable<RequestHandler>,JolokiaService<RequestHandler>,RequestHandler
public class VersionRequestHandler
extends AbstractJolokiaService<RequestHandler>
implements RequestHandler
Get the version of this agent as well as the protocol version
- Since:
- Jun 12, 2009
- Author:
- roland
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jolokia.server.core.service.api.JolokiaService
JolokiaService.Init -
Method Summary
Modifier and TypeMethodDescriptionbooleancanHandle(JolokiaRequest pJolokiaRequest) Check whether current dispatcher can handle the given requestGet the provider for which this handler is responsibleAny extra runtime associated with this handler, which is used in a "version" request to get information about request handlershandleRequest(JolokiaRequest pJmxReq, Object pPreviousResult) Dispatch aJolokiaRequestto a certain backend and return the result of the JMX action.voidinit(JolokiaContext pJolokiaContext) Override if access to the JolokiaContext is required.Methods inherited from class org.jolokia.server.core.service.api.AbstractJolokiaService
compareTo, destroy, getJolokiaContext, getOrder, getType, 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
destroy, getOrder, getType
-
Method Details
-
init
Description copied from class:AbstractJolokiaServiceOverride if access to the JolokiaContext is required.- Specified by:
initin interfaceJolokiaService<RequestHandler>- Overrides:
initin classAbstractJolokiaService<RequestHandler>- Parameters:
pJolokiaContext- JolokiaContext used
-
handleRequest
public Object handleRequest(JolokiaRequest pJmxReq, Object pPreviousResult) throws JMException, IOException, NotChangedException Description copied from interface:RequestHandlerDispatch aJolokiaRequestto a certain backend and return the result of the JMX action. Request can be divided can be in two categories: One which are dealt exclusively with a single handler within a single provider and others which response is merged from the outcome from several request handlers. For non-exclusive requests, multiple request handlers are called in sequence, where a latter request handler gets the result from a former as argument. In this case the request handler must either update the give object or return a new object from the same type with its own results appended. Each request type has a fixed type for the result objects (given and to be returned): <dllist- java.util.Map
search- java.util.List
For exclusive requests, the given object is null- Specified by:
handleRequestin interfaceRequestHandler- Parameters:
pJmxReq- the request to dispatchpPreviousResult- a result object from a previousRequestHandler.handleRequest(R, Object)call whenJolokiaRequest.isExclusive()isfalse. This argument can benull- Returns:
- result object
- Throws:
JMException- if performing of the actions failesIOException- if handling failsNotChangedException- if the handled request's response hasnt changed (and the appropriate request parameter has been set).
-
canHandle
Check whether current dispatcher can handle the given request- Specified by:
canHandlein interfaceRequestHandler- Parameters:
pJolokiaRequest- request to check- Returns:
- true if this dispatcher can handle the request
-
getProvider
Description copied from interface:RequestHandlerGet the provider for which this handler is responsible- Specified by:
getProviderin interfaceRequestHandler- Returns:
- provider name for which this handler is responsible.
-
getRuntimeInfo
Description copied from interface:RequestHandlerAny extra runtime associated with this handler, which is used in a "version" request to get information about request handlers- Specified by:
getRuntimeInfoin interfaceRequestHandler- Returns:
- a object containing extra information and which must be serializable
-