Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] declare @method syntax - is composite signature allowed??

I have a hierarchy of DAO classes into which I'm introducing an @Cacheable annotation via something like this:

declare @method :
                public * *..I*Dao+.*(..) :
                        @Cacheable(modelId="fooModel");

The problem is, we need to filter out more than is specified by this one signature pattern, and I'm not sure that a composite pattern is allowed in this type of expression.  When I tried something like this:

declare @method :
                public * *..I*Dao+.*(..) && !public * *..I*Dao+.set*(..):
                        @Cacheable(modelId="fooModel");

I'm getting compile errors saying:

Syntax error on token "&&", ";" expected

I also tried to define composite pointcuts representing the joint points I'm interested in (basically I want to exclude 'jdbcTemplate' and 'slq' Spring specific setters from the places where annotation is introduced) but declaration syntax doesn't seem to like it either.

What would be a good approach in the use case I described?

I'm using compile time weaving via Ant.  AspectJ version is 1.6

Thank you in advance,
Simeon



Back to the top