Package org.jboss.aop.advice

Examples of org.jboss.aop.advice.AdviceFactory


      if(aspect == null || aspect.length() < 1)
         throw new RuntimeException("Aspect couldnt be found for element: "+element.getNodeName()+", typo perhaps?");
      AspectDefinition def = manager.getAspectDefinition(aspect);
      if (def == null) throw new RuntimeException("advice " + name + " cannot find aspect " + aspect);
     
      AdviceFactory factory = null;
      if (type == null)
      {
         // use default advice type
         factory = new AdviceFactory(def, name);
      }
      else
      {
         factory = new AdviceFactory(def, name, type);
      }
     
      manager.addInterceptorFactory(factory.getName(), factory);
      return factory;
   }
View Full Code Here


            cflowExpression = new PointcutExpressionParser(new StringReader(cflow)).CFlowExpression();

         }
        
         org.jboss.aop.advice.AdviceType internalAdviceType = getInternalAdviceType(binding.type());
         AdviceFactory factory = null;
         if (internalAdviceType == org.jboss.aop.advice.AdviceType.AROUND)
         {
            factory = new AdviceFactory(def, minfo.getName());
         }
         else
         {
            factory = new AdviceFactory(def, minfo.getName(), internalAdviceType);
         }
        
         manager.addInterceptorFactory(factory.getName(), factory);
         InterceptorFactory[] fact = {factory};
         String name = getAspectMethodBindingName(cf, minfo);
         PointcutExpression pointcut = new PointcutExpression(name, pointcutString);
         AdviceBinding abinding = new AdviceBinding(name, pointcut, cflowExpression, cflow, fact);
         manager.addBinding(abinding);
View Full Code Here

            cflowExpression = new PointcutExpressionParser(new StringReader(cflow)).CFlowExpression();

         }
        
         org.jboss.aop.advice.AdviceType internalAdviceType = getInternalAdviceType(binding.type());
         AdviceFactory factory = null;
         if (internalAdviceType == org.jboss.aop.advice.AdviceType.AROUND)
         {
            factory = new AdviceFactory(def, minfo.getName());
         }
         else
         {
            factory = new AdviceFactory(def, minfo.getName(), internalAdviceType);
         }
        
         manager.addInterceptorFactory(factory.getName(), factory);
         InterceptorFactory[] fact = {factory};
         String name = getAspectMethodBindingName(cf, minfo);
         PointcutExpression pointcut = new PointcutExpression(name, pointcutString);
         AdviceBinding abinding = new AdviceBinding(name, pointcut, cflowExpression, cflow, fact);
         manager.addBinding(abinding);
View Full Code Here

      if(aspect == null || aspect.length() < 1)
         throw new RuntimeException("Aspect couldnt be found for element: "+element.getNodeName()+", typo perhaps?");
      AspectDefinition def = manager.getAspectDefinition(aspect);
      if (def == null) throw new RuntimeException("advice " + name + " cannot find aspect " + aspect);
     
      AdviceFactory factory = null;
      if (type == null)
      {
         // use default advice type
         factory = new AdviceFactory(def, name);
      }
      else
      {
         factory = new AdviceFactory(def, name, type);
      }
     
      manager.addInterceptorFactory(factory.getName(), factory);
      return factory;
   }
View Full Code Here

      AdviceBinding binding = new AdviceBinding(
            "execution(void *PreparedPOJO->someMethod(..))", null);
      AspectDefinition aspectDefinition = AspectManager.instance()
            .getAspectDefinition(AnnotatedAspectFactory.class.getName());
      assertNotNull(aspectDefinition);
      binding.addInterceptorFactory(new AdviceFactory(aspectDefinition,
            "advice"));
      AspectManager.instance().addBinding(binding);

      PreparedPOJO pojo = new PreparedPOJO();
      pojo.someMethod();
View Full Code Here

      AspectDefinition def = manager.getAspectDefinition(aspect);
      if (def == null) throw new RuntimeException("advice " + name + " cannot find aspect " + aspect);
     
      String tagName = element.getTagName();
     
      AdviceFactory factory = null;
      if (tagName.equals("advice"))
      {
         factory = new AdviceFactory(def, name);
      }
      else if (tagName.equals("before"))
      {
         factory = new BeforeFactory(def, name);
      }
      else if (tagName.equals("after"))
      {
         factory = new AfterFactory(def, name);
      }
      else if (tagName.equals("throwing"))
      {
         factory = new ThrowingFactory(def, name);
      }
      manager.addInterceptorFactory(factory.getName(), factory);
      return factory;
   }
View Full Code Here

         if (cflow != null)
         {
            cflowExpression = new PointcutExpressionParser(new StringReader(cflow)).CFlowExpression();

         }
         AdviceFactory factory = new AdviceFactory(def, minfo.getName());
         manager.addInterceptorFactory(factory.getName(), factory);
         InterceptorFactory[] fact = {factory};
         String name = getAspectMethodBindingName(cf, minfo);
         PointcutExpression pointcut = new PointcutExpression(name, pointcutString);
         AdviceBinding abinding = new AdviceBinding(name, pointcut, cflowExpression, cflow, fact);
         manager.addBinding(abinding);
View Full Code Here

TOP

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

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.