-
1. Re: My JavaBean Aspect
joep.wijers Aug 10, 2005 5:29 AM (in response to rmcdonough)Hi,
I am interested in applying your idea.
Only, I quickly tried the sample eclipse project on your site and found that JGoodies throws an exception; it uses reflection to check that method addPropertyChangeListener exists, and it doesn't
Maybe something is missing in the sample?
thx,
Joep -
2. Re: My JavaBean Aspect
rmcdonough Aug 11, 2005 9:18 PM (in response to rmcdonough)Joep,
If you get the exception stating that the bean does not support bound properties, then the Aspect is not being applied. When the aspect is applied, JGoodies will see that the bean does have the methods it's looking for. I design the aspect to work with the way JGoodies verifies that the bean supports bound properties.
How did you execute the example? Did you use the ant task or did you try and execute it from within Eclipse? If you're running the test class as a Java Application from within Eclipse, you'll need add a few VM params so that the aspects are applied at loadtime. You need to add:-javaagent:/path/to/jboss/jboss-aop-jdk50.jar -Djboss.aop.class.path=/path/to/compiled aspect jar or class folder
or-Djboss.aop.path=/path/to/jboss-aop.xml
Let me know if this helps any.
Ryan- -
3. Re: My JavaBean Aspect
joep.wijers Aug 12, 2005 7:07 AM (in response to rmcdonough)Hi Ryan,
Yes this helps. Thanks for waking me up ;-)
How did you execute the example? Did you use the ant task or did you try and execute it from within Eclipse? If you're running the test class as a Java Application from within Eclipse, you'll need add a few VM params so that the aspects are applied at loadtime.
I am indeed running from Eclipse.
I added these VM args and then it worked as expected:-javaagent:${project_loc}/lib/jboss-aop-jdk50.jar -Djboss.aop.path=${project_loc}/jboss-aop.xml
I like it! I am considering to applying this approach; not just for bound properties but also other generic services I may want to mix in.
Thanks,
Joep -
4. Re: My JavaBean Aspect
rmcdonough Aug 14, 2005 3:00 PM (in response to rmcdonough)Awesome! Glad it worked out for you. In hind sight, it probably took me about as much time to figure out how to create an aspect using Introductions as it would have for me to code property change support into each class. But now that it's built, I can use it on just about anything going forward. It's still got a few rough edges, but I'm wokring on 'em. Let me know if you see anything that could be changed/made better, etc.
Ryan-