Package org.jboss.ejb3.interceptors.container

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


      this.addInput(JBossMetaData.class);
      this.addOutput(BeanInstantiator.class);
      jsr299BeanInstantiatorDeployer = new Jsr299BeanInstantiatorDeployer();
      jsr299BeanInstantiatorDeployer.setKernel(kernel);
      jsr299BeanInstantiatorDeployer.setJavaEEComponentInformer(javaEEComponentInformer);
      singletonBeanInstantiatorDeployer = new SingletonBeanInstantiatorDeployer(defaultBeanInstantiator);
      singletonBeanInstantiatorDeployer.setKernel(kernel);
      singletonBeanInstantiatorDeployer.setJavaEEComponentInformer(javaEEComponentInformer);
   }
View Full Code Here


      }
      this.asynchronousProcessor = es;
     
      // Get the Bean Instantiator
      final String beanInstantiatorAttachmentName = AttachmentNames.NAME_BEAN_INSTANCE_INSTANTIATOR;
      final BeanInstantiator beanInstantiator = (BeanInstantiator) unit.getAttachment(beanInstantiatorAttachmentName);
      if (beanInstantiator == null)
      {
         throw new IllegalStateException(unit + " must contain an attachment of name " + beanInstantiatorAttachmentName);
      }
      this.beanInstantiator = beanInstantiator;
View Full Code Here

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

      return this.getClass().getName();
   }

   public Object invoke(Invocation invocation) throws Throwable
   {
      ContainerMethodInvocation mi = (ContainerMethodInvocation)invocation;
     
      if (createNewInstance == false && pooledBean == null)
      {
         throw new RuntimeException("createNewInstance was false on an empty pool");
      }
     
      @SuppressWarnings("unchecked")
      SimpleContext ctx = (SimpleContext)mi.getBeanContext();
      ProxiedBean bean = createNewInstance ? new ProxiedBean() : pooledBean;
      pooledBean = bean;
     
      log.debug("Using instance " + bean);
     
      ctx.setInstance(bean);
      //mi.setTargetObject(bean);
      mi.setBeanContext(ctx);
      try
      {
         return invocation.invokeNext();
      }
      finally
      {
         ctx.setInstance(null);
         mi.setBeanContext(null);
      }
   }
View Full Code Here

   {
      long methodHash = MethodHashing.calculateHash(method);
      MethodInfo info = getAdvisor().getMethodInfo(methodHash);
      if(info == null)
         throw new IllegalArgumentException("method " + method + " is not under advisement by " + this);
      ContainerMethodInvocation invocation = new ContainerMethodInvocation(info, info.getInterceptors())
      {
         @Override
         public Object invokeTarget() throws Throwable
         {
            // TODO: invoke the real target in special modus
            return null;
         }
      };
      invocation.setArguments(arguments);
      invocation.setBeanContext(target);
      return invocation.invokeNext();
   }
View Full Code Here

   {
      long methodHash = MethodHashing.calculateHash(method);
      MethodInfo info = getAdvisor().getMethodInfo(methodHash);
      if(info == null)
         throw new IllegalArgumentException("method " + method + " is not under advisement by " + this);
      ContainerMethodInvocation invocation = new StatefulContainerMethodInvocation(info, id, arguments);
      return invocation.invokeNext();
   }
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.ContainerMethodInvocation

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.