Package org.jboss.ejb3.interceptors.annotation.impl

Examples of org.jboss.ejb3.interceptors.annotation.impl.InterceptorsImpl


      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

   @Override
   public <A extends Annotation> A retrieveAnnotation(Class<A> annotationClass, JBossEnterpriseBeanMetaData beanMetaData, ClassLoader classLoader)
   {
      if(annotationClass == Interceptors.class)
      {
         InterceptorsImpl interceptors = new InterceptorsImpl();
         if(!isMetadataComplete(beanMetaData))
            interceptors.add(getBeanClass().getAnnotation(Interceptors.class));
        
         interceptors.add(super.retrieveAnnotation(Interceptors.class, beanMetaData, classLoader));
        
         if(!interceptors.isEmpty())
            return annotationClass.cast(interceptors);
      }
      return super.retrieveAnnotation(annotationClass, beanMetaData, classLoader);
   }
View Full Code Here

   @Override
   public <A extends Annotation> A retrieveAnnotation(Class<A> annotationClass, JBossEnterpriseBeanMetaData beanMetaData, ClassLoader classLoader)
   {
      if(annotationClass == Interceptors.class)
      {
         InterceptorsImpl interceptors = new InterceptorsImpl();
         if(!isMetadataComplete(beanMetaData))
            interceptors.add(beanClass.getAnnotation(Interceptors.class));
        
         interceptors.add(super.retrieveAnnotation(Interceptors.class, beanMetaData, classLoader));
        
         if(!interceptors.isEmpty())
            return annotationClass.cast(interceptors);
      }
      return super.retrieveAnnotation(annotationClass, beanMetaData, classLoader);
   }
View Full Code Here

      else if(annotationClass == Interceptors.class)
      {
         InterceptorBindingsMetaData bindings = beanMetaData.getEjbJarMetaData().getAssemblyDescriptor().getInterceptorBindings();
         if(bindings != null)
         {
            InterceptorsImpl interceptors = new InterceptorsImpl();
            for(InterceptorBindingMetaData binding : bindings)
            {
               // For the method component
               if(binding.getMethod() != null)
                  continue;
View Full Code Here

      else if(annotationClass == Interceptors.class)
      {
         InterceptorBindingsMetaData bindings = beanMetaData.getEjbJarMetaData().getAssemblyDescriptor().getInterceptorBindings();
         if(bindings != null)
         {
            InterceptorsImpl interceptors = new InterceptorsImpl();
            for(InterceptorBindingMetaData binding : bindings)
            {
               // For the bean
               if(binding.getMethod() == null)
                  continue;
              
               NamedMethodMetaData method = binding.getMethod();
              
               // TODO: this is weird, it should have been caught earlier (invalid xml)
               if(method.getMethodName() == null)
                  continue;
              
               if(method.getMethodName().equals(methodName))
               {
                  MethodParametersMetaData methodParams = method.getMethodParams();
                  if(methodParams == null)
                     add(interceptors, classLoader, binding);
                  else
                  {
                     if(Arrays.equals(methodParams.toArray(), parameterNames))
                        add(interceptors, classLoader, binding);
                  }
               }
            }
            if(interceptors.value().length > 0)
               return annotationClass.cast(interceptors);
         }
      }
      else if(annotationClass == PostActivate.class)
      {
View Full Code Here

TOP

Related Classes of org.jboss.ejb3.interceptors.annotation.impl.InterceptorsImpl

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.