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); }
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); if (eeModuleDescription == null) { return; } final ComponentConfigurator componentConfigurator = new ComponentConfigurator() { @Override public void configure(DeploymentPhaseContext context, ComponentDescription description, final ComponentConfiguration configuration) throws DeploymentUnitProcessingException { final TransactionLeakContextHandleFactory transactionLeakContextHandleFactory = new TransactionLeakContextHandleFactory(); context.addDependency(TransactionManagerService.INTERNAL_SERVICE_NAME, TransactionManager.class, transactionLeakContextHandleFactory); configuration.getConcurrentContext().addFactory(transactionLeakContextHandleFactory); } }; for (ComponentDescription componentDescription : eeModuleDescription.getComponentDescriptions()) { componentDescription.getConfigurators().add(componentConfigurator); } }
@Override public void deploy(final DeploymentPhaseContext context) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = context.getDeploymentUnit(); final EEModuleDescription moduleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); for (ComponentDescription component : moduleDescription.getComponentDescriptions()) { if (component instanceof EJBComponentDescription) { component.getConfigurators().add(new ComponentConfigurator() { @Override public void configure(DeploymentPhaseContext context, ComponentDescription description, ComponentConfiguration configuration) { StartupCountdown countdown = context.getDeploymentUnit().getAttachment(Attachments.STARTUP_COUNTDOWN); for (ViewConfiguration view : configuration.getViews()) { EJBViewConfiguration ejbView = (EJBViewConfiguration) view; if (INTFS.contains(ejbView.getMethodIntf())) { ejbView.addViewInterceptor(new ImmediateInterceptorFactory(new StartupAwaitInterceptor(countdown)), InterceptorOrder.View.STARTUP_AWAIT_INTERCEPTOR); } } } }); } } }
beanName = null; component.getConfigurators().add((context, description, configuration) -> { component.getConfigurators().addFirst(new ComponentConfigurator() { @Override public void configure(final DeploymentPhaseContext context, final ComponentDescription description, final ComponentConfiguration configuration) throws DeploymentUnitProcessingException {
componentDescription.getConfigurators().add((context, description, configuration) -> configuration.getCreateDependencies().add((serviceBuilder, service) -> serviceBuilder.requires(serviceName)) );
componentDescription.getConfigurators().add(new ComponentConfigurator() { @Override public void configure(final DeploymentPhaseContext context, final ComponentDescription description, final ComponentConfiguration configuration) throws DeploymentUnitProcessingException { componentDescription.getConfigurators().add(new ComponentConfigurator() { @Override public void configure(final DeploymentPhaseContext context, final ComponentDescription description, final ComponentConfiguration configuration) throws DeploymentUnitProcessingException {
final String entryPoint = ENTRY_POINT_NAME + deploymentUnit.getName() + "." + component.getComponentName(); ControlPointService.install(context.getServiceTarget(), topLevelName, entryPoint); component.getConfigurators().add(new ComponentConfigurator() { @Override public void configure(DeploymentPhaseContext context, ComponentDescription description, ComponentConfiguration configuration) {
try { componentConfiguration = componentDescription.createConfiguration(reflectionIndex.getClassIndex(ClassLoadingUtils.loadClass(componentDescription.getComponentClassName(), module)), module.getClassLoader(), module.getModuleLoader()); for (final ComponentConfigurator componentConfigurator : componentDescription.getConfigurators()) { componentConfigurator.configure(phaseContext, componentDescription, componentConfiguration);
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); }
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); }
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); if (eeModuleDescription == null) { return; } final ComponentConfigurator componentConfigurator = new ComponentConfigurator() { @Override public void configure(DeploymentPhaseContext context, ComponentDescription description, final ComponentConfiguration configuration) throws DeploymentUnitProcessingException { final TransactionLeakContextHandleFactory transactionLeakContextHandleFactory = new TransactionLeakContextHandleFactory(); context.addDependency(TransactionManagerService.SERVICE_NAME, TransactionManager.class, transactionLeakContextHandleFactory); configuration.getConcurrentContext().addFactory(transactionLeakContextHandleFactory); } }; for (ComponentDescription componentDescription : eeModuleDescription.getComponentDescriptions()) { componentDescription.getConfigurators().add(componentConfigurator); } }
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); if (eeModuleDescription == null) { return; } final ComponentConfigurator componentConfigurator = new ComponentConfigurator() { @Override public void configure(DeploymentPhaseContext context, ComponentDescription description, final ComponentConfiguration configuration) throws DeploymentUnitProcessingException { final TransactionLeakContextHandleFactory transactionLeakContextHandleFactory = new TransactionLeakContextHandleFactory(); context.addDependency(TransactionManagerService.INTERNAL_SERVICE_NAME, TransactionManager.class, transactionLeakContextHandleFactory); configuration.getConcurrentContext().addFactory(transactionLeakContextHandleFactory); } }; for (ComponentDescription componentDescription : eeModuleDescription.getComponentDescriptions()) { componentDescription.getConfigurators().add(componentConfigurator); } }
beanName = null; component.getConfigurators().addFirst(new ComponentConfigurator() { @Override public void configure(final DeploymentPhaseContext context, final ComponentDescription description, final ComponentConfiguration configuration) throws DeploymentUnitProcessingException {
try { componentConfiguration = componentDescription.createConfiguration(classIndex.classIndex(componentDescription.getComponentClassName()), module.getClassLoader(), module.getModuleLoader()); for (final ComponentConfigurator componentConfigurator : componentDescription.getConfigurators()) { componentConfigurator.configure(phaseContext, componentDescription, componentConfiguration);
component.getConfigurators().add(new ComponentConfigurator() { @Override public void configure(final DeploymentPhaseContext context, final ComponentDescription description, final ComponentConfiguration configuration) throws DeploymentUnitProcessingException {
try { componentConfiguration = componentDescription.createConfiguration(reflectionIndex.getClassIndex(ClassLoadingUtils.loadClass(componentDescription.getComponentClassName(), module)), module.getClassLoader(), module.getModuleLoader()); for (final ComponentConfigurator componentConfigurator : componentDescription.getConfigurators()) { componentConfigurator.configure(phaseContext, componentDescription, componentConfiguration);
try { componentConfiguration = componentDescription.createConfiguration(reflectionIndex.getClassIndex(ClassLoadingUtils.loadClass(componentDescription.getComponentClassName(), module)), module.getClassLoader(), module.getModuleLoader()); for (final ComponentConfigurator componentConfigurator : componentDescription.getConfigurators()) { componentConfigurator.configure(phaseContext, componentDescription, componentConfiguration);