Here's an example using $instanceof{...}:
<pointcut
| name="ClearTrackingAfterThis"
| expr="execution(public $instanceof{*.ITrackedObject}->new(..))"/>
|
| <bind pointcut="ClearTrackingAfterThis">
| <interceptor class="Foo"/>
| </bind>
My intention is to run interceptor Foo for each call of all constructors of all
classes that implement ITrackedObject. This does not match anything.
I change:
execution(public $instanceof{*.ITrackedObject}->new(..))
to:
execution(public $instanceof{*.Address}->new(..))
And the pointcut matches. (Address implements ITrackedObject via an
introduction.)
When I use $instanceof{...} with set, as in this example:
<pointcut
| name="SetImplementorFields"
| expr="set(* $instanceof{*.ITrackedObject}->*)"/>
|
| <bind pointcut="SetImplementorFields">
| <interceptor class="com.valtech.cflowalternative_1.SetInterceptor">
| </bind>
Everything works as I expect. All implementers (in this case Address) have all
of their attributes intercepted on a set.
So in the first case, $instanceof{...} does NOT match derived constructors
whereas in the second example it DOES match derived sets.
I suspect this is similar to the problem with $instanceof{...} not working with
cflow, but maybe I just don't get it.
Do you? If so, please give me a clue.
Thanks!
Brett
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3940571#3940571
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3940571
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user