Package org.jboss.metadata.ejb.spec

Examples of org.jboss.metadata.ejb.spec.InterceptorBindingsMetaData


         throws ClassNotFoundException, NoSuchMethodException,
         NoSuchFieldException
   {
      boolean definesInterceptors = false;

      InterceptorBindingsMetaData interceptorBindings = dd.getAssemblyDescriptor().getInterceptorBindings();
      if(interceptorBindings != null)
      {
         for (InterceptorBindingMetaData binding : interceptorBindings)
         {
            // Wolf: why ignore ordered binding?
View Full Code Here


      roles.add("AccessRole1");
      roles.add("AccessRole2");
      assertEquals(roles, rolesAllowed.getRoles());

      // Validate the MyStateless @Interceptors
      InterceptorBindingsMetaData interceptorBindings = assembly.getInterceptorBindings();
      assertEquals(2, interceptorBindings.size());
      InterceptorBindingMetaData ib0 = interceptorBindings.get(0);
      InterceptorBindingMetaData ib1 = interceptorBindings.get(1);
      assertEquals("MyStatelessBean", ib0.getEjbName());
      NamedMethodMetaData ib0Method = ib0.getMethod();
      if(ib0Method == null)
      {
         // The class level @Interceptors
View Full Code Here

      roles.add("AccessRole1");
      roles.add("AccessRole2");
      assertEquals(roles, rolesAllowed.getRoles());

      // Validate the MyStateless @Interceptors
      InterceptorBindingsMetaData interceptorBindings = assembly.getInterceptorBindings();
      assertEquals(2, interceptorBindings.size());
      InterceptorBindingMetaData ib0 = interceptorBindings.get(0);
      InterceptorBindingMetaData ib1 = interceptorBindings.get(1);
      assertEquals("MyStatelessBean", ib0.getEjbName());
      NamedMethodMetaData ib0Method = ib0.getMethod();
      if (ib0Method == null)
      {
         // The class level @Interceptors
View Full Code Here

      roles.add("AccessRole1");
      roles.add("AccessRole2");
      assertEquals(roles, rolesAllowed.getRoles());

      // Validate the MyStateless @Interceptors
      InterceptorBindingsMetaData interceptorBindings = assembly.getInterceptorBindings();
      assertEquals(2, interceptorBindings.size());
      InterceptorBindingMetaData ib0 = interceptorBindings.get(0);
      InterceptorBindingMetaData ib1 = interceptorBindings.get(1);
      assertEquals("MyStatelessBean", ib0.getEjbName());
      NamedMethodMetaData ib0Method = ib0.getMethod();
      if(ib0Method == null)
      {
         // The class level @Interceptors
View Full Code Here

   @Override
   public <A extends Annotation> A retrieveAnnotation(Class<A> annotationClass, JBossEnterpriseBeanMetaData beanMetaData, ClassLoader classLoader)
   {
      if(annotationClass == DefaultInterceptors.class)
      {
         InterceptorBindingsMetaData bindings = beanMetaData.getEjbJarMetaData().getAssemblyDescriptor().getInterceptorBindings();
         if(bindings != null)
         {
            List<Class<?>> interceptors = new ArrayList<Class<?>>();
            for(InterceptorBindingMetaData binding : bindings)
            {
               String bindingEjbName = binding.getEjbName();
               if(bindingEjbName.equals("*"))
               {
                  assert binding.getMethod() == null : "method binding not allowed on default interceptor";
                 
                  add(interceptors, classLoader, binding);
               }
            }
            if(!interceptors.isEmpty())
               return annotationClass.cast(new DefaultInterceptorsImpl(interceptors));
         }
      }
      else if(annotationClass == Interceptors.class)
      {
         InterceptorBindingsMetaData bindings = beanMetaData.getEjbJarMetaData().getAssemblyDescriptor().getInterceptorBindings();
         if(bindings != null)
         {
            InterceptorsImpl interceptors = new InterceptorsImpl();
            for(InterceptorBindingMetaData binding : bindings)
            {
View Full Code Here

               return annotationClass.cast(annotation);
         }
      }
      else if(annotationClass == Interceptors.class)
      {
         InterceptorBindingsMetaData bindings = beanMetaData.getEjbJarMetaData().getAssemblyDescriptor().getInterceptorBindings();
         if(bindings != null)
         {
            InterceptorsImpl interceptors = new InterceptorsImpl();
            for(InterceptorBindingMetaData binding : bindings)
            {
View Full Code Here

        }
        final ContainerInterceptorsMetaData containerInterceptorsMetaData = containerInterceptorConfigurations.get(0);
        if (containerInterceptorsMetaData == null) {
            return;
        }
        final InterceptorBindingsMetaData containerInterceptorBindings = containerInterceptorsMetaData.getInterceptorBindings();
        // no interceptor-binding == nothing to do
        if (containerInterceptorBindings == null || containerInterceptorBindings.isEmpty()) {
            return;
        }
        // we have now found some container interceptors which are bound to certain EJBs, start the real work!

        final Map<String, List<InterceptorBindingMetaData>> bindingsPerEJB = new HashMap<String, List<InterceptorBindingMetaData>>();
View Full Code Here

         throws ClassNotFoundException, NoSuchMethodException,
         NoSuchFieldException
   {
      boolean definesInterceptors = false;

      InterceptorBindingsMetaData interceptorBindings = dd.getAssemblyDescriptor().getInterceptorBindings();
      if(interceptorBindings != null)
      {
         for (InterceptorBindingMetaData binding : interceptorBindings)
         {
            // Wolf: why ignore ordered binding?
View Full Code Here

      if (assemblyDescriptor == null)
      {
         assemblyDescriptor = new JBossAssemblyDescriptorMetaData();
         jbmd.setAssemblyDescriptor(assemblyDescriptor);
      }
      InterceptorBindingsMetaData interceptorBindings = assemblyDescriptor.getInterceptorBindings();
      if (interceptorBindings == null)
      {
         interceptorBindings = new InterceptorBindingsMetaData();
         assemblyDescriptor.setInterceptorBindings(interceptorBindings);
      }
      // Add this as the first binding in the list so that it is called first...
      interceptorBindings.add(0, IBMD); // clone?
     
      // Check to see there is a defined order; if we aren't first, warn
      for (InterceptorBindingMetaData interceptorBinding : interceptorBindings)
      {
         if (interceptorBinding.getInterceptorOrder() != null && ! interceptorBinding.getInterceptorOrder().isEmpty())
View Full Code Here

         assembly.setMethodPermissions(permissions);
      }
      super.processClass(permissions, beanClass);

      // @Interceptors
      InterceptorBindingsMetaData interceptors = assembly.getInterceptorBindings();
      if(interceptors == null)
      {
         interceptors = new InterceptorBindingsMetaData();
         assembly.setInterceptorBindings(interceptors);
      }
      super.processClass(interceptors, beanClass);

      EjbNameThreadLocal.ejbName.set(null);
View Full Code Here

TOP

Related Classes of org.jboss.metadata.ejb.spec.InterceptorBindingsMetaData

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.