[jboss-user] [JBoss AOP] - AOP proxy, do I lose method annotation information?

genman do-not-reply at jboss.com
Fri Jul 27 01:49:36 EDT 2007


I have a class that's deployed in JBoss Microcontainer, e.g.


  | @Configured
  | public class Person {
  | 	
  | 	/**
  | 	 * Sets poem.
  | 	 */
  | 	@Property(name="poetry", description="poetry, oh noetry!")
  | 	public void setPoem(String poem) {
  | 		this.poem = poem;
  | 	}
  | 

I apply an install aspect:

  |   <aop:lifecycle-configure xmlns:aop="urn:jboss:aop-beans:1.0" name="InstallConfiguredCallback"
  |     class="...InstallConfiguredCallback"
  |     classes="@...Configured">
  |     <depends>AspectManager</depends>
  |     <property name="configurator">
  |       <inject name="Configurator"/>
  |     </property>
  |   </aop:lifecycle-configure>
  | 
  |   <bean name="Joe" class="...Person"/>
  | 
  | 

But then, inside my "Callback", I see the proxied class:

  | public class InstallConfiguredCallback{
  | 	
  | 	public void install(ControllerContext ctx){
  | 		Object target = ctx.getTarget();
  | 
  | 

Here, 
target.getClass().getMethod("setPoem").getAnnotation(Property.class) returns null. It seems the class was changed to an AOP proxy, do I lose my method-level annotations when this happens?

This is JBoss AOP 2.0 - snapshot ...

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4068087#4068087

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4068087



More information about the jboss-user mailing list