Package org.jboss.aop.advice

Examples of org.jboss.aop.advice.AdviceFactory


      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


      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

      Domain domain = new Domain(new AspectManager(), "Test", false);

      GenericAspectFactory aspectFactory = new GenericAspectFactory(CurrentInvocationInterceptor.class.getName(), null);
      AspectDefinition def = new AspectDefinition("CurrentInvocationInterceptor", Scope.PER_VM, aspectFactory);
      domain.addAspectDefinition(def);
      AdviceFactory factory = new AdviceFactory(def, "invoke");
      GenericAspectFactory aspectFactory2 = new GenericAspectFactory(CurrentInvocationContextInterceptor.class.getName(), null);
      AspectDefinition def2 = new AspectDefinition("CurrentInvocationContextInterceptor", Scope.PER_VM, aspectFactory2);
      domain.addAspectDefinition(def2);
      AdviceFactory factory2 = new AdviceFactory(def2, "invoke");
      AdviceStack stack = new AdviceStack("InjectionCallbackStack", new ArrayList<InterceptorFactory>(Arrays.asList(factory, factory2)));
      domain.addAdviceStack(stack);
     
      Map<String, Class<? extends PersistenceManagerFactory>> factories = new HashMap<String, Class<? extends PersistenceManagerFactory>>();
      factories.put("MyStatefulSessionFilePersistenceManager", MyStatefulSessionFilePersistenceManagerFactory.class);
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

      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

      if (aspect == null)
      {
         throw new IllegalArgumentException("Null aspect");
      }
      interceptorFactory = (aspectMethod == null) ?
            new ScopedInterceptorFactory(aspect.getDefinition()) : new AdviceFactory(aspect.getDefinition(), aspectMethod);
           
      manager.addInterceptorFactory(name, interceptorFactory);
      if (binding != null)
      {
         aspect.addBinding(binding);
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

      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

      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

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.