Interface RequestHandler

All Superinterfaces:
Comparable<RequestHandler>, JolokiaService<RequestHandler>
All Known Implementing Classes:
AbstractRequestHandler, VersionRequestHandler

public interface RequestHandler extends JolokiaService<RequestHandler>
Interface for dispatching a request to a certain backend.
Since:
Nov 11, 2009
Author:
roland
  • Method Details

    • handleRequest

      <R extends JolokiaRequest> Object handleRequest(R pJmxReq, Object pPreviousResult) throws JMException, IOException, NotChangedException, EmptyResponseException
      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
      Parameters:
      pJmxReq - the request to dispatch
      pPreviousResult - a result object from a previous 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).
      EmptyResponseException - when no response should be created
    • canHandle

      boolean canHandle(JolokiaRequest pJolokiaRequest)
      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