Search in sources :

Example 1 with ElytronSecurityIntegration

use of org.jboss.as.connector.security.ElytronSecurityIntegration 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)

Example 2 with ElytronSecurityIntegration

use of org.jboss.as.connector.security.ElytronSecurityIntegration in project wildfly by wildfly.

the class WorkManagerService method start.

@Override
public void start(StartContext context) throws StartException {
    ROOT_LOGGER.debugf("Starting JCA WorkManager: ", 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()));
    if (value.getName().equals(DEFAULT_NAME)) {
        WorkManagerCoordinator.getInstance().setDefaultWorkManager(value);
    } else {
        WorkManagerCoordinator.getInstance().registerWorkManager(value);
    }
    //this is a value.restart() equivalent
    if (value.isShutdown())
        value.cancelShutdown();
    if (this.value.isElytronEnabled()) {
        this.value.setSecurityIntegration(new ElytronSecurityIntegration());
    } else {
        this.value.setSecurityIntegration(new PicketBoxSecurityIntegration());
    }
    ROOT_LOGGER.debugf("Started JCA WorkManager: ", value.getName());
}
Also used : PicketBoxSecurityIntegration(org.jboss.jca.core.security.picketbox.PicketBoxSecurityIntegration) ElytronSecurityIntegration(org.jboss.as.connector.security.ElytronSecurityIntegration) XATerminatorImpl(org.jboss.jca.core.tx.jbossts.XATerminatorImpl) BlockingExecutor(org.jboss.threads.BlockingExecutor)

Aggregations

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