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
  • Method Details

    • init

      public void init(JolokiaContext pJolokiaContext)
      Description copied from class: AbstractJolokiaService
      Override if access to the JolokiaContext is required.
      Specified by:
      init in interface JolokiaService<RequestHandler>
      Overrides:
      init in class AbstractJolokiaService<RequestHandler>
      Parameters:
      pJolokiaContext - JolokiaContext used
    • handleRequest

      public Object handleRequest(JolokiaRequest pJmxReq, Object pPreviousResult) throws JMException, IOException, NotChangedException
      Description copied from interface: RequestHandler
      Dispatch a JolokiaRequest to 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): <dl
      list
      java.util.Map
      search
      java.util.List
      For exclusive requests, the given object is null
      Specified by:
      handleRequest in interface RequestHandler
      Parameters:
      pJmxReq - the request to dispatch
      pPreviousResult - a result object from a previous RequestHandler.handleRequest(R, Object) call when JolokiaRequest.isExclusive() is false. This argument can be null
      Returns:
      result object
      Throws:
      JMException - if performing of the actions failes
      IOException - if handling fails
      NotChangedException - if the handled request's response hasnt changed (and the appropriate request parameter has been set).
    • canHandle

      public boolean canHandle(JolokiaRequest pJolokiaRequest)
      Check whether current dispatcher can handle the given request
      Specified by:
      canHandle in interface RequestHandler
      Parameters:
      pJolokiaRequest - request to check
      Returns:
      true if this dispatcher can handle the request
    • getProvider

      public String getProvider()
      Description copied from interface: RequestHandler
      Get the provider for which this handler is responsible
      Specified by:
      getProvider in interface RequestHandler
      Returns:
      provider name for which this handler is responsible.
    • getRuntimeInfo

      public Object getRuntimeInfo()
      Description copied from interface: RequestHandler
      Any extra runtime associated with this handler, which is used in a "version" request to get information about request handlers
      Specified by:
      getRuntimeInfo in interface RequestHandler
      Returns:
      a object containing extra information and which must be serializable