Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Params to Aspects?


I have a family of aspects that are all identical except for an
"internal" name I want to uniquely assign to each aspect instance.
Rather than write one aspect class for each, I'd like to reuse one class
for all. So what I would like to do is something like this:

    <concrete-aspect name="$$Aspect"
      <pointcut name="scope" expression="execution(public *
	<param name="id" value="hello"/>  <<<<<<  THIS
extends="">  <<<< OR THIS
      <pointcut name="scope" expression="execution(public *
    <include within="*"/>

In the above "hello world" example, the aspect would
"System.out.println(id);", or some such.

Is this sort of thing possible?

Alternatively, can one pass in a constructor argument to the named
concrete aspect from the XML definition?

Or, can one pass in arguments to the "scope" method that is generated?

Thanks in advance,


Back to the top