Examples of addInterceptorFactory()


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

      assertEquals(Interceptions.getConstructorName("MyInterceptor", "POJO"), Interceptions.get(0));
     
      AdviceBinding binding2 = new AdviceBinding("execution(org.jboss.test.aop.dynamicgenadvisor.POJO->new())", null);
      String name2 = binding2.getName();
      AspectDefinition myAspect = AspectManager.instance().getAspectDefinition("org.jboss.test.aop.dynamicgenadvisor.MyAspect");
      binding2.addInterceptorFactory(new AdviceFactory(myAspect, "intercept"));
      binding2.addInterceptor(MyInterceptor.class);
      AspectManager.instance().addBinding(binding2);
     
      Interceptions.clear();
      pojo = new POJO();
View Full Code Here

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

      assertEquals(Interceptions.getConstructionName("MyInterceptor", "POJO"), Interceptions.get(0));
     
      AdviceBinding binding2 = new AdviceBinding("construction(org.jboss.test.aop.dynamicgenadvisor.POJO->new())", null);
      String name2 = binding2.getName();
      AspectDefinition myAspect = AspectManager.instance().getAspectDefinition("org.jboss.test.aop.dynamicgenadvisor.MyAspect");
      binding2.addInterceptorFactory(new AdviceFactory(myAspect, "intercept"));
      binding2.addInterceptor(MyInterceptor.class);
      AspectManager.instance().addBinding(binding2);
     
      Interceptions.clear();
      pojo = new POJO();
View Full Code Here

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

      assertEquals(Interceptions.getMethodName("MyInterceptor", "POJO", "someMethod"), Interceptions.get(0));
     
      AdviceBinding binding2 = new AdviceBinding("execution(* org.jboss.test.aop.dynamicgenadvisor.POJO->someMethod(..))", null);
      String name2 = binding2.getName();
      AspectDefinition myAspect = AspectManager.instance().getAspectDefinition("org.jboss.test.aop.dynamicgenadvisor.MyAspect");
      binding2.addInterceptorFactory(new AdviceFactory(myAspect, "intercept"));
      binding2.addInterceptor(MyInterceptor.class);
      AspectManager.instance().addBinding(binding2);
     
      Interceptions.clear();
      pojo.someMethod(123);
View Full Code Here

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

      assertEquals(Interceptions.getFieldReadName("MyInterceptor", "POJO", "i"), Interceptions.get(1));

      AdviceBinding binding3 = new AdviceBinding("field(* org.jboss.test.aop.dynamicgenadvisor.POJO->i)", null);
      String name3 = binding3.getName();
      AspectDefinition myAspect = AspectManager.instance().getAspectDefinition("org.jboss.test.aop.dynamicgenadvisor.MyAspect");
      binding3.addInterceptorFactory(new AdviceFactory(myAspect, "intercept"));
      binding3.addInterceptor(MyInterceptor.class);
      AspectManager.instance().addBinding(binding3);
     
      Interceptions.clear();
      pojo.i = 20;
View Full Code Here

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

         getInstanceDomain(pojo1).addBinding(bindingA);
        
         AdviceBinding bindingB = new AdviceBinding("execution(* org.jboss.test.aop.dynamicgenadvisor.POJO->someMethod(..))", 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.someMethod(123);
View Full Code Here

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

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

         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

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

      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

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

      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

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

/*     */       {
/* 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
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.