Example #1
0
  @Override
  protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model)
      throws OperationFailedException {
    final PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR));
    final String name = address.getLastElement().getValue();
    final ServiceTarget serviceTarget = context.getServiceTarget();
    final ServiceName serviceName =
        MessagingServices.getActiveMQServiceName(
            PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR)));

    final ModelNode selectorNode = SELECTOR.resolveModelAttribute(context, model);
    final boolean durable = DURABLE.resolveModelAttribute(context, model).asBoolean();

    final String selector = selectorNode.isDefined() ? selectorNode.asString() : null;

    // Do not pass the JNDI bindings to ActiveMQ but install them directly instead so that the
    // dependencies from the BinderServices to the JMSQueueService are not broken
    Service<Queue> queueService =
        JMSQueueService.installService(
            name, serviceTarget, serviceName, selector, durable, new String[0]);

    final ModelNode entries =
        CommonAttributes.DESTINATION_ENTRIES.resolveModelAttribute(context, model);
    final ServiceName jmsQueueServiceName =
        JMSServices.getJmsQueueBaseServiceName(serviceName).append(name);
    final String[] jndiBindings = JMSServices.getJndiBindings(entries);
    for (String jndiBinding : jndiBindings) {
      // install a binder service which depends on the JMS queue service
      BinderServiceUtil.installBinderService(
          serviceTarget, jndiBinding, queueService, jmsQueueServiceName);
    }
  }
Example #2
0
  protected void performRuntime(
      OperationContext context,
      ModelNode operation,
      ModelNode model,
      ServiceVerificationHandler verificationHandler,
      List<ServiceController<?>> newControllers)
      throws OperationFailedException {
    final PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR));
    final String name = address.getLastElement().getValue();
    final ServiceTarget serviceTarget = context.getServiceTarget();
    final ServiceName hqServiceName =
        MessagingServices.getHornetQServiceName(
            PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR)));

    final ModelNode selectorNode = SELECTOR.resolveModelAttribute(context, model);
    final boolean durable = DURABLE.resolveModelAttribute(context, model).asBoolean();

    final String selector = selectorNode.isDefined() ? selectorNode.asString() : null;
    final ModelNode entries =
        CommonAttributes.DESTINATION_ENTRIES.resolveModelAttribute(context, model);
    final String[] jndiBindings = JMSServices.getJndiBindings(entries);
    installServices(
        verificationHandler,
        newControllers,
        name,
        serviceTarget,
        hqServiceName,
        selector,
        durable,
        jndiBindings);
  }
 public static AttributeDefinition[] getRuntimeAttributeDefinitions() {
   return new AttributeDefinition[] {
     POLICY.getAttribute(),
     SELECTOR.getAttribute(),
     POLICY_OPTIONS.getAttribute(),
     SELECTOR_OPTIONS.getAttribute()
   };
 }