Search in sources :

Example 1 with CommandDispatcherBroadcastEndpointFactory

use of org.wildfly.extension.messaging.activemq.broadcast.CommandDispatcherBroadcastEndpointFactory in project wildfly by wildfly.

the class JGroupsDiscoveryGroupAdd method createDiscoveryGroupConfiguration.

public static DiscoveryGroupConfiguration createDiscoveryGroupConfiguration(final String name, final DiscoveryGroupConfiguration config, final BroadcastCommandDispatcherFactory commandDispatcherFactory, final String channelName) throws Exception {
    final long refreshTimeout = config.getRefreshTimeout();
    final long initialWaitTimeout = config.getDiscoveryInitialWaitTimeout();
    final BroadcastEndpointFactory endpointFactory = new CommandDispatcherBroadcastEndpointFactory(commandDispatcherFactory, channelName);
    return new DiscoveryGroupConfiguration().setName(name).setRefreshTimeout(refreshTimeout).setDiscoveryInitialWaitTimeout(initialWaitTimeout).setBroadcastEndpointFactory(endpointFactory);
}
Also used : DiscoveryGroupConfiguration(org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration) CommandDispatcherBroadcastEndpointFactory(org.wildfly.extension.messaging.activemq.broadcast.CommandDispatcherBroadcastEndpointFactory) CommandDispatcherBroadcastEndpointFactory(org.wildfly.extension.messaging.activemq.broadcast.CommandDispatcherBroadcastEndpointFactory) BroadcastEndpointFactory(org.apache.activemq.artemis.api.core.BroadcastEndpointFactory)

Example 2 with CommandDispatcherBroadcastEndpointFactory

use of org.wildfly.extension.messaging.activemq.broadcast.CommandDispatcherBroadcastEndpointFactory in project wildfly by wildfly.

the class ActiveMQResourceAdapter method createBroadcastEndpointFactory.

@Override
protected BroadcastEndpointFactory createBroadcastEndpointFactory(ConnectionFactoryProperties overrideProperties) {
    String clusterName = overrideProperties.getJgroupsChannelName() != null ? overrideProperties.getJgroupsChannelName() : getJgroupsChannelName();
    if (clusterName != null) {
        String channelRefName = this.getProperties().getJgroupsChannelRefName();
        String[] split = channelRefName.split("/");
        String serverName = split[0];
        String key = split[1];
        String pcf = null;
        if (key.indexOf(':') >= 0) {
            split = key.split(":");
            pcf = split[0];
            key = split[1];
        }
        if (serverName != null && !serverName.isEmpty()) {
            ActiveMQServerService service = (ActiveMQServerService) currentServiceContainer().getService(MessagingServices.getActiveMQServiceName(serverName)).getService();
            return new CommandDispatcherBroadcastEndpointFactory(service.getCommandDispatcherFactory(key), clusterName);
        }
        assert pcf != null;
        ExternalPooledConnectionFactoryService service = (ExternalPooledConnectionFactoryService) currentServiceContainer().getService(JMSServices.getPooledConnectionFactoryBaseServiceName(MessagingServices.getActiveMQServiceName()).append(pcf)).getService();
        return new CommandDispatcherBroadcastEndpointFactory(service.getCommandDispatcherFactory(key), clusterName);
    }
    return super.createBroadcastEndpointFactory(overrideProperties);
}
Also used : ExternalPooledConnectionFactoryService(org.wildfly.extension.messaging.activemq.jms.ExternalPooledConnectionFactoryService) CommandDispatcherBroadcastEndpointFactory(org.wildfly.extension.messaging.activemq.broadcast.CommandDispatcherBroadcastEndpointFactory)

Example 3 with CommandDispatcherBroadcastEndpointFactory

use of org.wildfly.extension.messaging.activemq.broadcast.CommandDispatcherBroadcastEndpointFactory in project wildfly by wildfly.

the class JGroupsBroadcastGroupAdd method createBroadcastGroupConfiguration.

static BroadcastGroupConfiguration createBroadcastGroupConfiguration(final String name, final BroadcastGroupConfiguration config, final BroadcastCommandDispatcherFactory commandDispatcherFactory, final String channelName) throws Exception {
    final long broadcastPeriod = config.getBroadcastPeriod();
    final List<String> connectorRefs = config.getConnectorInfos();
    final BroadcastEndpointFactory endpointFactory = new CommandDispatcherBroadcastEndpointFactory(commandDispatcherFactory, channelName);
    return new BroadcastGroupConfiguration().setName(name).setBroadcastPeriod(broadcastPeriod).setConnectorInfos(connectorRefs).setEndpointFactory(endpointFactory);
}
Also used : CommandDispatcherBroadcastEndpointFactory(org.wildfly.extension.messaging.activemq.broadcast.CommandDispatcherBroadcastEndpointFactory) BroadcastGroupConfiguration(org.apache.activemq.artemis.api.core.BroadcastGroupConfiguration) CommandDispatcherBroadcastEndpointFactory(org.wildfly.extension.messaging.activemq.broadcast.CommandDispatcherBroadcastEndpointFactory) BroadcastEndpointFactory(org.apache.activemq.artemis.api.core.BroadcastEndpointFactory)

Example 4 with CommandDispatcherBroadcastEndpointFactory

use of org.wildfly.extension.messaging.activemq.broadcast.CommandDispatcherBroadcastEndpointFactory in project wildfly by wildfly.

the class ExternalPooledConnectionFactoryService method createService.

private void createService(ServiceTarget serviceTarget, ServiceContainer container) throws Exception {
    InputStream is = null;
    InputStream isIj = null;
    // Properties for the resource adapter
    List<ConfigProperty> properties = new ArrayList<ConfigProperty>();
    try {
        StringBuilder connectorClassname = new StringBuilder();
        StringBuilder connectorParams = new StringBuilder();
        TransportConfigOperationHandlers.processConnectorBindings(Arrays.asList(connectors), socketBindings, outboundSocketBindings);
        for (TransportConfiguration tc : connectors) {
            if (tc == null) {
                throw MessagingLogger.ROOT_LOGGER.connectorNotDefined("null");
            }
            if (connectorClassname.length() > 0) {
                connectorClassname.append(",");
                connectorParams.append(",");
            }
            connectorClassname.append(tc.getFactoryClassName());
            Map<String, Object> params = tc.getParams();
            boolean multiple = false;
            for (Map.Entry<String, Object> entry : params.entrySet()) {
                if (multiple) {
                    connectorParams.append(";");
                }
                connectorParams.append(entry.getKey()).append("=").append(entry.getValue());
                multiple = true;
            }
        }
        if (connectorClassname.length() > 0) {
            properties.add(simpleProperty15(CONNECTOR_CLASSNAME, STRING_TYPE, connectorClassname.toString()));
        }
        if (connectorParams.length() > 0) {
            properties.add(simpleProperty15(CONNECTION_PARAMETERS, STRING_TYPE, connectorParams.toString()));
        }
        if (discoveryGroupConfiguration != null) {
            final String dgName = discoveryGroupConfiguration.getName();
            final String key = "discovery" + dgName;
            final DiscoveryGroupConfiguration config;
            if (commandDispatcherFactories.containsKey(key)) {
                BroadcastCommandDispatcherFactory commandDispatcherFactory = commandDispatcherFactories.get(key).get();
                String clusterName = clusterNames.get(key);
                config = JGroupsDiscoveryGroupAdd.createDiscoveryGroupConfiguration(name, discoveryGroupConfiguration, commandDispatcherFactory, clusterName);
            } else {
                final SocketBinding binding = groupBindings.get(key).get();
                if (binding == null) {
                    throw MessagingLogger.ROOT_LOGGER.failedToFindDiscoverySocketBinding(dgName);
                }
                config = SocketDiscoveryGroupAdd.createDiscoveryGroupConfiguration(name, discoveryGroupConfiguration, binding);
                binding.getSocketBindings().getNamedRegistry().registerBinding(ManagedBinding.Factory.createSimpleManagedBinding(binding));
            }
            BroadcastEndpointFactory bgCfg = config.getBroadcastEndpointFactory();
            if (bgCfg instanceof UDPBroadcastEndpointFactory) {
                UDPBroadcastEndpointFactory udpCfg = (UDPBroadcastEndpointFactory) bgCfg;
                properties.add(simpleProperty15(GROUP_ADDRESS, STRING_TYPE, udpCfg.getGroupAddress()));
                properties.add(simpleProperty15(GROUP_PORT, INTEGER_TYPE, "" + udpCfg.getGroupPort()));
                properties.add(simpleProperty15(DISCOVERY_LOCAL_BIND_ADDRESS, STRING_TYPE, "" + udpCfg.getLocalBindAddress()));
            } else if (bgCfg instanceof CommandDispatcherBroadcastEndpointFactory) {
                String external = "/" + name + ":discovery" + dgName;
                properties.add(simpleProperty15(JGROUPS_CHANNEL_NAME, STRING_TYPE, jgroupsClusterName));
                properties.add(simpleProperty15(JGROUPS_CHANNEL_REF_NAME, STRING_TYPE, external));
            }
            properties.add(simpleProperty15(DISCOVERY_INITIAL_WAIT_TIMEOUT, LONG_TYPE, "" + config.getDiscoveryInitialWaitTimeout()));
            properties.add(simpleProperty15(REFRESH_TIMEOUT, LONG_TYPE, "" + config.getRefreshTimeout()));
        }
        boolean hasReconnect = false;
        final List<ConfigProperty> inboundProperties = new ArrayList<>();
        final List<ConfigProperty> outboundProperties = new ArrayList<>();
        final String reconnectName = ConnectionFactoryAttributes.Pooled.RECONNECT_ATTEMPTS_PROP_NAME;
        for (PooledConnectionFactoryConfigProperties adapterParam : adapterParams) {
            hasReconnect |= reconnectName.equals(adapterParam.getName());
            ConfigProperty p = simpleProperty15(adapterParam.getName(), adapterParam.getType(), adapterParam.getValue());
            if (adapterParam.getName().equals(REBALANCE_CONNECTIONS_PROP_NAME)) {
                boolean rebalanceConnections = Boolean.parseBoolean(adapterParam.getValue());
                if (rebalanceConnections) {
                    inboundProperties.add(p);
                }
            } else {
                if (null == adapterParam.getConfigType()) {
                    properties.add(p);
                } else {
                    switch(adapterParam.getConfigType()) {
                        case INBOUND:
                            inboundProperties.add(p);
                            break;
                        case OUTBOUND:
                            outboundProperties.add(p);
                            break;
                        default:
                            properties.add(p);
                            break;
                    }
                }
            }
        }
        // The default -1, which will hang forever until a server appears
        if (!hasReconnect) {
            properties.add(simpleProperty15(reconnectName, Integer.class.getName(), DEFAULT_MAX_RECONNECTS));
        }
        configureCredential(properties);
        WildFlyRecoveryRegistry.container = container;
        OutboundResourceAdapter outbound = createOutbound(outboundProperties);
        InboundResourceAdapter inbound = createInbound(inboundProperties);
        ResourceAdapter ra = createResourceAdapter15(properties, outbound, inbound);
        Connector cmd = createConnector15(ra);
        TransactionSupportEnum transactionSupport = getTransactionSupport(txSupport);
        ConnectionDefinition common = createConnDef(transactionSupport, bindInfo.getBindName(), minPoolSize, maxPoolSize, managedConnectionPoolClassName, enlistmentTrace);
        Activation activation = createActivation(common, transactionSupport);
        ResourceAdapterActivatorService activator = new ResourceAdapterActivatorService(cmd, activation, ExternalPooledConnectionFactoryService.class.getClassLoader(), name);
        activator.setBindInfo(bindInfo);
        activator.setCreateBinderService(createBinderService);
        activator.addJndiAliases(jndiAliases);
        final ServiceBuilder sb = Services.addServerExecutorDependency(serviceTarget.addService(getResourceAdapterActivatorsServiceName(name), activator), activator.getExecutorServiceInjector()).addDependency(ConnectorServices.IRONJACAMAR_MDR, AS7MetadataRepository.class, activator.getMdrInjector()).addDependency(ConnectorServices.RA_REPOSITORY_SERVICE, ResourceAdapterRepository.class, activator.getRaRepositoryInjector()).addDependency(ConnectorServices.MANAGEMENT_REPOSITORY_SERVICE, ManagementRepository.class, activator.getManagementRepositoryInjector()).addDependency(ConnectorServices.RESOURCE_ADAPTER_REGISTRY_SERVICE, ResourceAdapterDeploymentRegistry.class, activator.getRegistryInjector()).addDependency(ConnectorServices.TRANSACTION_INTEGRATION_SERVICE, TransactionIntegration.class, activator.getTxIntegrationInjector()).addDependency(ConnectorServices.CONNECTOR_CONFIG_SERVICE, JcaSubsystemConfiguration.class, activator.getConfigInjector()).addDependency(ConnectorServices.CCM_SERVICE, CachedConnectionManager.class, activator.getCcmInjector());
        sb.requires(NamingService.SERVICE_NAME);
        sb.requires(capabilityServiceSupport.getCapabilityServiceName(MessagingServices.LOCAL_TRANSACTION_PROVIDER_CAPABILITY));
        sb.requires(ConnectorServices.BOOTSTRAP_CONTEXT_SERVICE.append("default"));
        sb.setInitialMode(ServiceController.Mode.PASSIVE).install();
        // Mock the deployment service to allow it to start
        serviceTarget.addService(ConnectorServices.RESOURCE_ADAPTER_DEPLOYER_SERVICE_PREFIX.append(name), Service.NULL).install();
    } finally {
        if (is != null) {
            is.close();
        }
        if (isIj != null) {
            isIj.close();
        }
    }
}
Also used : OutboundSocketBinding(org.jboss.as.network.OutboundSocketBinding) SocketBinding(org.jboss.as.network.SocketBinding) Connector(org.jboss.jca.common.api.metadata.spec.Connector) ConnectionDefinition(org.jboss.jca.common.api.metadata.resourceadapter.ConnectionDefinition) BroadcastCommandDispatcherFactory(org.wildfly.extension.messaging.activemq.broadcast.BroadcastCommandDispatcherFactory) JcaSubsystemConfiguration(org.jboss.as.connector.subsystems.jca.JcaSubsystemConfiguration) ArrayList(java.util.ArrayList) TransportConfiguration(org.apache.activemq.artemis.api.core.TransportConfiguration) Activation(org.jboss.jca.common.api.metadata.resourceadapter.Activation) XsdString(org.jboss.jca.common.api.metadata.spec.XsdString) LocalizedXsdString(org.jboss.jca.common.api.metadata.spec.LocalizedXsdString) ServiceBuilder(org.jboss.msc.service.ServiceBuilder) ResourceAdapter(org.jboss.jca.common.api.metadata.spec.ResourceAdapter) InboundResourceAdapter(org.jboss.jca.common.api.metadata.spec.InboundResourceAdapter) OutboundResourceAdapter(org.jboss.jca.common.api.metadata.spec.OutboundResourceAdapter) ActiveMQResourceAdapter(org.wildfly.extension.messaging.activemq.ActiveMQResourceAdapter) ResourceAdapterRepository(org.jboss.jca.core.spi.rar.ResourceAdapterRepository) UDPBroadcastEndpointFactory(org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory) ResourceAdapterDeploymentRegistry(org.jboss.as.connector.services.resourceadapters.deployment.registry.ResourceAdapterDeploymentRegistry) InboundResourceAdapter(org.jboss.jca.common.api.metadata.spec.InboundResourceAdapter) InputStream(java.io.InputStream) DiscoveryGroupConfiguration(org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration) CommandDispatcherBroadcastEndpointFactory(org.wildfly.extension.messaging.activemq.broadcast.CommandDispatcherBroadcastEndpointFactory) ResourceAdapterActivatorService(org.jboss.as.connector.services.resourceadapters.ResourceAdapterActivatorService) ConfigProperty(org.jboss.jca.common.api.metadata.spec.ConfigProperty) RequiredConfigProperty(org.jboss.jca.common.api.metadata.spec.RequiredConfigProperty) AdminObject(org.jboss.jca.common.api.metadata.resourceadapter.AdminObject) TransactionSupportEnum(org.jboss.jca.common.api.metadata.common.TransactionSupportEnum) Map(java.util.Map) HashMap(java.util.HashMap) OutboundResourceAdapter(org.jboss.jca.common.api.metadata.spec.OutboundResourceAdapter) CommandDispatcherBroadcastEndpointFactory(org.wildfly.extension.messaging.activemq.broadcast.CommandDispatcherBroadcastEndpointFactory) UDPBroadcastEndpointFactory(org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory) BroadcastEndpointFactory(org.apache.activemq.artemis.api.core.BroadcastEndpointFactory)

Example 5 with CommandDispatcherBroadcastEndpointFactory

use of org.wildfly.extension.messaging.activemq.broadcast.CommandDispatcherBroadcastEndpointFactory in project wildfly by wildfly.

the class PooledConnectionFactoryService method createService.

private void createService(ServiceTarget serviceTarget, ServiceContainer container) throws Exception {
    InputStream is = null;
    InputStream isIj = null;
    // Properties for the resource adapter
    List<ConfigProperty> properties = new ArrayList<ConfigProperty>();
    try {
        StringBuilder connectorClassname = new StringBuilder();
        StringBuilder connectorParams = new StringBuilder();
        // pick the first connector available if pickAnyConnectors is true
        if (discoveryGroupName == null && connectors.isEmpty() && pickAnyConnectors) {
            Set<String> connectorNames = activeMQServer.getValue().getConfiguration().getConnectorConfigurations().keySet();
            if (!connectorNames.isEmpty()) {
                String connectorName = connectorNames.iterator().next();
                MessagingLogger.ROOT_LOGGER.connectorForPooledConnectionFactory(name, connectorName);
                connectors.add(connectorName);
            }
        }
        for (String connector : connectors) {
            TransportConfiguration tc = activeMQServer.getValue().getConfiguration().getConnectorConfigurations().get(connector);
            if (tc == null) {
                throw MessagingLogger.ROOT_LOGGER.connectorNotDefined(connector);
            }
            if (connectorClassname.length() > 0) {
                connectorClassname.append(",");
                connectorParams.append(",");
            }
            connectorClassname.append(tc.getFactoryClassName());
            Map<String, Object> params = tc.getParams();
            boolean multiple = false;
            for (Map.Entry<String, Object> entry : params.entrySet()) {
                if (multiple) {
                    connectorParams.append(";");
                }
                connectorParams.append(entry.getKey()).append("=").append(entry.getValue());
                multiple = true;
            }
        }
        if (connectorClassname.length() > 0) {
            properties.add(simpleProperty15(CONNECTOR_CLASSNAME, STRING_TYPE, connectorClassname.toString()));
        }
        if (connectorParams.length() > 0) {
            properties.add(simpleProperty15(CONNECTION_PARAMETERS, STRING_TYPE, connectorParams.toString()));
        }
        if (discoveryGroupName != null) {
            DiscoveryGroupConfiguration discoveryGroupConfiguration = activeMQServer.getValue().getConfiguration().getDiscoveryGroupConfigurations().get(discoveryGroupName);
            BroadcastEndpointFactory bgCfg = discoveryGroupConfiguration.getBroadcastEndpointFactory();
            if (bgCfg instanceof UDPBroadcastEndpointFactory) {
                UDPBroadcastEndpointFactory udpCfg = (UDPBroadcastEndpointFactory) bgCfg;
                properties.add(simpleProperty15(GROUP_ADDRESS, STRING_TYPE, udpCfg.getGroupAddress()));
                properties.add(simpleProperty15(GROUP_PORT, INTEGER_TYPE, "" + udpCfg.getGroupPort()));
                properties.add(simpleProperty15(DISCOVERY_LOCAL_BIND_ADDRESS, STRING_TYPE, "" + udpCfg.getLocalBindAddress()));
            } else if (bgCfg instanceof CommandDispatcherBroadcastEndpointFactory) {
                properties.add(simpleProperty15(JGROUPS_CHANNEL_NAME, STRING_TYPE, jgroupsChannelName));
                properties.add(simpleProperty15(JGROUPS_CHANNEL_REF_NAME, STRING_TYPE, serverName + "/discovery" + discoveryGroupConfiguration.getName()));
            }
            properties.add(simpleProperty15(DISCOVERY_INITIAL_WAIT_TIMEOUT, LONG_TYPE, "" + discoveryGroupConfiguration.getDiscoveryInitialWaitTimeout()));
            properties.add(simpleProperty15(REFRESH_TIMEOUT, LONG_TYPE, "" + discoveryGroupConfiguration.getRefreshTimeout()));
        }
        boolean hasReconnect = false;
        final List<ConfigProperty> inboundProperties = new ArrayList<>();
        final List<ConfigProperty> outboundProperties = new ArrayList<>();
        final String reconnectName = ConnectionFactoryAttributes.Pooled.RECONNECT_ATTEMPTS_PROP_NAME;
        for (PooledConnectionFactoryConfigProperties adapterParam : adapterParams) {
            hasReconnect |= reconnectName.equals(adapterParam.getName());
            ConfigProperty p = simpleProperty15(adapterParam.getName(), adapterParam.getType(), adapterParam.getValue());
            if (adapterParam.getName().equals(REBALANCE_CONNECTIONS_PROP_NAME)) {
                boolean rebalanceConnections = Boolean.parseBoolean(adapterParam.getValue());
                if (rebalanceConnections) {
                    inboundProperties.add(p);
                }
            } else {
                if (null == adapterParam.getConfigType()) {
                    properties.add(p);
                } else
                    switch(adapterParam.getConfigType()) {
                        case INBOUND:
                            inboundProperties.add(p);
                            break;
                        case OUTBOUND:
                            outboundProperties.add(p);
                            break;
                        default:
                            properties.add(p);
                            break;
                    }
            }
        }
        // The default -1, which will hang forever until a server appears
        if (!hasReconnect) {
            properties.add(simpleProperty15(reconnectName, Integer.class.getName(), DEFAULT_MAX_RECONNECTS));
        }
        configureCredential(properties);
        // for backwards compatibility, the RA inbound is configured to prefix the Jakarta Messaging resources if JNDI lookups fail
        // and the destination are inferred from the JNDI name.
        inboundProperties.add(simpleProperty15("queuePrefix", String.class.getName(), JMS_QUEUE_PREFIX));
        inboundProperties.add(simpleProperty15("topicPrefix", String.class.getName(), JMS_TOPIC_PREFIX));
        WildFlyRecoveryRegistry.container = container;
        OutboundResourceAdapter outbound = createOutbound(outboundProperties);
        InboundResourceAdapter inbound = createInbound(inboundProperties);
        ResourceAdapter ra = createResourceAdapter15(properties, outbound, inbound);
        Connector cmd = createConnector15(ra);
        TransactionSupportEnum transactionSupport = getTransactionSupport(txSupport);
        ConnectionDefinition common = createConnDef(transactionSupport, bindInfo.getBindName(), minPoolSize, maxPoolSize, managedConnectionPoolClassName, enlistmentTrace);
        Activation activation = createActivation(common, transactionSupport);
        ResourceAdapterActivatorService activator = new ResourceAdapterActivatorService(cmd, activation, PooledConnectionFactoryService.class.getClassLoader(), name);
        activator.setBindInfo(bindInfo);
        activator.setCreateBinderService(createBinderService);
        activator.addJndiAliases(jndiAliases);
        final ServiceBuilder sb = Services.addServerExecutorDependency(serviceTarget.addService(getResourceAdapterActivatorsServiceName(name), activator), activator.getExecutorServiceInjector()).addDependency(ConnectorServices.IRONJACAMAR_MDR, AS7MetadataRepository.class, activator.getMdrInjector()).addDependency(ConnectorServices.RA_REPOSITORY_SERVICE, ResourceAdapterRepository.class, activator.getRaRepositoryInjector()).addDependency(ConnectorServices.MANAGEMENT_REPOSITORY_SERVICE, ManagementRepository.class, activator.getManagementRepositoryInjector()).addDependency(ConnectorServices.RESOURCE_ADAPTER_REGISTRY_SERVICE, ResourceAdapterDeploymentRegistry.class, activator.getRegistryInjector()).addDependency(ConnectorServices.TRANSACTION_INTEGRATION_SERVICE, TransactionIntegration.class, activator.getTxIntegrationInjector()).addDependency(ConnectorServices.CONNECTOR_CONFIG_SERVICE, JcaSubsystemConfiguration.class, activator.getConfigInjector()).addDependency(ConnectorServices.CCM_SERVICE, CachedConnectionManager.class, activator.getCcmInjector());
        sb.requires(ActiveMQActivationService.getServiceName(getActiveMQServiceName(serverName)));
        sb.requires(NamingService.SERVICE_NAME);
        sb.requires(MessagingServices.getCapabilityServiceName(MessagingServices.LOCAL_TRANSACTION_PROVIDER_CAPABILITY));
        sb.requires(ConnectorServices.BOOTSTRAP_CONTEXT_SERVICE.append("default"));
        sb.setInitialMode(ServiceController.Mode.PASSIVE).install();
        // Mock the deployment service to allow it to start
        serviceTarget.addService(ConnectorServices.RESOURCE_ADAPTER_DEPLOYER_SERVICE_PREFIX.append(name), Service.NULL).install();
    } finally {
        if (is != null)
            is.close();
        if (isIj != null)
            isIj.close();
    }
}
Also used : Connector(org.jboss.jca.common.api.metadata.spec.Connector) ConnectionDefinition(org.jboss.jca.common.api.metadata.resourceadapter.ConnectionDefinition) JcaSubsystemConfiguration(org.jboss.as.connector.subsystems.jca.JcaSubsystemConfiguration) ArrayList(java.util.ArrayList) TransportConfiguration(org.apache.activemq.artemis.api.core.TransportConfiguration) Activation(org.jboss.jca.common.api.metadata.resourceadapter.Activation) XsdString(org.jboss.jca.common.api.metadata.spec.XsdString) LocalizedXsdString(org.jboss.jca.common.api.metadata.spec.LocalizedXsdString) ServiceBuilder(org.jboss.msc.service.ServiceBuilder) ResourceAdapter(org.jboss.jca.common.api.metadata.spec.ResourceAdapter) InboundResourceAdapter(org.jboss.jca.common.api.metadata.spec.InboundResourceAdapter) OutboundResourceAdapter(org.jboss.jca.common.api.metadata.spec.OutboundResourceAdapter) ActiveMQResourceAdapter(org.wildfly.extension.messaging.activemq.ActiveMQResourceAdapter) ResourceAdapterRepository(org.jboss.jca.core.spi.rar.ResourceAdapterRepository) UDPBroadcastEndpointFactory(org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory) ResourceAdapterDeploymentRegistry(org.jboss.as.connector.services.resourceadapters.deployment.registry.ResourceAdapterDeploymentRegistry) InboundResourceAdapter(org.jboss.jca.common.api.metadata.spec.InboundResourceAdapter) InputStream(java.io.InputStream) DiscoveryGroupConfiguration(org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration) CommandDispatcherBroadcastEndpointFactory(org.wildfly.extension.messaging.activemq.broadcast.CommandDispatcherBroadcastEndpointFactory) ResourceAdapterActivatorService(org.jboss.as.connector.services.resourceadapters.ResourceAdapterActivatorService) ConfigProperty(org.jboss.jca.common.api.metadata.spec.ConfigProperty) RequiredConfigProperty(org.jboss.jca.common.api.metadata.spec.RequiredConfigProperty) AdminObject(org.jboss.jca.common.api.metadata.resourceadapter.AdminObject) TransactionSupportEnum(org.jboss.jca.common.api.metadata.common.TransactionSupportEnum) Map(java.util.Map) HashMap(java.util.HashMap) OutboundResourceAdapter(org.jboss.jca.common.api.metadata.spec.OutboundResourceAdapter) CommandDispatcherBroadcastEndpointFactory(org.wildfly.extension.messaging.activemq.broadcast.CommandDispatcherBroadcastEndpointFactory) UDPBroadcastEndpointFactory(org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory) BroadcastEndpointFactory(org.apache.activemq.artemis.api.core.BroadcastEndpointFactory)

Aggregations

CommandDispatcherBroadcastEndpointFactory (org.wildfly.extension.messaging.activemq.broadcast.CommandDispatcherBroadcastEndpointFactory)5 BroadcastEndpointFactory (org.apache.activemq.artemis.api.core.BroadcastEndpointFactory)4 DiscoveryGroupConfiguration (org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration)3 InputStream (java.io.InputStream)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 TransportConfiguration (org.apache.activemq.artemis.api.core.TransportConfiguration)2 UDPBroadcastEndpointFactory (org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory)2 ResourceAdapterActivatorService (org.jboss.as.connector.services.resourceadapters.ResourceAdapterActivatorService)2 ResourceAdapterDeploymentRegistry (org.jboss.as.connector.services.resourceadapters.deployment.registry.ResourceAdapterDeploymentRegistry)2 JcaSubsystemConfiguration (org.jboss.as.connector.subsystems.jca.JcaSubsystemConfiguration)2 TransactionSupportEnum (org.jboss.jca.common.api.metadata.common.TransactionSupportEnum)2 Activation (org.jboss.jca.common.api.metadata.resourceadapter.Activation)2 AdminObject (org.jboss.jca.common.api.metadata.resourceadapter.AdminObject)2 ConnectionDefinition (org.jboss.jca.common.api.metadata.resourceadapter.ConnectionDefinition)2 ConfigProperty (org.jboss.jca.common.api.metadata.spec.ConfigProperty)2 Connector (org.jboss.jca.common.api.metadata.spec.Connector)2 InboundResourceAdapter (org.jboss.jca.common.api.metadata.spec.InboundResourceAdapter)2 LocalizedXsdString (org.jboss.jca.common.api.metadata.spec.LocalizedXsdString)2