Good morning,
I have an interesting problem that I am trying to get around.
First of all I am using ExtJS and DirectJngine for my UI components.
DirectJngine dynamic discovers the classes in my hierarchy that implement a certain interface and then discovers the methods that make up part of the external API by iterating over the methods and searching for the correct annotation (see example)
this results in an API file that is created and published to the JavaScript UI component library for the AJAX calls.Code:@DirectMethod public Collection<GrantedAuthority> getGrantedAuthorities( ) {
It is when I try to create an AOP proxy for the target class that I run into problems in that the proxy does not know about the annotations and thus the API for the proxied class is empty.
Additionally, when I iterate through my classes to dynamically generate the JS API, I am getting the name of the dynamic proxy (i.e. "$Proxy9") instead of the target class, which also breaks my API.
Finally here is the real question(s):
Given a proxy class (class object not instance) is there a way to determine 1) that it is a proxy and 2) how do I get the target class for that proxy.
AOPUtils does not seem to help here since it does not like class proxy objects but instances - additionally, given the proxy class I get an instationationexception if I try to create the proxy object using the newInstance method.
If I had this information I could intercept the creation of the API, interrogate the target class for the API based upon the annotations and swap in the appropriate names for the API, the remaining should continue to work.
Alternatively, is there a way to get a proxy class to also recognize the annotations on the target class.
I know that this may be a little hard to follow but hopefully someone can assist me here.
Thanks in advance.
Whatty


Reply With Quote
