Class BackendManager

java.lang.Object
org.jolokia.server.core.backend.BackendManager

public class BackendManager extends Object
Backendmanager for dispatching to various backends based on a given JolokiaRequest
Since:
Nov 11, 2009
Author:
roland
  • Constructor Details

    • BackendManager

      public BackendManager(JolokiaContext pJolokiaCtx)
      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:
      JMException
      IOException
      EmptyResponseException
    • convertExceptionToJson

      public Object convertExceptionToJson(Throwable pExp, JolokiaRequest pJmxReq)
      Convert a Throwable to a JSON object so that it can be included in an error response
      Parameters:
      pExp - throwable to convert
      pJmxReq - the request from where to take the serialization options
      Returns:
      the exception.