Package org.jolokia.service.jmx.handler
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
-
Field Summary
Fields inherited from class org.jolokia.service.jmx.handler.AbstractCommandHandler
context, pProvider -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckForRestriction(org.jolokia.server.core.request.JolokiaWriteRequest pRequest) Check whether there is a restriction on the type to apply.doHandleSingleServerRequest(MBeanServerConnection server, org.jolokia.server.core.request.JolokiaWriteRequest request) Abstract method to be subclassed by a concrete handler for performing the request on a singleMBeanServerConnectionafter the checks are performed.org.jolokia.server.core.util.RequestTypegetType()The type of request which can be handledMethods inherited from class org.jolokia.service.jmx.handler.AbstractCommandHandler
checkForModifiedSince, checkType, destroy, doHandleAllServerRequest, handleAllServerRequest, handleAllServersAtOnce, handleSingleServerRequest, init, isObjectNameHidden
-
Constructor Details
-
WriteHandler
public WriteHandler()
-
-
Method Details
-
getType
public org.jolokia.server.core.util.RequestType getType()Description copied from interface:CommandHandlerThe 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:AbstractCommandHandlerCheck 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:
checkForRestrictionin classAbstractCommandHandler<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:AbstractCommandHandlerAbstract method to be subclassed by a concrete handler for performing the request on a singleMBeanServerConnectionafter the checks are performed. Subclasses should only implement the command logic.- Specified by:
doHandleSingleServerRequestin classAbstractCommandHandler<org.jolokia.server.core.request.JolokiaWriteRequest>- Parameters:
server- server to tryrequest- request to process- Returns:
- the object result from the request
- Throws:
IOException- when there's an error invokingMBeanServerConnectionJMException- JMX checked exception, because most requests are handled by dealing with MBeansorg.jolokia.server.core.request.BadRequestException- because some commands do more user input parsing in addition to what was checked when theJolokiaRequestwas created
-