Package org.jboss.aop.advice

Examples of org.jboss.aop.advice.AdviceBinding.addInterceptorFactory()


      POJO pojo2 = new POJO();
     
      AdviceBinding binding = new AdviceBinding("set(* org.jboss.test.aop.dynamicgenadvisor.POJO->i)", null);
      String name = binding.getName();
      AspectDefinition myAspect = AspectManager.instance().getAspectDefinition("org.jboss.test.aop.dynamicgenadvisor.MyAspect");
      binding.addInterceptorFactory(new AdviceFactory(myAspect, "intercept"));
      getInstanceDomain(pojo2).addBinding(binding);
     
      Interceptions.clear();
      pojo1.i = 10;
      assertEquals(10, pojo1.i);
View Full Code Here


         getInstanceDomain(pojo1).addBinding(bindingA);
        
         AdviceBinding bindingB = new AdviceBinding("get(* org.jboss.test.aop.dynamicgenadvisor.POJO->i)", null);
         String nameB = bindingB.getName();
         AspectDefinition myAspect = AspectManager.instance().getAspectDefinition("org.jboss.test.aop.dynamicgenadvisor.MyAspect");
         bindingB.addInterceptorFactory(new AdviceFactory(myAspect, "intercept"));
         getInstanceDomain(pojo2).addBinding(bindingB);
        
         System.out.println("Added instance advices");
         Interceptions.clear();
         pojo1.i = 50;
View Full Code Here

      AdviceBinding bindingTopA = new AdviceBinding("execution(* org.jboss.test.aop.dynamicgenadvisor.*POJO->someMethod*(..))", null);
      String nameTopA = bindingTopA.getName();
      try
      {
         AspectDefinition myAspect = AspectManager.instance().getAspectDefinition("org.jboss.test.aop.dynamicgenadvisor.MyAspect");
         bindingTopA.addInterceptorFactory(new AdviceFactory(myAspect, "intercept"));
         AspectManager.instance().addBinding(bindingTopA);

         Interceptions.clear();
         pojo1.someMethod(123);
         assertEquals(1, Interceptions.size());
View Full Code Here

      AspectManager domain = AspectManager.instance();
     
      try
      {
         AdviceBinding binding = new AdviceBinding("execution(* @" + TestClassAnnotation.class.getName() + "->*(..))", null);
         binding.addInterceptorFactory(new GenericInterceptorFactory(TestClassAspect.class));
         domain.addBinding(binding);
      }
      catch (Exception e)
      {
         throw new RuntimeException("Error setting up advices ", e);
View Full Code Here

/*     */       {
/* 135 */         entry.start();
/* 136 */         InterceptorFactory[] factories = entry.getInterceptorFactories();
/* 137 */         for (InterceptorFactory ifac : factories)
/*     */         {
/* 139 */           binding.addInterceptorFactory(ifac);
/*     */         }
/*     */       }
/*     */     }
/* 143 */     this.manager.addBinding(binding);
/* 144 */     log.debug("Bound binding " + this.name);
View Full Code Here

         {
            entry.start();
            InterceptorFactory[] factories = entry.getInterceptorFactories();
            for (InterceptorFactory ifac : factories)
            {
               binding.addInterceptorFactory(ifac);
            }
         }
      }
      manager.addBinding(binding);
      log.debug("Bound binding " + name);
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

   {
      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);
   }

   public void testDynamicMethod() throws ParseException
   {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.