Package org.jboss.aop.advice

Examples of org.jboss.aop.advice.InterceptorFactory


      loader.getAspectManager().addInterceptorFactory(factory.getName(), factory);
   }
  
   public void deployInterceptorBinding(AspectAnnotationLoader loader, String name, String pointcutString, String cflow, ASTCFlowExpression cflowExpression) throws Exception
   {
      InterceptorFactory factory = loader.getAspectManager().getInterceptorFactory(name);
      InterceptorFactory[] inters = {factory};
      Pointcut p = null;
      p = new PointcutExpression(name, pointcutString);
      AdviceBinding binding = new AdviceBinding(name, p, cflowExpression, cflow, inters);
      loader.getAspectManager().addBinding(binding);
View Full Code Here


         }
        
         def = new AspectDefinition(name, scope, aspectFactory);
         manager.addAspectDefinition(def);
      }
      InterceptorFactory factory = manager.getInterceptorFactory(name);
      if (factory == null)
      {
         factory = new ScopedInterceptorFactory(def);
         manager.addInterceptorFactory(name, factory);
      }
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
            {
               AdviceType type = null;
               if (!tag2.equals("advice"))
               {
                  try
                  {
                     type = Enum.valueOf(AdviceType.class, tag2.toUpperCase());
                  }
                  catch (IllegalArgumentException e)
                  {
                     StringBuffer message = new StringBuffer();
                     message.append("unexpected tag inside binding: \'");
                     message.append(tag2);
                     message.append("\'\n\t\t\t\t\t   should be one of: \n\t\t\t\t\t\t'interceptor\', \n\t\t\t\t\t\t'interceptor-ref\', \n\t\t\t\t\t\t'advice\', \n\t\t\t\t\t\t'");
                     for (AdviceType adviceType : AdviceType.values())
                     {
                        message.append(adviceType.getName());
                        message.append("\', \n\t\t\t\t\t\t'");
                     }
                     message.append("stack-ref\'.\n");
                     throw new RuntimeException(message.toString());
                  }
               }
               InterceptorFactory factory = deployAdvice(interceptorElement, type);
               interceptors.add(factory);
            }
         }
      }
      return interceptors;
View Full Code Here

   }

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

   }

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

   }

   @Override
   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

      loader.getAspectManager().addInterceptorFactory(factory.getName(), factory);
   }
  
   public void deployInterceptorBinding(AspectAnnotationLoader loader, String name, String pointcutString, String cflow, ASTCFlowExpression cflowExpression) throws Exception
   {
      InterceptorFactory factory = loader.getAspectManager().getInterceptorFactory(name);
      InterceptorFactory[] inters = {factory};
      Pointcut p = null;
      p = new PointcutExpression(name, pointcutString);
      AdviceBinding binding = new AdviceBinding(name, p, cflowExpression, cflow, inters);
      loader.getAspectManager().addBinding(binding);
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.