messaging-activemq/src/main/java/org/wildfly/extension/messaging/activemq/AbstractActiveMQComponentControlHandler.java
protected final T getActiveMQComponentControl(final OperationContext context, final ModelNode operation, final boolean forWrite) throws OperationFailedException {
        final ServiceName artemisServiceName = MessagingServices.getActiveMQServiceName(PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR)));
        ServiceController<?> artemisService = context.getServiceRegistry(forWrite).getService(artemisServiceName);
        ActiveMQServer server = ActiveMQServer.class.cast(artemisService.getValue());
        PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR));
         T control = getActiveMQComponentControl(server, address);
         if (control == null) {
             throw ControllerLogger.ROOT_LOGGER.managementResourceNotFound(address);
         }
         return control;

    }
protected final T getActiveMQComponentControl(final OperationContext context, final ModelNode operation, final boolean forWrite) throws OperationFailedException {
        final ServiceName artemisServiceName = MessagingServices.getActiveMQServiceName(PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR)));
        ServiceController<?> artemisService = context.getServiceRegistry(forWrite).getService(artemisServiceName);
        ActiveMQServer server = ActiveMQServer.class.cast(artemisService.getValue());
        PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR));
         T control = getActiveMQComponentControl(server, address);
         if (control == null) {
             throw ControllerLogger.ROOT_LOGGER.managementResourceNotFound(address);
         }
         return control;

    }
protected final T getActiveMQComponentControl ( final OperationContext context , final ModelNode operation , final boolean forWrite ) throws OperationFailedException { final ServiceName artemisServiceName = MessagingServices . getActiveMQServiceName ( PathAddress . pathAddress ( operation . get ( ModelDescriptionConstants . OP_ADDR ) ) ) ; ServiceController < ? > artemisService = context . getServiceRegistry ( forWrite ) . getService ( artemisServiceName ) ; ActiveMQServer server = ActiveMQServer . class . cast ( artemisService . getValue ( ) ) ; PathAddress address = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) ; T control = getActiveMQComponentControl ( server , address ) ; if ( control == null ) { throw ControllerLogger . ROOT_LOGGER . managementResourceNotFound ( address ) ; } return control ; }
Gets the runtime ActiveMQ control object that can help service this request.

@param context  the operation context
@param operation the operation
@param forWrite {@code true} if this operation will modify the runtime; {@code false} if not.
@return the control object
@throws OperationFailedException
Gets the runtime ActiveMQ control object that can help service this request .