I just chatted to Steve about this and he asked me to bring it up here.
So, it seems like there is some interest to have support for Java 5
annotations in DSO and it is also happens that we can get it with low
effort by reusing expression matching from AspectWerkz.
I've added com.tctest.AnnotationTest to confirm that it works with
locks and I almost certain now that it would work for DMI methods (will
add another test for that maybe later this week).
So, it is basically need an expression like "@Ann * *..*(..)" there
@Ann is some annotation.
That allows to declare marker annotations like @ReadLock and
@WriteLock and use those in the configuration for locks
<autolock>
<method-expression>@ReadLock *..*(..)</method-expression>
<lock-level>read</lock-level>
</autolock>
<autolock>
<method-expression>@WriteLock *..*(..)</method-expression>
<lock-level>write</lock-level>
</autolock>
... other lock types that we have
I am not sure if AW expression matcher supports matching on annotation
parameters, i.e. to match on annotation like @Lock(type=Write). Jonas
would tell for sure.
I also tested include, which is working as well:
<include>
<class-expression>@Portable *</class-expression>
<honor-transient>true</honor-transient>
</include>
It would be nice to be able to specify onload scripts right in the
annotation, but that would need some support in the code that does
instrumentation.
I don't think matching on fields (i.e. transients or roots) is working
out of the box, but it shouldn't be too difficult to fix that. Then we
could add annotations on those as well.
Anyways, the next nice step would be to package all those annotations
into the config module that would have annotation classes and
prepackaged DSO configuration for them. So, user would compile his code
with module jar in order to use these annotations and then just include
annotation module in tc-config.
regards,
Eugene
_______________________________________________
tc-dev mailing list
[email protected]
http://lists.terracotta.org/mailman/listinfo/tc-dev