Package org.jboss.aop.advice

Examples of org.jboss.aop.advice.GenericAspectFactory


      InterfaceIntroduction.Mixin mixin = new InterfaceIntroduction.Mixin(Mixin.class.getName(), intfs, null, false);
      intro.getMixins().add(mixin);
      domain.addInterfaceIntroduction(intro);

     
      AspectDefinition def = new AspectDefinition("aspect", Scope.PER_VM, new GenericAspectFactory(EchoInterceptor.class.getName(), null));
      domain.addAspectDefinition(def);
      AdviceFactory advice = new AdviceFactory(def, "invoke");
      domain.addInterceptorFactory(advice.getName(), advice);
      //PointcutExpression pointcut = new PointcutExpression("pointcut", "execution(java.lang.String $instanceof{" + POJO.class.getName() + "}->helloWorld(..))");
      {
View Full Code Here


   }
  
   public void testContainerProxyWithFinalMethods() throws Exception
   {
      InstanceDomain domain = new InstanceDomain(AspectManager.instance(), "test", false);
      AspectDefinition def = new AspectDefinition("aspect", Scope.PER_VM, new GenericAspectFactory(EchoInterceptor.class.getName(), null));
      domain.addAspectDefinition(def);
      AdviceFactory advice = new AdviceFactory(def, "invoke");
      domain.addInterceptorFactory(advice.getName(), advice);
      {
      PointcutExpression pointcut = new PointcutExpression("pointcut", "execution(* " + POJOWithFinalMethods.class.getName() + "->*(..))");
 
View Full Code Here

   }
  
   public void testProxyWithPerInstanceAspects() throws Exception
   {
      AspectManager manager = AspectManager.instance();
      AspectDefinition def = new AspectDefinition("perinstanceaspect", Scope.PER_INSTANCE, new GenericAspectFactory(TestInterceptor.class.getName(), null));
      AdviceFactory advice = new AdviceFactory(def, "invoke");
      PointcutExpression pointcut = new PointcutExpression("perinstancepointcut", "execution(* $instanceof{" + SomeInterface.class.getName() + "}->*(..))");
      InterceptorFactory[] interceptors = {advice};
      AdviceBinding binding = new AdviceBinding("perinstancebinding", pointcut, null, null, interceptors);
      try
View Full Code Here

   }

   public void testProxyWithPerJoinpointAspects() throws Exception
   {
      AspectManager manager = AspectManager.instance();
      AspectDefinition def = new AspectDefinition("perinstanceaspect", Scope.PER_JOINPOINT, new GenericAspectFactory(TestInterceptor.class.getName(), null));
      AdviceFactory advice = new AdviceFactory(def, "invoke");
      PointcutExpression pointcut = new PointcutExpression("perinstancepointcut", "execution(* $instanceof{" + SomeInterface.class.getName() + "}->*(..))");
      InterceptorFactory[] interceptors = {advice};
      AdviceBinding binding = new AdviceBinding("perinstancebinding", pointcut, null, null, interceptors);
      try
View Full Code Here

   }
  
   public void testProxyWithMetaData() throws Exception
   {
      AspectManager manager = AspectManager.instance();
      AspectDefinition def = new AspectDefinition("aspect", Scope.PER_INSTANCE, new GenericAspectFactory(TestInterceptor.class.getName(), null));
      AdviceFactory advice = new AdviceFactory(def, "invoke");
      PointcutExpression pointcut = new PointcutExpression("pointcut", "execution(* " + Annotation.class.getName() + "->*(..))");
      InterceptorFactory[] interceptors = {advice};
      AdviceBinding binding = new AdviceBinding("binding", pointcut, null, null, interceptors);
      try
View Full Code Here

         factory = new AspectFactoryDelegator(name, null);
         ((AspectFactoryWithClassLoader)factory).setClassLoader(loader.getClassLoader());
      }
      else
      {
         factory = new GenericAspectFactory(name, null);
         ((AspectFactoryWithClassLoader)factory).setClassLoader(loader.getClassLoader());
      }
      AspectDefinition def = new AspectDefinition(name, scope, factory);
      loader.getAspectManager().addAspectDefinition(def);
   }
View Full Code Here

      else
      {
         AspectFactory aspectFactory;
         if (clazz != null)
         {
            aspectFactory = new GenericAspectFactory(clazz, element);
            ((AspectFactoryWithClassLoader)aspectFactory).setClassLoader(cl);
         }
         else
         {
            aspectFactory = new AspectFactoryDelegator(factory1, element);
View Full Code Here

         if (scope == null) throw new RuntimeException("Illegal scope attribute value: " + s);
      }
      AspectFactory aspectFactory;
      if (clazz != null)
      {
         aspectFactory = new GenericAspectFactory(clazz, element);
         ((AspectFactoryWithClassLoader)aspectFactory).setClassLoader(cl);
      }
      else
      {
         aspectFactory = new AspectFactoryDelegator(factory, element);
View Full Code Here

         factory = new AspectFactoryDelegator(name, null);
         ((AspectFactoryWithClassLoader)factory).setClassLoader(loader.getClassLoader());
      }
      else
      {
         factory = new GenericAspectFactory(name, null);
         ((AspectFactoryWithClassLoader)factory).setClassLoader(loader.getClassLoader());
      }
      AspectDefinition def = new AspectDefinition(name, scope, factory);
      loader.getAspectManager().addAspectDefinition(def);
   }
View Full Code Here

/* 295 */     return new ManagedAspectDefinition(this.aspectDefName, this.scope, factory, false);
/*     */   }
/*     */
/*     */   protected ManagedAspectDefinition getAspectDefinitionPlainAspectFactory()
/*     */   {
/* 300 */     AspectFactory factory = this.factory ? new AspectFactoryDelegator(this.adviceName, null) : new GenericAspectFactory(this.adviceName, null);
/*     */
/* 302 */     return new ManagedAspectDefinition(this.aspectDefName, this.scope, factory);
/*     */   }
View Full Code Here

TOP

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

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.