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); }
protected void addHornetQStartupPoolService( final OperationContext context, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) { final ServiceName hornetQServiceName = org.jboss.as.messaging.MessagingServices.getHornetQServiceName("default"); final ServiceName serviceName = HornetQStartupPoolService.getServiceName(hornetQServiceName); HornetQStartupPoolService service = new HornetQStartupPoolService(); try { newControllers.add( context .getServiceTarget() .addService(serviceName, service) .addListener(verificationHandler) .setInitialMode(Mode.ON_DEMAND) .install()); } catch (DuplicateServiceException ignored) { // can happen if overlaid with Immutant } }