/** * Construct a new instance. * * @param componentConfiguration the component configuration */ public BasicComponentCreateService(final ComponentConfiguration componentConfiguration) { serviceName = componentConfiguration.getComponentDescription().getCreateServiceName(); componentName = componentConfiguration.getComponentName(); postConstruct = Interceptors.getChainedInterceptorFactory(componentConfiguration.getPostConstructInterceptors()); preDestroy = Interceptors.getChainedInterceptorFactory(componentConfiguration.getPreDestroyInterceptors()); final IdentityHashMap<Method, InterceptorFactory> componentInterceptors = new IdentityHashMap<Method, InterceptorFactory>(); for (Method method : componentConfiguration.getDefinedComponentMethods()) { if(requiresInterceptors(method, componentConfiguration)) { componentInterceptors.put(method, Interceptors.getChainedInterceptorFactory(componentConfiguration.getComponentInterceptors(method))); } } componentClass = componentConfiguration.getComponentClass(); this.componentInterceptors = componentInterceptors; this.namespaceContextSelector = componentConfiguration.getNamespaceContextSelector(); }
@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); } };
/** * Construct a new instance. * * @param componentConfiguration the component configuration */ public BasicComponentCreateService(final ComponentConfiguration componentConfiguration) { serviceName = componentConfiguration.getComponentDescription().getCreateServiceName(); componentName = componentConfiguration.getComponentName(); postConstruct = Interceptors.getChainedInterceptorFactory(componentConfiguration.getPostConstructInterceptors()); preDestroy = Interceptors.getChainedInterceptorFactory(componentConfiguration.getPreDestroyInterceptors()); final IdentityHashMap<Method, InterceptorFactory> componentInterceptors = new IdentityHashMap<Method, InterceptorFactory>(); for (Method method : componentConfiguration.getDefinedComponentMethods()) { if(requiresInterceptors(method, componentConfiguration)) { componentInterceptors.put(method, Interceptors.getChainedInterceptorFactory(componentConfiguration.getComponentInterceptors(method))); } } componentClass = componentConfiguration.getComponentClass(); this.componentInterceptors = componentInterceptors; this.namespaceContextSelector = componentConfiguration.getNamespaceContextSelector(); }
/** * Construct a new instance. * * @param componentConfiguration the component configuration */ public BasicComponentCreateService(final ComponentConfiguration componentConfiguration) { serviceName = componentConfiguration.getComponentDescription().getCreateServiceName(); componentName = componentConfiguration.getComponentName(); postConstruct = Interceptors.getChainedInterceptorFactory(componentConfiguration.getPostConstructInterceptors()); preDestroy = Interceptors.getChainedInterceptorFactory(componentConfiguration.getPreDestroyInterceptors()); final IdentityHashMap<Method, InterceptorFactory> componentInterceptors = new IdentityHashMap<Method, InterceptorFactory>(); for (Method method : componentConfiguration.getDefinedComponentMethods()) { if(requiresInterceptors(method, componentConfiguration)) { componentInterceptors.put(method, Interceptors.getChainedInterceptorFactory(componentConfiguration.getComponentInterceptors(method))); } } componentClass = componentConfiguration.getComponentClass(); this.componentInterceptors = componentInterceptors; this.namespaceContextSelector = componentConfiguration.getNamespaceContextSelector(); }
/** * Construct a new instance. * * @param componentConfiguration the component configuration */ public BasicComponentCreateService(final ComponentConfiguration componentConfiguration) { serviceName = componentConfiguration.getComponentDescription().getCreateServiceName(); componentName = componentConfiguration.getComponentName(); postConstruct = Interceptors.getChainedInterceptorFactory(componentConfiguration.getPostConstructInterceptors()); preDestroy = Interceptors.getChainedInterceptorFactory(componentConfiguration.getPreDestroyInterceptors()); final IdentityHashMap<Method, InterceptorFactory> componentInterceptors = new IdentityHashMap<Method, InterceptorFactory>(); for (Method method : componentConfiguration.getDefinedComponentMethods()) { if(requiresInterceptors(method, componentConfiguration)) { componentInterceptors.put(method, Interceptors.getChainedInterceptorFactory(componentConfiguration.getComponentInterceptors(method))); } } componentClass = componentConfiguration.getComponentClass(); this.componentInterceptors = componentInterceptors; this.namespaceContextSelector = componentConfiguration.getNamespaceContextSelector(); }
@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); } };
@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); } };