public abstract class AbstractHornetQComponentControlHandler<T extends org.hornetq.api.core.management.HornetQComponentControl>
extends org.jboss.as.controller.AbstractRuntimeOnlyHandler
OperationStepHandler implementations for handlers that interact
with an implementation of a HornetQComponentControl subinterface to perform their function. This base class
handles a "start" and "stop" operation as well as a "read-attribute" call reading runtime attribute "started".| Modifier | Constructor and Description |
|---|---|
protected |
AbstractHornetQComponentControlHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
executeRuntimeStep(org.jboss.as.controller.OperationContext context,
org.jboss.dmr.ModelNode operation) |
protected abstract String |
getDescriptionPrefix() |
protected abstract T |
getHornetQComponentControl(org.hornetq.core.server.HornetQServer hqServer,
org.jboss.as.controller.PathAddress address)
Gets the
HornetQComponentControl implementation used by this handler. |
protected T |
getHornetQComponentControl(org.jboss.as.controller.OperationContext context,
org.jboss.dmr.ModelNode operation,
boolean forWrite)
Gets the runtime HornetQ control object that can help service this request.
|
protected Object |
handleOperation(String operationName,
org.jboss.as.controller.OperationContext context,
org.jboss.dmr.ModelNode operation)
Hook to allow subclasses to handle operations other than
read-attribute, start and
stop. |
protected void |
handleReadAttribute(String attributeName,
org.jboss.as.controller.OperationContext context,
org.jboss.dmr.ModelNode operation)
Hook to allow subclasses to handle read-attribute requests for attributes other than
CommonAttributes.STARTED. |
protected void |
handleRevertOperation(String operationName,
org.jboss.as.controller.OperationContext context,
org.jboss.dmr.ModelNode operation,
Object handback)
Hook to allow subclasses to handle revert changes made in
handleOperation(String, org.jboss.as.controller.OperationContext, org.jboss.dmr.ModelNode). |
void |
registerAttributes(org.jboss.as.controller.registry.ManagementResourceRegistration registry) |
void |
registerOperations(org.jboss.as.controller.registry.ManagementResourceRegistration registry,
org.jboss.as.controller.descriptions.ResourceDescriptionResolver resolver) |
protected void |
unsupportedAttribute(String attributeName)
Return an ISE with a message saying support for the attribute was not properly implemented.
|
protected void |
unsupportedOperation(String operationName)
Return an ISE with a message saying support for the operation was not properly implemented.
|
protected AbstractHornetQComponentControlHandler()
protected void executeRuntimeStep(org.jboss.as.controller.OperationContext context,
org.jboss.dmr.ModelNode operation)
throws org.jboss.as.controller.OperationFailedException
executeRuntimeStep in class org.jboss.as.controller.AbstractRuntimeOnlyHandlerorg.jboss.as.controller.OperationFailedExceptionpublic void registerAttributes(org.jboss.as.controller.registry.ManagementResourceRegistration registry)
public void registerOperations(org.jboss.as.controller.registry.ManagementResourceRegistration registry,
org.jboss.as.controller.descriptions.ResourceDescriptionResolver resolver)
protected abstract T getHornetQComponentControl(org.hornetq.core.server.HornetQServer hqServer, org.jboss.as.controller.PathAddress address)
HornetQComponentControl implementation used by this handler.hqServer - the HornetQServer installed in the runtimeaddress - the address being invokedprotected abstract String getDescriptionPrefix()
protected void handleReadAttribute(String attributeName, org.jboss.as.controller.OperationContext context, org.jboss.dmr.ModelNode operation) throws org.jboss.as.controller.OperationFailedException
CommonAttributes.STARTED.
Implementations must not call any of the
context.completeStep variants.
This default implementation just throws the exception returned by unsupportedAttribute(String).
attributeName - the name of the attributecontext - the operation contextoperation - org.jboss.as.controller.OperationFailedExceptionprotected Object handleOperation(String operationName, org.jboss.as.controller.OperationContext context, org.jboss.dmr.ModelNode operation) throws org.jboss.as.controller.OperationFailedException
read-attribute, start and
stop. Implementations must not call any of the
context.completeStep variants.
This default implementation just throws the exception returned by unsupportedOperation(String).
operationName - the name of the operationcontext - the operation contextoperation - the operationhandleRevertOperation(String, org.jboss.as.controller.OperationContext, org.jboss.dmr.ModelNode, Object)
if the operation should be reverted. A value of null is an indication that no reversible
modification was madeorg.jboss.as.controller.OperationFailedExceptionprotected void handleRevertOperation(String operationName, org.jboss.as.controller.OperationContext context, org.jboss.dmr.ModelNode operation, Object handback)
handleOperation(String, org.jboss.as.controller.OperationContext, org.jboss.dmr.ModelNode).
This default implementation does nothing.
operationName - the name of the operationcontext - the operation contextoperation - the operationprotected final void unsupportedAttribute(String attributeName)
registerOperations(ManagementResourceRegistration, ResourceDescriptionResolver)
registers the attribute, so a handler then not recognizing the attribute name would be a bug and this method
returns an exception highlighting that bug.attributeName - the name of the attributeIllegalStateException - an exception with a message indicating a bug in this handlerprotected final void unsupportedOperation(String operationName)
registerOperations(ManagementResourceRegistration, ResourceDescriptionResolver)
registers it as a handler, so a handler then not recognizing the operation name would be a bug and this method
returns an exception highlighting that bug.operationName - the name of the attributeIllegalStateException - an exception with a message indicating a bug in this handlerprotected final T getHornetQComponentControl(org.jboss.as.controller.OperationContext context, org.jboss.dmr.ModelNode operation, boolean forWrite) throws org.jboss.as.controller.OperationFailedException
context - the operation contextoperation - the operationforWrite - true if this operation will modify the runtime; false if not.org.jboss.as.controller.OperationFailedExceptionCopyright © 2015 JBoss by Red Hat. All rights reserved.