Package org.jboss.aop.advice

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


      getInstanceDomain(pojo2).addClassMetaData(loader2.getClassMetaDataBinding());
      binding2.addInterceptor(MetadataInterceptor.class);
      getInstanceDomain(pojo2).addBinding(binding2);
     
      AdviceBinding binding3 = new AdviceBinding("all(org.jboss.test.aop.dynamicgenadvisor.POJO)", null);
      binding3.addInterceptor(MetadataInterceptor.class);
      getInstanceDomain(pojo3).addBinding(binding3);
     
      MetadataInterceptor.clear();
      System.out.println("---POJO1 set i");
      pojo1.i = 10;
View Full Code Here


      POJO pojo1 = new POJO();
      pojo.someMethod(123);
      assertFalse(MetadataInterceptor.intercepted);

      AdviceBinding binding1 = new AdviceBinding("all(org.jboss.test.aop.dynamicgenadvisor.POJO)", null);
      binding1.addInterceptor(MetadataInterceptor.class);
      AspectManager.instance().addBinding(binding1);

      DynamicSimpleClassMetadataLoader loader = new DynamicSimpleClassMetadataLoader(
            "TEST", "org.jboss.test.aop.dynamicgenadvisor.POJO");
      loader.addDefaultMetaData("default", "default");
View Full Code Here

      {
//         new Caller2();  // concallcon wont work if the class is already loaded by the cl
        
         AdviceBinding bindingCall = new AdviceBinding(
               "call(org.jboss.test.aop.rebuildcallerchain.Caller1->new(int))", null);
         bindingCall.addInterceptor(RebuildCallerChainInterceptor.class);
         AspectManager.instance().addBinding(bindingCall);

         RebuildCallerChainInterceptor.call = false;
         new Caller2(true);
         assertTrue("caller2 was not rebuilded", RebuildCallerChainInterceptor.call);
View Full Code Here

      {
         new Caller1().execute();
        
         AdviceBinding bindingCall = new AdviceBinding(
               "call(* org.jboss.test.aop.rebuildcallerchain.*->execute())", null);
         bindingCall.addInterceptor(RebuildCallerChainInterceptor.class);
         AspectManager.instance().addBinding(bindingCall);

         new Caller1().execute();
         assertTrue("caller1 was not rebuilded", RebuildCallerChainInterceptor.call);
         RebuildCallerChainInterceptor.call = false;
View Full Code Here

         callbackMethod = annotation.callbackMethod();
         expectedCalls = annotation.expectedCalls();

         // Create new runtime interception for the pointcut given in the annotation variable
         AdviceBinding binding = new AdviceBinding(BINDING_NAME, invocation, null);
         binding.addInterceptor(MockAspect.class);
         AspectManager.instance().addBinding(binding);

         // Invoke the interceptor stack, calling the newly added interceptor
         return i.invokeNext();
      }
View Full Code Here

      ClassLoader classLoader = createUserDefinedCL();
      Class<?> clazz = Class.forName(INTERCEPTOR_CLASS, false, classLoader);
     
      AdviceBinding binding = new AdviceBinding("userdefinedclbinding",
               "execution(* org.jboss.test.aop.*->*(..))", null);
      binding.addInterceptor(clazz);
      AspectManager.instance().addBinding(binding);

      Method resetStatus = clazz.getDeclaredMethod("resetInvokeStatus");
      Method getStatus = clazz.getDeclaredMethod("getInvoked");
     
View Full Code Here

      for(int i = 0; i < size; i++)
      {
         AdviceBinding binding = new AdviceBinding(
               "execution(public void org.jboss.test.aop.benchmark.POJO->foo())", null);
         binding.setName("method"+i);
         binding.addInterceptor(Interceptor1.class);
         bindings.add(binding);
      }
      System.out.println("Creating the methodbindings took: "+(System.currentTimeMillis()-time));
     
      POJO p = new POJO();
View Full Code Here

      for(int i = 0; i < size/2; i++)
      {
         AdviceBinding binding = new AdviceBinding(
               "set(* org.jboss.test.aop.benchmark.POJO->i)", null);
         binding.setName("set"+i);
         binding.addInterceptor(Interceptor1.class);
         bindings.add(binding);
        
         AdviceBinding binding2 = new AdviceBinding(
               "get(* org.jboss.test.aop.benchmark.POJO->i)", null);
         binding2.setName("get"+i);
View Full Code Here

         bindings.add(binding);
        
         AdviceBinding binding2 = new AdviceBinding(
               "get(* org.jboss.test.aop.benchmark.POJO->i)", null);
         binding2.setName("get"+i);
         binding2.addInterceptor(Interceptor1.class);
         bindings.add(binding2);
        
      }
      System.out.println("Creating the fieldbindings took: "+(System.currentTimeMillis()-time));
     
View Full Code Here

{
   public static void main(String[] args) throws Exception
   {
      execute();
      AdviceBinding binding = new AdviceBinding("execution(POJO->new(..))", null);
      binding.addInterceptor(SimpleInterceptor.class);
      AspectManager.instance().addBinding(binding);
      execute();
   }
   public static void execute()
   {
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.