-
1. Re: aop < introduction > and point cut parameters question
bill.burke Mar 24, 2005 3:07 PM (in response to mikeg123)1) You can just introduce an interface. What will happen is that if the method already exist JBoss AOP will do nothing. If it doesn't exist, then it will implement the method and hope that a specific advice/interceptor will provide an implementation for the method.
<introduction class="org.acme.MyClass"> <interfaces>java.io.Serializable</interfaces> </introduction>
2) If you want this in jboss, please enter in a feature request at jira.jboss.com. We do not support this at this time. -
2. Re: aop < introduction > and point cut parameters question
mikeg123 Mar 24, 2005 4:06 PM (in response to mikeg123)Thanks,
1. it would not really work in my case because I have a bunch of Hibernate Data objects and I want them to have something like
toMyString() method, so that in my Aspect at runtime I can cast param to that interface and get a nice description, so it's more of a way to force developers to provide toMyString method, otherwise if someone forgets to do it, at runtime I'll get nothing informative.
Thanks Michael -
3. Re: aop < introduction > and point cut parameters question
bill.burke Mar 24, 2005 4:08 PM (in response to mikeg123)Have you seen declare error, declare warning?
http://docs.jboss.org/aop/1.1/aspect-framework/reference/en/html/xml.html#xml-declare -
4. Re: aop < introduction > and point cut parameters question
mikeg123 Mar 24, 2005 4:50 PM (in response to mikeg123)Great! thanks.
one other question:
Can you intercept a field withing a specific method:
this doesn't compile:
bind pointcut="set($instanceof{com.my.mytypes.*} $instanceof{com.my.SomeClass}->add(java.lang.String))"
(or do I need to use "within"
I want to intercept write to the field within the add method of SomeClass
(by the way I suppose it's going to intercept after it's value is changed, correct?)
Thanks. -
5. Re: aop < introduction > and point cut parameters question
bill.burke Mar 24, 2005 5:00 PM (in response to mikeg123):( add another feature request.