use of org.jboss.as.ee.concurrent.ConcurrentContext in project wildfly by wildfly.
the class EEConcurrentContextProcessor method processModuleDescription.
private void processModuleDescription(final EEModuleDescription moduleDescription, DeploymentUnit deploymentUnit, DeploymentPhaseContext phaseContext) {
final ConcurrentContext concurrentContext = moduleDescription.getConcurrentContext();
// setup context
setupConcurrentContext(concurrentContext, moduleDescription.getApplicationName(), moduleDescription.getModuleName(), null, deploymentUnit.getAttachment(MODULE).getClassLoader(), moduleDescription.getNamespaceContextSelector(), deploymentUnit, phaseContext.getServiceTarget());
// add setup action for web modules
final ConcurrentContextSetupAction setupAction = new ConcurrentContextSetupAction(concurrentContext);
deploymentUnit.getAttachmentList(Attachments.WEB_SETUP_ACTIONS).add(setupAction);
}
use of org.jboss.as.ee.concurrent.ConcurrentContext in project wildfly by wildfly.
the class EEConcurrentContextProcessor method processComponentDescription.
private void processComponentDescription(final ComponentDescription componentDescription) {
final ComponentConfigurator componentConfigurator = new ComponentConfigurator() {
@Override
public void configure(DeploymentPhaseContext context, ComponentDescription description, final ComponentConfiguration configuration) throws DeploymentUnitProcessingException {
final ConcurrentContext concurrentContext = configuration.getConcurrentContext();
// setup context
setupConcurrentContext(concurrentContext, description.getApplicationName(), description.getModuleName(), description.getComponentName(), configuration.getModuleClassLoader(), configuration.getNamespaceContextSelector(), context.getDeploymentUnit(), context.getServiceTarget());
// add the interceptor which manages the concurrent context
final ConcurrentContextInterceptor interceptor = new ConcurrentContextInterceptor(concurrentContext);
final InterceptorFactory interceptorFactory = new ImmediateInterceptorFactory(interceptor);
configuration.addPostConstructInterceptor(interceptorFactory, InterceptorOrder.ComponentPostConstruct.CONCURRENT_CONTEXT);
configuration.addPreDestroyInterceptor(interceptorFactory, InterceptorOrder.ComponentPreDestroy.CONCURRENT_CONTEXT);
if (description.isPassivationApplicable()) {
configuration.addPrePassivateInterceptor(interceptorFactory, InterceptorOrder.ComponentPassivation.CONCURRENT_CONTEXT);
configuration.addPostActivateInterceptor(interceptorFactory, InterceptorOrder.ComponentPassivation.CONCURRENT_CONTEXT);
}
configuration.addComponentInterceptor(interceptorFactory, InterceptorOrder.Component.CONCURRENT_CONTEXT, false);
}
};
componentDescription.getConfigurators().add(componentConfigurator);
}
Aggregations