Search in sources :

Example 1 with CachedConnectionManagerSetupProcessor

use of org.jboss.as.connector.deployers.ra.processors.CachedConnectionManagerSetupProcessor in project wildfly by wildfly.

the class CachedConnectionManagerAdd method performBoottime.

@Override
protected void performBoottime(final OperationContext context, final ModelNode operation, final ModelNode model) throws OperationFailedException {
    final boolean debug = JcaCachedConnectionManagerDefinition.CcmParameters.DEBUG.getAttribute().resolveModelAttribute(context, model).asBoolean();
    final boolean error = JcaCachedConnectionManagerDefinition.CcmParameters.ERROR.getAttribute().resolveModelAttribute(context, model).asBoolean();
    final boolean ignoreUnknownConnections = JcaCachedConnectionManagerDefinition.CcmParameters.IGNORE_UNKNOWN_CONNECTIONS.getAttribute().resolveModelAttribute(context, model).asBoolean();
    final boolean install = JcaCachedConnectionManagerDefinition.CcmParameters.INSTALL.getAttribute().resolveModelAttribute(context, model).asBoolean();
    final ServiceTarget serviceTarget = context.getServiceTarget();
    if (install) {
        ROOT_LOGGER.debug("Enabling the Cache Connection Manager valve and interceptor...");
        context.addStep(new AbstractDeploymentChainStep() {

            protected void execute(DeploymentProcessorTarget processorTarget) {
                processorTarget.addDeploymentProcessor(JcaExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_CACHED_CONNECTION_MANAGER, new CachedConnectionManagerSetupProcessor());
            }
        }, OperationContext.Stage.RUNTIME);
    } else {
        ROOT_LOGGER.debug("Disabling the Cache Connection Manager valve and interceptor...");
    }
    CachedConnectionManagerService ccmService = new CachedConnectionManagerService(debug, error, ignoreUnknownConnections);
    serviceTarget.addService(ConnectorServices.CCM_SERVICE, ccmService).addDependency(ConnectorServices.TRANSACTION_INTEGRATION_SERVICE, TransactionIntegration.class, ccmService.getTransactionIntegrationInjector()).install();
    NonTxCachedConnectionManagerService noTxCcm = new NonTxCachedConnectionManagerService(debug, error, ignoreUnknownConnections);
    serviceTarget.addService(ConnectorServices.NON_TX_CCM_SERVICE, noTxCcm).install();
}
Also used : CachedConnectionManagerSetupProcessor(org.jboss.as.connector.deployers.ra.processors.CachedConnectionManagerSetupProcessor) TransactionIntegration(org.jboss.jca.core.spi.transaction.TransactionIntegration) DeploymentProcessorTarget(org.jboss.as.server.DeploymentProcessorTarget) ServiceTarget(org.jboss.msc.service.ServiceTarget) CachedConnectionManagerService(org.jboss.as.connector.services.jca.CachedConnectionManagerService) NonTxCachedConnectionManagerService(org.jboss.as.connector.services.jca.NonTxCachedConnectionManagerService) AbstractDeploymentChainStep(org.jboss.as.server.AbstractDeploymentChainStep) NonTxCachedConnectionManagerService(org.jboss.as.connector.services.jca.NonTxCachedConnectionManagerService)

Aggregations

CachedConnectionManagerSetupProcessor (org.jboss.as.connector.deployers.ra.processors.CachedConnectionManagerSetupProcessor)1 CachedConnectionManagerService (org.jboss.as.connector.services.jca.CachedConnectionManagerService)1 NonTxCachedConnectionManagerService (org.jboss.as.connector.services.jca.NonTxCachedConnectionManagerService)1 AbstractDeploymentChainStep (org.jboss.as.server.AbstractDeploymentChainStep)1 DeploymentProcessorTarget (org.jboss.as.server.DeploymentProcessorTarget)1 TransactionIntegration (org.jboss.jca.core.spi.transaction.TransactionIntegration)1 ServiceTarget (org.jboss.msc.service.ServiceTarget)1