Package org.jboss.ejb3.interceptors.container

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


      {
         // set the dependency policy
         this.dependencyPolicy = deployment.createDependencyPolicy(this);
        
         // Set the bean instantiator
         final BeanInstantiator beanInstantiator = deployment.getBeanInstantiator();
         if (beanInstantiator != null)
         {
            this.beanInstantiator = beanInstantiator;           
         }
View Full Code Here


      assert unit != null : "unit is null";
      assert classLoader != null : "classLoader is null";
     
      this.unit = unit;
      this.classLoader = classLoader;
      this.interceptorInfoRepository = new InterceptorInfoRepository(classLoader);
   }
View Full Code Here

    * @throws InstantiationException
    */
   public Object createInterceptor(Class<?> interceptorClass) throws InstantiationException, IllegalAccessException
   {
      Object instance = interceptorClass.newInstance();
      InterceptorInjector interceptorInjector = interceptorInjectors.get(interceptorClass);
      assert interceptorInjector != null : "interceptorInjector not found for " + interceptorClass;
      interceptorInjector.inject(null, instance);
      return instance;
   }
View Full Code Here

            }
         }
         for (Class<?> interceptorClass : beanContainer.getInterceptorClasses())
         {
            Map<AccessibleObject, Injector> injections = InjectionUtil.processAnnotations(this, handlers, interceptorClass);
            InterceptorInjector injector = new InterceptorInjector(injections);
            interceptorInjectors.put(interceptorClass, injector);
         }

         // When @WebServiceRef is not used service-ref won't be processed
         // In this case we process them late
View Full Code Here

      // 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

      // 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

      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

   {
      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

      // 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

   {
      this.metadataBasedAnnotationRepo = new AnnotationRepositoryToMetaData(this.beanClass, this.xml, name, this.classloader);
      List<MetaDataBridge<InterceptorMetaData>> interceptorBridges = new ArrayList<MetaDataBridge<InterceptorMetaData>>();
      interceptorBridges.add(new InterceptorMetaDataBridge());
      this.metadataBasedAnnotationRepo.addComponentMetaDataLoaderFactory(new InterceptorComponentMetaDataLoaderFactory(interceptorBridges));
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new AdditiveBeanInterceptorMetaDataBridge(this.beanClass, this.classloader, this.xml));
     
      List<MetaDataBridge<ApplicationExceptionMetaData>> appExceptionBridges = new ArrayList<MetaDataBridge<ApplicationExceptionMetaData>>();
      appExceptionBridges.add(new ApplicationExceptionMetaDataBridge());
      this.metadataBasedAnnotationRepo.addComponentMetaDataLoaderFactory(new ApplicationExceptionComponentMetaDataLoaderFactory(appExceptionBridges));
     
View Full Code Here

TOP

Related Classes of org.jboss.ejb3.interceptors.container.LifecycleMethodInterceptorsInvocation

Copyright © 2018 www.massapicom. 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.