Package org.jboss.aop.advice

Examples of org.jboss.aop.advice.InterceptorFactory


   private void addBinding(String name, String pointcut, Class<?> interceptor) throws ParseException
   {
      AspectManager manager = AspectManager.instance();
      AdviceBinding binding = new AdviceBinding(pointcut, null);
      binding.setName(name);
      InterceptorFactory factory = manager.getInterceptorFactory(interceptor.getName());
      binding.addInterceptorFactory(factory);
      manager.addBinding(binding);
   }
View Full Code Here


         {
            Element interceptorElement = (Element) children2.item(j);
            String tag2 = interceptorElement.getTagName();
            if (tag2.equals("interceptor"))
            {
               InterceptorFactory factory = deployInterceptor(interceptorElement);
               interceptors.add(factory);
            }
            else if (tag2.equals("interceptor-ref"))
            {
               String iname = interceptorElement.getAttribute("name");
               if (iname == null) throw new RuntimeException("interceptor-ref has null name attribute");
               InterceptorFactory factory = manager.getInterceptorFactory(iname);
               if (factory == null) throw new RuntimeException("unable to resolve interceptor-ref: " + iname);
               interceptors.add(factory);
            }
            else if (tag2.equals("stack-ref"))
            {
               String name = interceptorElement.getAttribute("name");
               AdviceStack stack = manager.getAdviceStack(name);
               if (stack == null) throw new Exception("there is no <stack> defined for name: " + name);
               interceptors.addAll(stack.getInterceptorFactories());
            }
            else if (tag2.equals("advice") || tag2.equals("before") || tag2.equals("after") || tag2.equals("throwing"))
            {
               InterceptorFactory factory = deployAdvice(interceptorElement);
               interceptors.add(factory);
            }
         }
      }
      return interceptors;
View Full Code Here

      return super.getClassMetaData();  
   }

   public InterceptorFactory getInterceptorFactory(String name)
   {
      InterceptorFactory factory = null;
      if (parentFirst)
      {
         factory = parent.getInterceptorFactory(name);
         if (factory != null) return factory;
      }
View Full Code Here

      }
      int interceptorsAdded = 0;
      Iterator it = stack.getInterceptorFactories().iterator();
      while (it.hasNext())
      {
         InterceptorFactory factory = (InterceptorFactory) it.next();
         if (!factory.isDeployed()) continue;
         Interceptor interceptor = factory.create(classAdvisor, null);
         insertInterceptor(interceptor);
         interceptorsAdded ++;
      }
      if (interceptorChainObserver != null)
      {
View Full Code Here

      }
      int interceptorsAdded = 0;
      Iterator it = stack.getInterceptorFactories().iterator();
      while (it.hasNext())
      {
         InterceptorFactory factory = (InterceptorFactory) it.next();
         if (!factory.isDeployed()) continue;
         Interceptor interceptor = factory.create(classAdvisor, null);
         appendInterceptor(interceptor);
         interceptorsAdded ++;
      }
      if (interceptorChainObserver != null)
      {
View Full Code Here

      }
      int interceptorsRemoved = 0;
      Iterator it = stack.getInterceptorFactories().iterator();
      while (it.hasNext())
      {
         InterceptorFactory factory = (InterceptorFactory) it.next();
         if (!factory.isDeployed()) continue;
         Interceptor interceptor = factory.create(classAdvisor, null);
         interceptorsRemoved += internalRemoveInterceptor(interceptor.getName());
      }
      if (interceptorChainObserver != null)
      {
         this.interceptorChainObserver.instanceInterceptorsRemoved(this, interceptorsRemoved);
View Full Code Here

      }
      int interceptorsAdded = 0;
      Iterator it = stack.getInterceptorFactories().iterator();
      while (it.hasNext())
      {
         InterceptorFactory factory = (InterceptorFactory) it.next();
         if (!factory.isDeployed()) continue;
         Interceptor interceptor = factory.create(classAdvisor, null);
         insertInterceptor(interceptor);
         interceptorsAdded ++;
      }
      if (interceptorChainObserver != null)
      {
View Full Code Here

      }
      int interceptorsAdded = 0;
      Iterator it = stack.getInterceptorFactories().iterator();
      while (it.hasNext())
      {
         InterceptorFactory factory = (InterceptorFactory) it.next();
         if (!factory.isDeployed()) continue;
         Interceptor interceptor = factory.create(classAdvisor, null);
         appendInterceptor(interceptor);
         interceptorsAdded ++;
      }
      if (interceptorChainObserver != null)
      {
View Full Code Here

      }
      int interceptorsRemoved = 0;
      Iterator it = stack.getInterceptorFactories().iterator();
      while (it.hasNext())
      {
         InterceptorFactory factory = (InterceptorFactory) it.next();
         if (!factory.isDeployed()) continue;
         Interceptor interceptor = factory.create(classAdvisor, null);
         interceptorsRemoved += internalRemoveInterceptor(interceptor.getName());
      }
      if (interceptorChainObserver != null)
      {
         this.interceptorChainObserver.instanceInterceptorsRemoved(this, interceptorsRemoved);
View Full Code Here

TOP

Related Classes of org.jboss.aop.advice.InterceptorFactory

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.