[jboss-jira] [JBoss JIRA] Commented: (JBAOP-610) Allow the use of "this" in annotated named pointcuts, typedefs etc.

Kabir Khan (JIRA) jira-events at lists.jboss.org
Tue Jul 8 12:31:29 EDT 2008


    [ http://jira.jboss.com/jira/browse/JBAOP-610?page=comments#action_12420403 ] 
            
Kabir Khan commented on JBAOP-610:
----------------------------------

This seems to already be available for Prepare, so it could be used for the others perhaps

   private boolean deployPreparedClass(AnnotationsAttribute visible, ClassFile cf) throws Exception
   {
         ...
         String expr = replaceThisInExpr(prepare.value(), cf.getName());
         loaderStrategy.deployPointcut(this, name, expr);
         return true;
      }
      
      return false;
   }



> Allow the use of "this" in annotated named pointcuts, typedefs etc.
> -------------------------------------------------------------------
>
>                 Key: JBAOP-610
>                 URL: http://jira.jboss.com/jira/browse/JBAOP-610
>             Project: JBoss AOP
>          Issue Type: Feature Request
>      Security Level: Public(Everyone can see) 
>            Reporter: Kabir Khan
>         Assigned To: Stale Pedersen
>             Fix For: 2.0.0.GA
>
>
> Currently you have to use the fqn when referencing these things:
> package org.jboss.test.microcontainer.annotatedaop;
> @Aspect(scope=Scope.PER_VM)
> public class SomeAspect
> {
>    @TypeDef("class(org.jboss.test.microcontainer.annotatedaop.SimplePOJO)")
>    Object typedef;
>    @PointcutDef("execution(* $typedef{org.jboss.test.microcontainer.annotatedaop.SomeAspect.typedef}->method())")
>    Object pointcut;
>    @Bind(pointcut="org.jboss.test.microcontainer.annotatedaop.SomeAspect.pointcut")
>    public Object advice(MethodInvocation inv) throws Throwable{}
> }
> it would be better to be able to do:
> package org.jboss.test.microcontainer.annotatedaop;
> @Aspect(scope=Scope.PER_VM)
> public class SomeAspect
> {
>    @TypeDef("class(org.jboss.test.microcontainer.annotatedaop.SimplePOJO)")
>    Object typedef;
>    @PointcutDef("execution(* $typedef{this.typedef}->method())")
>    Object pointcut;
>    @Bind(pointcut="this.pointcut")
>    public Object advice(MethodInvocation inv) throws Throwable{}
> }
> The word "this" is just a suggestion, if we could get rid of it, that would be better. If we need to keep it, we might want to use something more recognisable for string replacement, for exampe "$this$"

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list