Class WriteHandler

java.lang.Object
org.jolokia.service.jmx.handler.AbstractCommandHandler<org.jolokia.server.core.request.JolokiaWriteRequest>
org.jolokia.service.jmx.handler.WriteHandler
All Implemented Interfaces:
CommandHandler<org.jolokia.server.core.request.JolokiaWriteRequest>

public class WriteHandler extends AbstractCommandHandler<org.jolokia.server.core.request.JolokiaWriteRequest>
Handler for dealing with write request.
Since:
Jun 12, 2009
Author:
roland
  • Constructor Details

    • WriteHandler

      public WriteHandler()
  • Method Details

    • getType

      public org.jolokia.server.core.util.RequestType getType()
      Description copied from interface: CommandHandler
      The type of request which can be handled
      Returns:
      the request type of this handler
    • checkForRestriction

      protected void checkForRestriction(org.jolokia.server.core.request.JolokiaWriteRequest pRequest)
      Description copied from class: AbstractCommandHandler
      Check whether there is a restriction on the type to apply. This method should be overwritten by specific handlers if they support a more sophisticated check than only for the type
      Specified by:
      checkForRestriction in class AbstractCommandHandler<org.jolokia.server.core.request.JolokiaWriteRequest>
      Parameters:
      pRequest - request to check
    • doHandleSingleServerRequest

      public Object doHandleSingleServerRequest(MBeanServerConnection server, org.jolokia.server.core.request.JolokiaWriteRequest request) throws IOException, JMException, org.jolokia.server.core.request.BadRequestException
      Description copied from class: AbstractCommandHandler
      Abstract method to be subclassed by a concrete handler for performing the request on a single MBeanServerConnection after the checks are performed. Subclasses should only implement the command logic.
      Specified by:
      doHandleSingleServerRequest in class AbstractCommandHandler<org.jolokia.server.core.request.JolokiaWriteRequest>
      Parameters:
      server - server to try
      request - request to process
      Returns:
      the object result from the request
      Throws:
      IOException - when there's an error invoking MBeanServerConnection
      JMException - JMX checked exception, because most requests are handled by dealing with MBeans
      org.jolokia.server.core.request.BadRequestException - because some commands do more user input parsing in addition to what was checked when the JolokiaRequest was created