Examples of LifecycleMethodInterceptorsInvocation


Examples of org.jboss.ejb3.interceptors.container.LifecycleMethodInterceptorsInvocation

      // normally we would invoke through the BeanContainer, however we want a different stack and
      // we want to be able to use tx2 interceptors.
      try
      {
         Interceptor interceptors[] = this.getLifecycleInterceptors(callbackAnnotationClass);
         LifecycleMethodInterceptorsInvocation invocation = new SingletonLifecycleMethodInterceptorsInvocation((LegacySingletonBeanContext) beanContext, interceptors);
         invocation.setAdvisor(this.getAdvisor());
         invocation.invokeNext();
      }
      catch (Throwable t)
      {
         throw new RuntimeException(t);
      }
View Full Code Here

Examples of org.jboss.ejb3.interceptors.container.LifecycleMethodInterceptorsInvocation

      // normally we would invoke through the BeanContainer, however we want a different stack and
      // we want to be able to use tx2 interceptors.
      try
      {
         Interceptor interceptors[] = this.getLifecycleInterceptors(callbackAnnotationClass);
         LifecycleMethodInterceptorsInvocation invocation = new SingletonLifecycleMethodInterceptorsInvocation((LegacySingletonBeanContext) beanContext, interceptors);
         invocation.setAdvisor(this.getAdvisor());
         invocation.invokeNext();
      }
      catch (Throwable t)
      {
         throw new RuntimeException(t);
      }
View Full Code Here

Examples of org.jboss.ejb3.interceptors.container.LifecycleMethodInterceptorsInvocation

      interceptors[1] = secondInterceptor;

      DummyBeanContext<Object> dummyBeanContext = new DummyBeanContext<Object>();
      dummyBeanContext.setBeanInstance(new Object());
      // Create an invocation with the beancontext and the interceptors
      LifecycleMethodInterceptorsInvocation invocation = new LifecycleMethodInterceptorsInvocation(dummyBeanContext,
            interceptors);
      // invoke
      Object result = invocation.invokeNext();

      // now check the number of interceptors invoked and their order
      assertNull(LifecycleMethodInterceptorsInvocation.class.getName() + " invocation returned a non-null result",
            result);
      List<Interceptor> invokedInterceptors = InterceptorInvocationOrderTracker.getInstance().getInvokedInterceptors();
View Full Code Here

Examples of org.jboss.ejb3.interceptors.container.LifecycleMethodInterceptorsInvocation

   {
      DummyBeanContext<Object> dummyBeanContext = new DummyBeanContext<Object>();
      Object beanInstance = new Object();
      dummyBeanContext.setBeanInstance(beanInstance);
      // Create a invocation out of the beancontext
      LifecycleMethodInterceptorsInvocation invocation = new LifecycleMethodInterceptorsInvocation(dummyBeanContext,
            new Interceptor[0]);
      // now ensure that the target is the same as the bean instance (obtained through beancontext)
      assertEquals("Unexpected target object in LifecycleMethodInterceptorsInvocation", beanInstance, invocation
            .getTargetObject());

   }
View Full Code Here

Examples of org.jboss.ejb3.interceptors.container.LifecycleMethodInterceptorsInvocation

      // check if the invocation is capable of return the bean context
      // and ultimately the interceptor instance
      if (invocation instanceof LifecycleMethodInterceptorsInvocation)
      {
         LifecycleMethodInterceptorsInvocation lifecycleMethodInvocation = (LifecycleMethodInterceptorsInvocation) invocation;
         BeanContext<?> beanContext = lifecycleMethodInvocation.getBeanContext();
         return beanContext.getInterceptor(this.lifecycleInterceptorClass);
      }
      throw new IllegalStateException("Interceptor instance unavailable for invocation " + invocation);
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.