Package org.jolokia.service.jmx.handler
Class SearchHandler
java.lang.Object
org.jolokia.service.jmx.handler.AbstractCommandHandler<org.jolokia.server.core.request.JolokiaSearchRequest>
org.jolokia.service.jmx.handler.SearchHandler
- All Implemented Interfaces:
CommandHandler<org.jolokia.server.core.request.JolokiaSearchRequest>
public class SearchHandler
extends AbstractCommandHandler<org.jolokia.server.core.request.JolokiaSearchRequest>
Handler responsible for searching for MBean names.
- Since:
- Jun 18, 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.JolokiaSearchRequest pRequest) Check whether there is a restriction on the type to apply.doHandleAllServerRequest(org.jolokia.server.core.util.jmx.MBeanServerAccess serverManager, org.jolokia.server.core.request.JolokiaSearchRequest request, Object pPreviousResult) Default implementation for handling a request for multiple servers at once.protected ObjectdoHandleSingleServerRequest(MBeanServerConnection server, org.jolokia.server.core.request.JolokiaSearchRequest 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 handledbooleanhandleAllServersAtOnce(org.jolokia.server.core.request.JolokiaSearchRequest pRequest) Override this if you want all available MBeanServers to be passed to this command handler, e.g., to query each server on your own.Methods inherited from class org.jolokia.service.jmx.handler.AbstractCommandHandler
checkForModifiedSince, checkType, destroy, handleAllServerRequest, handleSingleServerRequest, init, isObjectNameHidden
-
Constructor Details
-
SearchHandler
public SearchHandler()
-
-
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.JolokiaSearchRequest 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.JolokiaSearchRequest>- Parameters:
pRequest- request to check
-
handleAllServersAtOnce
public boolean handleAllServersAtOnce(org.jolokia.server.core.request.JolokiaSearchRequest pRequest) Description copied from interface:CommandHandlerOverride this if you want all available MBeanServers to be passed to this command handler, e.g., to query each server on your own. By default, iteration over the available MBeanServers is done by theRequestHandlerand this command handler is called throughCommandHandler.handleSingleServerRequest(MBeanServerConnection, JolokiaRequest).- Specified by:
handleAllServersAtOncein interfaceCommandHandler<org.jolokia.server.core.request.JolokiaSearchRequest>- Overrides:
handleAllServersAtOncein classAbstractCommandHandler<org.jolokia.server.core.request.JolokiaSearchRequest>- Parameters:
pRequest- request to decide on whether to handle all request at once- Returns:
- whether you want to have
CommandHandler.handleSingleServerRequest(MBeanServerConnection, JolokiaRequest)(false) orCommandHandler.handleAllServerRequest(MBeanServerAccess, JolokiaRequest, Object)(true) called.
-
doHandleSingleServerRequest
protected Object doHandleSingleServerRequest(MBeanServerConnection server, org.jolokia.server.core.request.JolokiaSearchRequest request) 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.JolokiaSearchRequest>- Parameters:
server- server to tryrequest- request to process- Returns:
- the object result from the request
-
doHandleAllServerRequest
public Object doHandleAllServerRequest(org.jolokia.server.core.util.jmx.MBeanServerAccess serverManager, org.jolokia.server.core.request.JolokiaSearchRequest request, Object pPreviousResult) throws IOException, org.jolokia.server.core.request.NotChangedException Description copied from class:AbstractCommandHandlerDefault implementation for handling a request for multiple servers at once. A subclass, which returns,truefromAbstractCommandHandler.handleAllServersAtOnce(JolokiaRequest), needs to override this method. IfAbstractCommandHandler.handleAllServersAtOnce(JolokiaRequest)returnsfalse, the iteration over availableconnectionsis performed by the caller (RequestHandler).- Overrides:
doHandleAllServerRequestin classAbstractCommandHandler<org.jolokia.server.core.request.JolokiaSearchRequest>- Parameters:
serverManager- all MBean servers found in this JVMrequest- the original requestpPreviousResult- a previous result which for merging requests can be used to merge the data- Returns:
- the result of the the request.
- Throws:
IOException- when there's an error invokingMBeanServerConnectionorg.jolokia.server.core.request.NotChangedException- when (according to request parameters) user wants HTTP 304 if nothing has changed
-