final List<Method> methods = proxyFactory.getCachedMethods(); final int methodCount = methods.size(); clientPostConstruct = Interceptors.getChainedInterceptorFactory(viewConfiguration.getClientPostConstructInterceptors()); clientPreDestroy = Interceptors.getChainedInterceptorFactory(viewConfiguration.getClientPreDestroyInterceptors()); final IdentityHashMap<Method, InterceptorFactory> viewInterceptorFactories = new IdentityHashMap<Method, InterceptorFactory>(methodCount); final IdentityHashMap<Method, InterceptorFactory> clientInterceptorFactories = new IdentityHashMap<Method, InterceptorFactory>(methodCount); viewInterceptorFactories.put(method, Interceptors.getTerminalInterceptorFactory()); } else { viewInterceptorFactories.put(method, Interceptors.getChainedInterceptorFactory(viewConfiguration.getViewInterceptors(method))); clientInterceptorFactories.put(method, Interceptors.getChainedInterceptorFactory(viewConfiguration.getClientInterceptors(method)));
/** * 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 StatefulSessionComponentCreateService(final ComponentConfiguration componentConfiguration, final ApplicationExceptions ejbJarConfiguration, Supplier<CacheFactory<SessionID, StatefulSessionComponentInstance>> cacheFactory) { super(componentConfiguration, ejbJarConfiguration); final StatefulComponentDescription componentDescription = (StatefulComponentDescription) componentConfiguration.getComponentDescription(); final ClassLoader classLoader = componentConfiguration.getModuleClassLoader(); final InterceptorFactory tcclInterceptorFactory = new ImmediateInterceptorFactory(new ContextClassLoaderInterceptor(classLoader)); final InterceptorFactory namespaceContextInterceptorFactory = componentConfiguration.getNamespaceContextInterceptorFactory(); this.afterBeginMethod = componentDescription.getAfterBegin(); this.afterBegin = (this.afterBeginMethod != null) ? Interceptors.getChainedInterceptorFactory(tcclInterceptorFactory, namespaceContextInterceptorFactory, CurrentInvocationContextInterceptor.FACTORY, invokeMethodOnTarget(this.afterBeginMethod)) : null; this.afterCompletionMethod = componentDescription.getAfterCompletion(); this.afterCompletion = (this.afterCompletionMethod != null) ? Interceptors.getChainedInterceptorFactory(tcclInterceptorFactory, namespaceContextInterceptorFactory, CurrentInvocationContextInterceptor.FACTORY, invokeMethodOnTarget(this.afterCompletionMethod)) : null; this.beforeCompletionMethod = componentDescription.getBeforeCompletion(); this.beforeCompletion = (this.beforeCompletionMethod != null) ? Interceptors.getChainedInterceptorFactory(tcclInterceptorFactory, namespaceContextInterceptorFactory, CurrentInvocationContextInterceptor.FACTORY, invokeMethodOnTarget(this.beforeCompletionMethod)) : null; this.prePassivate = Interceptors.getChainedInterceptorFactory(componentConfiguration.getPrePassivateInterceptors()); this.postActivate = Interceptors.getChainedInterceptorFactory(componentConfiguration.getPostActivateInterceptors()); //the interceptor chain for EJB e.x remove methods this.ejb2XRemoveMethod = Interceptors.getChainedInterceptorFactory(StatefulSessionSynchronizationInterceptor.factory(componentDescription.getTransactionManagementType()), new ImmediateInterceptorFactory(new StatefulRemoveInterceptor(false)), Interceptors.getTerminalInterceptorFactory()); this.serializableInterceptorContextKeys = componentConfiguration.getInterceptorContextKeys(); this.passivationCapable = componentDescription.isPassivationApplicable(); this.cacheFactory = cacheFactory; }
configuration.addPostConstructInterceptor(new AroundConstructInterceptorFactory(Interceptors.getChainedInterceptorFactory(configuration.getAroundConstructInterceptors())), InterceptorOrder.ComponentPostConstruct.AROUND_CONSTRUCT_CHAIN);
if ((ejbComponentDescription.getTimeoutMethod() != null && ejbComponentDescription.getTimeoutMethod().equals(method)) || ejbComponentDescription.getScheduleMethods().containsKey(method)) { final InterceptorFactory interceptorFactory = Interceptors.getChainedInterceptorFactory(componentConfiguration.getAroundTimeoutInterceptors(method)); timeoutInterceptors.put(method, interceptorFactory);
final List<Method> methods = proxyFactory.getCachedMethods(); final int methodCount = methods.size(); clientPostConstruct = Interceptors.getChainedInterceptorFactory(viewConfiguration.getClientPostConstructInterceptors()); clientPreDestroy = Interceptors.getChainedInterceptorFactory(viewConfiguration.getClientPreDestroyInterceptors()); final IdentityHashMap<Method, InterceptorFactory> viewInterceptorFactories = new IdentityHashMap<Method, InterceptorFactory>(methodCount); final IdentityHashMap<Method, InterceptorFactory> clientInterceptorFactories = new IdentityHashMap<Method, InterceptorFactory>(methodCount); viewInterceptorFactories.put(method, Interceptors.getTerminalInterceptorFactory()); } else { viewInterceptorFactories.put(method, Interceptors.getChainedInterceptorFactory(viewConfiguration.getViewInterceptors(method))); clientInterceptorFactories.put(method, Interceptors.getChainedInterceptorFactory(viewConfiguration.getClientInterceptors(method)));
final List<Method> methods = proxyFactory.getCachedMethods(); final int methodCount = methods.size(); clientPostConstruct = Interceptors.getChainedInterceptorFactory(viewConfiguration.getClientPostConstructInterceptors()); clientPreDestroy = Interceptors.getChainedInterceptorFactory(viewConfiguration.getClientPreDestroyInterceptors()); final IdentityHashMap<Method, InterceptorFactory> viewInterceptorFactories = new IdentityHashMap<Method, InterceptorFactory>(methodCount); final IdentityHashMap<Method, InterceptorFactory> clientInterceptorFactories = new IdentityHashMap<Method, InterceptorFactory>(methodCount); viewInterceptorFactories.put(method, Interceptors.getTerminalInterceptorFactory()); } else { viewInterceptorFactories.put(method, Interceptors.getChainedInterceptorFactory(viewConfiguration.getViewInterceptors(method))); clientInterceptorFactories.put(method, Interceptors.getChainedInterceptorFactory(viewConfiguration.getClientInterceptors(method)));
final List<Method> methods = proxyFactory.getCachedMethods(); final int methodCount = methods.size(); clientPostConstruct = Interceptors.getChainedInterceptorFactory(viewConfiguration.getClientPostConstructInterceptors()); clientPreDestroy = Interceptors.getChainedInterceptorFactory(viewConfiguration.getClientPreDestroyInterceptors()); final IdentityHashMap<Method, InterceptorFactory> viewInterceptorFactories = new IdentityHashMap<Method, InterceptorFactory>(methodCount); final IdentityHashMap<Method, InterceptorFactory> clientInterceptorFactories = new IdentityHashMap<Method, InterceptorFactory>(methodCount); viewInterceptorFactories.put(method, Interceptors.getTerminalInterceptorFactory()); } else { viewInterceptorFactories.put(method, Interceptors.getChainedInterceptorFactory(viewConfiguration.getViewInterceptors(method))); clientInterceptorFactories.put(method, Interceptors.getChainedInterceptorFactory(viewConfiguration.getClientInterceptors(method)));
/** * 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(); }
this.ejbPassivateMethod = ejbPassivate; this.unsetEntityContextMethod = unsetEntityContext; this.ejbActivate = Interceptors.getChainedInterceptorFactory(tcclInterceptorFactory, namespaceContextInterceptorFactory, CurrentInvocationContextInterceptor.FACTORY, invokeMethodOnTarget(ejbActivate)); this.ejbLoad = Interceptors.getChainedInterceptorFactory(tcclInterceptorFactory, namespaceContextInterceptorFactory, CurrentInvocationContextInterceptor.FACTORY, invokeMethodOnTarget(ejbLoad)); this.ejbStore = Interceptors.getChainedInterceptorFactory(tcclInterceptorFactory, namespaceContextInterceptorFactory, CurrentInvocationContextInterceptor.FACTORY, invokeMethodOnTarget(ejbStore)); this.ejbPassivate = Interceptors.getChainedInterceptorFactory(tcclInterceptorFactory, namespaceContextInterceptorFactory, CurrentInvocationContextInterceptor.FACTORY, invokeMethodOnTarget(ejbPassivate)); this.unsetEntityContext = Interceptors.getChainedInterceptorFactory(tcclInterceptorFactory, namespaceContextInterceptorFactory, CurrentInvocationContextInterceptor.FACTORY, invokeMethodOnTarget(unsetEntityContext));
this.afterBegin = (this.afterBeginMethod != null) ? Interceptors.getChainedInterceptorFactory(tcclInterceptorFactory, namespaceContextInterceptorFactory, CurrentInvocationContextInterceptor.FACTORY, invokeMethodOnTarget(this.afterBeginMethod)) : null; this.afterCompletionMethod = componentDescription.getAfterCompletion(); this.afterCompletion = (this.afterCompletionMethod != null) ? Interceptors.getChainedInterceptorFactory(tcclInterceptorFactory, namespaceContextInterceptorFactory, CurrentInvocationContextInterceptor.FACTORY, invokeMethodOnTarget(this.afterCompletionMethod)) : null; this.beforeCompletionMethod = componentDescription.getBeforeCompletion(); this.beforeCompletion = (this.beforeCompletionMethod != null) ? Interceptors.getChainedInterceptorFactory(tcclInterceptorFactory, namespaceContextInterceptorFactory, CurrentInvocationContextInterceptor.FACTORY, invokeMethodOnTarget(this.beforeCompletionMethod)) : null; this.prePassivate = Interceptors.getChainedInterceptorFactory(componentConfiguration.getPrePassivateInterceptors()); this.postActivate = Interceptors.getChainedInterceptorFactory(componentConfiguration.getPostActivateInterceptors()); this.statefulTimeout = componentDescription.getStatefulTimeout(); this.ejb2XRemoveMethod = Interceptors.getChainedInterceptorFactory(StatefulSessionSynchronizationInterceptor.factory(componentDescription.getTransactionManagementType()), new ImmediateInterceptorFactory(new StatefulRemoveInterceptor(false)), Interceptors.getTerminalInterceptorFactory()); this.cache = componentDescription.getCache(); MarshallingConfiguration marshallingConfiguration = new MarshallingConfiguration();
configuration.addPostConstructInterceptor(new AroundConstructInterceptorFactory(Interceptors.getChainedInterceptorFactory(configuration.getAroundConstructInterceptors())), InterceptorOrder.ComponentPostConstruct.AROUND_CONSTRUCT_CHAIN);
configuration.addPostConstructInterceptor(new AroundConstructInterceptorFactory(Interceptors.getChainedInterceptorFactory(configuration.getAroundConstructInterceptors())), InterceptorOrder.ComponentPostConstruct.AROUND_CONSTRUCT_CHAIN);
if ((ejbComponentDescription.getTimeoutMethod() != null && ejbComponentDescription.getTimeoutMethod().equals(method)) || ejbComponentDescription.getScheduleMethods().containsKey(method)) { final InterceptorFactory interceptorFactory = Interceptors.getChainedInterceptorFactory(componentConfiguration.getAroundTimeoutInterceptors(method)); timeoutInterceptors.put(method, interceptorFactory);