Examples of PointcutExpression


Examples of org.jboss.aop.pointcut.PointcutExpression

   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
      {
         manager.addAspectDefinition(def);
View Full Code Here

Examples of org.jboss.aop.pointcut.PointcutExpression

   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
      {
         manager.addAspectDefinition(def);
View Full Code Here

Examples of org.jboss.aop.pointcut.PointcutExpression

   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
      {
         manager.addAspectDefinition(def);
View Full Code Here

Examples of org.jboss.aop.pointcut.PointcutExpression

         factory = new AdviceFactory(def, methodName, internalAdviceType);
      }
     
      loader.getAspectManager().addInterceptorFactory(factory.getName(), factory);
      InterceptorFactory[] fact = {factory};
      PointcutExpression pointcut = new PointcutExpression(bindingName, pointcutString);
      AdviceBinding abinding = new AdviceBinding(bindingName, pointcut, cflowExpression, cflow, fact);
      loader.getAspectManager().addBinding(abinding);
   }
View Full Code Here

Examples of org.jboss.aop.pointcut.PointcutExpression

   public void deployInterceptorBinding(AspectAnnotationLoader loader, String name, String pointcutString, String cflow, ASTCFlowExpression cflowExpression) throws Exception
   {
      InterceptorFactory factory = loader.getAspectManager().getInterceptorFactory(name);
      InterceptorFactory[] inters = {factory};
      Pointcut p = null;
      p = new PointcutExpression(name, pointcutString);
      AdviceBinding binding = new AdviceBinding(name, p, cflowExpression, cflow, inters);
      loader.getAspectManager().addBinding(binding);

   }
View Full Code Here

Examples of org.jboss.aop.pointcut.PointcutExpression

      loader.getAspectManager().removeDynamicCFlow(name);
   }
  
   public void deployPointcut(AspectAnnotationLoader loader, String name, String expr) throws Exception
   {
      Pointcut p = new PointcutExpression(name, expr);
      loader.getAspectManager().addPointcut(p);
   }
View Full Code Here

Examples of org.jboss.aop.pointcut.PointcutExpression

   private void updatePointcutStats(Pointcut pointcut, AspectManager manager)
   {
      // the following is for performance reasons.
      if (pointcut instanceof PointcutExpression)
      {
         PointcutExpression expr = (PointcutExpression) pointcut;
         expr.setManager(manager);
         PointcutStats stats = expr.getStats();
         updateStats(stats);
      }
      else
      {
         // can't be sure so set all
View Full Code Here

Examples of org.jboss.aop.pointcut.PointcutExpression

   private static PointcutStats getPointcutStats(Pointcut pointcut)
   {
      if (pointcut instanceof PointcutExpression)
      {
         PointcutExpression expr =  (PointcutExpression)pointcut;
         return expr.getStats();
      }
      return null;
   }
View Full Code Here

Examples of org.jboss.aop.pointcut.PointcutExpression

      ArrayList<InterceptorFactory> interceptors = loadInterceptors(element);
      InterceptorFactory[] inters = interceptors.toArray(new InterceptorFactory[interceptors.size()]);
      Pointcut p = null;
      try
      {
         p = new PointcutExpression(getName("binding pointcut "), pointcut);
      }
      catch (ParseException ex)
      {
         throw new RuntimeException("<bind> pointcut expression failed: " + pointcut, ex);
      }
View Full Code Here

Examples of org.jboss.aop.pointcut.PointcutExpression

         throw new RuntimeException("pointcut declaration must have an expr associated with it");
      }
      Pointcut p = null;
      try
      {
         p = new PointcutExpression(name, expr);
      }
      catch (ParseException ex)
      {
         throw new RuntimeException("<pointcut name='" + name + "' expr='" + expr + "'/> failed", ex);
      }
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.