Class AbstractActiveMQComponentControlHandler<T extends ActiveMQComponentControl>

java.lang.Object
org.jboss.as.controller.AbstractRuntimeOnlyHandler
org.wildfly.extension.messaging.activemq.AbstractActiveMQComponentControlHandler<T>
All Implemented Interfaces:
org.jboss.as.controller.OperationStepHandler
Direct Known Subclasses:
AcceptorControlHandler, BridgeControlHandler, BroadcastGroupControlHandler, ClusterConnectionControlHandler

public abstract class AbstractActiveMQComponentControlHandler<T extends ActiveMQComponentControl> extends org.jboss.as.controller.AbstractRuntimeOnlyHandler
Base class for OperationStepHandler implementations for handlers that interact with an implementation of a ActiveMQComponentControl 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".
Author:
Brian Stansberry (c) 2011 Red Hat Inc.
  • Constructor Details

    • AbstractActiveMQComponentControlHandler

      protected AbstractActiveMQComponentControlHandler()
  • Method Details

    • executeRuntimeStep

      protected void executeRuntimeStep(org.jboss.as.controller.OperationContext context, ModelNode operation) throws org.jboss.as.controller.OperationFailedException
      Specified by:
      executeRuntimeStep in class org.jboss.as.controller.AbstractRuntimeOnlyHandler
      Throws:
      org.jboss.as.controller.OperationFailedException
    • registerAttributes

      public void registerAttributes(org.jboss.as.controller.registry.ManagementResourceRegistration registry)
    • registerOperations

      public void registerOperations(org.jboss.as.controller.registry.ManagementResourceRegistration registry, org.jboss.as.controller.descriptions.ResourceDescriptionResolver resolver)
    • getActiveMQComponentControl

      protected abstract T getActiveMQComponentControl(ActiveMQBroker activeMQBroker, org.jboss.as.controller.PathAddress address)
      Gets the ActiveMQComponentControl implementation used by this handler.
      Parameters:
      activeMQBroker - the ActiveMQ server installed in the runtime
      address - the address being invoked
      Returns:
      the runtime ActiveMQ control object associated with the given address
    • getDescriptionPrefix

      protected abstract String getDescriptionPrefix()
    • handleReadAttribute

      protected void handleReadAttribute(String attributeName, org.jboss.as.controller.OperationContext context, ModelNode operation) throws org.jboss.as.controller.OperationFailedException
      Hook to allow subclasses to handle read-attribute requests for attributes other than CommonAttributes.STARTED. Implementations must not call any of the context.completeStep variants.

      This default implementation just throws the exception returned by unsupportedAttribute(String).

      Parameters:
      attributeName - the name of the attribute
      context - the operation context
      operation -
      Throws:
      org.jboss.as.controller.OperationFailedException
    • handleOperation

      protected Object handleOperation(String operationName, org.jboss.as.controller.OperationContext context, ModelNode operation) throws org.jboss.as.controller.OperationFailedException
      Hook to allow subclasses to handle operations other than 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).

      Parameters:
      operationName - the name of the operation
      context - the operation context
      operation - the operation
      Returns:
      an object that can be passed back in handleRevertOperation(String, OperationContext, ModelNode, Object) if the operation should be reverted. A value of null is an indication that no reversible modification was made
      Throws:
      org.jboss.as.controller.OperationFailedException
    • handleRevertOperation

      protected void handleRevertOperation(String operationName, org.jboss.as.controller.OperationContext context, ModelNode operation, Object handback)
      Hook to allow subclasses to handle revert changes made in handleOperation(String, OperationContext, ModelNode).

      This default implementation does nothing.

      Parameters:
      operationName - the name of the operation
      context - the operation context
      operation - the operation
    • unsupportedAttribute

      protected final void unsupportedAttribute(String attributeName)
      Return an ISE with a message saying support for the attribute was not properly implemented. This handler should only be called if for a "read-attribute" operation if 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.
      Parameters:
      attributeName - the name of the attribute
      Throws:
      IllegalStateException - an exception with a message indicating a bug in this handler
    • unsupportedOperation

      protected final void unsupportedOperation(String operationName)
      Return an ISE with a message saying support for the operation was not properly implemented. This handler should only be called if for a n operation if 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.
      Parameters:
      operationName - the name of the attribute
      Throws:
      IllegalStateException - an exception with a message indicating a bug in this handler
    • getActiveMQComponentControl

      protected final T getActiveMQComponentControl(org.jboss.as.controller.OperationContext context, ModelNode operation, boolean forWrite) throws org.jboss.as.controller.OperationFailedException
      Gets the runtime ActiveMQ control object that can help service this request.
      Parameters:
      context - the operation context
      operation - the operation
      forWrite - true if this operation will modify the runtime; false if not.
      Returns:
      the control object
      Throws:
      org.jboss.as.controller.OperationFailedException