Package org.jolokia.server.core.backend
Class BackendManager
java.lang.Object
org.jolokia.server.core.backend.BackendManager
Backendmanager for dispatching to various backends based on a given
JolokiaRequest- Since:
- Nov 11, 2009
- Author:
- roland
-
Constructor Summary
ConstructorsConstructorDescriptionBackendManager(JolokiaContext pJolokiaCtx) Construct a new backend manager with the given configuration and with the default request dispatcher -
Method Summary
Modifier and TypeMethodDescriptionconvertExceptionToJson(Throwable pExp, JolokiaRequest pJmxReq) Convert a Throwable to a JSON object so that it can be included in an error responseorg.json.simple.JSONObjecthandleRequest(JolokiaRequest pJmxReq) Handle a single JMXRequest.
-
Constructor Details
-
BackendManager
Construct a new backend manager with the given configuration and with the default request dispatcher- Parameters:
pJolokiaCtx- jolokia context for accessing internal services
-
-
Method Details
-
handleRequest
public org.json.simple.JSONObject handleRequest(JolokiaRequest pJmxReq) throws JMException, IOException, EmptyResponseException Handle a single JMXRequest. The response status is set to 200 if the request was successful- Parameters:
pJmxReq- request to perform- Returns:
- the already converted answer.
- Throws:
JMExceptionIOExceptionEmptyResponseException
-
convertExceptionToJson
Convert a Throwable to a JSON object so that it can be included in an error response- Parameters:
pExp- throwable to convertpJmxReq- the request from where to take the serialization options- Returns:
- the exception.
-