Search in sources :

Example 1 with ForkChannelTransport

use of org.jboss.as.connector.services.workmanager.transport.ForkChannelTransport in project wildfly by wildfly.

the class DistributedWorkManagerService method start.

@Override
public void start(StartContext context) throws StartException {
    ROOT_LOGGER.debugf("Starting JCA DistributedWorkManager: ", value.getName());
    ChannelFactory factory = this.jGroupsChannelFactory.getValue();
    JGroupsTransport transport = new ForkChannelTransport(factory);
    try {
        transport.setChannel(factory.createChannel(this.value.getName()));
        transport.setClusterName(this.value.getName());
        this.value.setTransport(transport);
    } catch (Exception e) {
        ROOT_LOGGER.trace("failed to start JGroups channel", e);
        throw ROOT_LOGGER.failedToStartJGroupsChannel(this.value.getName(), this.value.getName());
    }
    BlockingExecutor longRunning = (BlockingExecutor) executorLong.getOptionalValue();
    if (longRunning != null) {
        this.value.setLongRunningThreadPool(longRunning);
        this.value.setShortRunningThreadPool((BlockingExecutor) executorShort.getValue());
    } else {
        this.value.setLongRunningThreadPool((BlockingExecutor) executorShort.getValue());
        this.value.setShortRunningThreadPool((BlockingExecutor) executorShort.getValue());
    }
    this.value.setXATerminator(new XATerminatorImpl(xaTerminator.getValue()));
    WorkManagerCoordinator.getInstance().registerWorkManager(value);
    try {
        transport.startup();
    } catch (Throwable throwable) {
        ROOT_LOGGER.trace("failed to start DWM transport:", throwable);
        throw ROOT_LOGGER.failedToStartDWMTransport(this.value.getName());
    }
    if (this.value.isElytronEnabled()) {
        this.value.setSecurityIntegration(new ElytronSecurityIntegration());
    } else {
        this.value.setSecurityIntegration(new PicketBoxSecurityIntegration());
    }
    ROOT_LOGGER.debugf("Started JCA DistributedWorkManager: ", value.getName());
}
Also used : JGroupsTransport(org.jboss.jca.core.workmanager.transport.remote.jgroups.JGroupsTransport) PicketBoxSecurityIntegration(org.jboss.jca.core.security.picketbox.PicketBoxSecurityIntegration) ForkChannelTransport(org.jboss.as.connector.services.workmanager.transport.ForkChannelTransport) ElytronSecurityIntegration(org.jboss.as.connector.security.ElytronSecurityIntegration) ChannelFactory(org.wildfly.clustering.jgroups.spi.ChannelFactory) XATerminatorImpl(org.jboss.jca.core.tx.jbossts.XATerminatorImpl) StartException(org.jboss.msc.service.StartException) BlockingExecutor(org.jboss.threads.BlockingExecutor)

Aggregations

ElytronSecurityIntegration (org.jboss.as.connector.security.ElytronSecurityIntegration)1 ForkChannelTransport (org.jboss.as.connector.services.workmanager.transport.ForkChannelTransport)1 PicketBoxSecurityIntegration (org.jboss.jca.core.security.picketbox.PicketBoxSecurityIntegration)1 XATerminatorImpl (org.jboss.jca.core.tx.jbossts.XATerminatorImpl)1 JGroupsTransport (org.jboss.jca.core.workmanager.transport.remote.jgroups.JGroupsTransport)1 StartException (org.jboss.msc.service.StartException)1 BlockingExecutor (org.jboss.threads.BlockingExecutor)1 ChannelFactory (org.wildfly.clustering.jgroups.spi.ChannelFactory)1