Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public StatefulComponentDescription(final String componentName, final String componentClassName, final EjbJarDescription ejbJarDescription,
- final ServiceName deploymentUnitServiceName) {
- super(componentName, componentClassName, ejbJarDescription, deploymentUnitServiceName);
- +
- + // add the session synchronization interceptor
- + this.addSessionSynchronizationInterceptor();
- }
- @Override
- @@ -135,4 +144,17 @@ public class StatefulComponentDescription extends SessionBeanComponentDescriptio
- }
- }
- +
- + private void addSessionSynchronizationInterceptor() {
- + this.getConfigurators().add(new ComponentConfigurator() {
- + @Override
- + public void configure(DeploymentPhaseContext context, ComponentDescription description, ComponentConfiguration configuration) throws DeploymentUnitProcessingException {
- + Set<Method> methods = configuration.getDefinedComponentMethods();
- + for (Method method : methods) {
- + Deque<InterceptorFactory> interceptors = configuration.getComponentInterceptorDeque(method);
- + interceptors.add(new ImmediateInterceptorFactory(new StatefulSessionSynchronizationInterceptor()));
- + }
- + }
- + });
- + }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement