Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] AspectJ reflect API

Why do you want to make pointcut runtime visible while they already
have a class level retention (be it code style or annotation style) ?
Don't you plan to read them back from bytecode structures ?

If there is some compiler work to achieve that goal by injecting some
new runtime visible structures, may I raise that some complexity of
this work is tied to not having a single bytecode format for what is
an aspect, precisely using regular regular Java annotations (which
does not mean you have to use them in the aspect source code in code
style of course).

Alex


On 4/18/05, Adrian Colyer <adrian_colyer@xxxxxxxxxx> wrote:
>  
> I just committed into the tree the outline of a solution that I started work
> on last month (this is a *long* way from finished). Take a look at the
> aspectj5rt module in CVS where you'll find the org.aspectj.lang.reflect
> package and org.aspectj.internal.lang.reflect. The basic
> notion is to introduce a new interface, AjType, which is to AspectJ's
> reflection interfaces what Class is to Java's (Class is final so we couldn't
> extend that). I've filled in the shape of the AjType interface based to on
> the precedence set by java.lang.Class in Java 5.  (Note that even classes
> get AjType equivalents in this world, since classes can have pointcuts...).
> The interfaces for ITDs, advice, pointcuts etc. (analogous to Method,
> Field,...) are not filled in yet. The size of the AjType interface should
> indicate the amount of effort that needs to go into testing this! The
> intended anchor into the AspectJ type world is via
> AjTypeSystem.getAjType(Class forClass). So you'd write something like this: 
>  
> AjType aspectType = AjTypeSystem.getAjType(MyAspect.class); 
> Pointcut[] pointcuts = aspectType.getDeclaredPointcuts(); 
> etc. 
>  
> Patches that start to flesh out the interfaces with the stuff you need, and
> especially patches that contribute test cases would be very welcome. We need
> to figure out how to make more of the aspect members runtime visible so that
> the API can be implemented (pointcuts for example are not currently - unless
> you use @AspectJ style and we decide to make the Pointcut annotation runtime
> visible...). A lot of that work will have to happen in ajdt.core and
> probably needs some committer time to get started - which realistically
> means M4 timeframe I suspect. Fitting your current implementation behind the
> interfaces and checking that they meet your needs would be a good way to get
> started in the meantime... 
>  
> Cheers, A. 
>  
> -- Adrian
>  Adrian_Colyer@xxxxxxxxxx 
>  
>  
>  
>  Russell Miles <russellmiles@xxxxxxx> 
> Sent by: aspectj-dev-bounces@xxxxxxxxxxx 
> 
> 14/04/2005 16:21 
>  
> Please respond to
>  AspectJ developer discussions <aspectj-dev@xxxxxxxxxxx> 
>  
>  
> To AspectJ developer discussions <aspectj-dev@xxxxxxxxxxx> 
>  
> cc 
>  
> Subject Re: [aspectj-dev] AspectJ reflect API 
>  
>  
>  
>  
>  
> Hi Mac,
>  
>  You might find that the reflection extensions that I've built into aUnit's
> framework (org.aspectj.aunit.framework.reflect.Aspect and
> org.aspectj.aunit.framework.reflect.Advice) might give you
> some of what you need. What it doesn't already have I'd be happy to work on
> with you as pointcut information would be really useful to aUnit - the
> problem with providing runtime reflective information on pointcuts is that
> (as far as I can find) that information is not retained after compile and
> weave.
>  
>  aUnit's source is available from www.aunit.org, follow the SourceForge
> project link at the top of the page (I'm in the process now of adding direct
> links from the homepage)
>  
>  Cheers,
>  
>  Russ
>  
>  On Thursday, April 14, 2005, at 03:18PM, Mac <mac@xxxxxxxx> wrote:
>  
>  >Hi,
>  >
>  >I'am currently working on aspectJ5 Unit Testing framework. I need an
> AspectJ
>  >reflect API or something like :
>  >                 org.aspectj.lang.reflect.Aspect with getAdvice() and
> getPointcut()  methods
>  >and all the inherited Class features.
>  >
>  >Are you planning to provide it ? I f not, any opinions are welcome.
>  >
>  >Thanks
>  >
>  >MAC
>  >_______________________________________________
>  >aspectj-dev mailing list
>  >aspectj-dev@xxxxxxxxxxx
>  >https://dev.eclipse.org/mailman/listinfo/aspectj-dev
>  >
>  >
>  _______________________________________________
>  aspectj-dev mailing list
>  aspectj-dev@xxxxxxxxxxx
>  https://dev.eclipse.org/mailman/listinfo/aspectj-dev
>  
>  
> _______________________________________________
> aspectj-dev mailing list
> aspectj-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-dev
> 
> 
>


Back to the top