use of org.jboss.as.ee.concurrent.DefaultContextSetupProviderImpl in project wildfly by wildfly.
the class ContextServiceAdd method performRuntime.
@Override
protected void performRuntime(OperationContext context, ModelNode operation, Resource resource) throws OperationFailedException {
final ModelNode model = resource.getModel();
final String name = context.getCurrentAddressValue();
final String jndiName = ContextServiceResourceDefinition.JNDI_NAME_AD.resolveModelAttribute(context, model).asString();
final boolean useTransactionSetupProvider = ContextServiceResourceDefinition.USE_TRANSACTION_SETUP_PROVIDER_AD.resolveModelAttribute(context, model).asBoolean();
// install the service which manages the default context service
final ContextServiceService contextServiceService = new ContextServiceService(name, jndiName, new DefaultContextSetupProviderImpl());
final CapabilityServiceBuilder serviceBuilder = context.getCapabilityServiceTarget().addCapability(ContextServiceResourceDefinition.CAPABILITY, contextServiceService);
if (useTransactionSetupProvider) {
// add it to deps of context service's service, for injection of its value
serviceBuilder.addDependency(ConcurrentServiceNames.TRANSACTION_SETUP_PROVIDER_SERVICE_NAME, TransactionSetupProvider.class, contextServiceService.getTransactionSetupProvider());
}
serviceBuilder.install();
}
Aggregations