Interface RequestHandler
- All Superinterfaces:
Comparable<RequestHandler>,JolokiaService<RequestHandler>
- All Known Implementing Classes:
AbstractRequestHandler,VersionRequestHandler
Interface for dispatching a request to a certain backend.
- Since:
- Nov 11, 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 handlers<R extends JolokiaRequest>
ObjecthandleRequest(R pJmxReq, Object pPreviousResult) Dispatch aJolokiaRequestto a certain backend and return the result of the JMX action.Methods inherited from interface java.lang.Comparable
compareToMethods inherited from interface org.jolokia.server.core.service.api.JolokiaService
destroy, getOrder, getType, init
-
Method Details
-
handleRequest
<R extends JolokiaRequest> Object handleRequest(R pJmxReq, Object pPreviousResult) throws JMException, IOException, NotChangedException, EmptyResponseException Dispatch 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- Parameters:
pJmxReq- the request to dispatchpPreviousResult- a result object from a previoushandleRequest(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).EmptyResponseException- when no response should be created
-
canHandle
Check whether current dispatcher can handle the given request- Parameters:
pJolokiaRequest- request to check- Returns:
- true if this dispatcher can handle the request
-
getProvider
String getProvider()Get the provider for which this handler is responsible- Returns:
- provider name for which this handler is responsible.
-
getRuntimeInfo
Object getRuntimeInfo()Any extra runtime associated with this handler, which is used in a "version" request to get information about request handlers- Returns:
- a object containing extra information and which must be serializable
-