From: <kab...@jb...> - 2005-05-18 16:33:31
|
The class should contain both a method called "berechneFakten" as well as a method called "wilken$informationssystem$berechtigung$BerichtBearbeitenBerechtigungImpl$getId$aop". The one with the long name will contain the original method, while the method with the short name wil contain the hooks for AOP. For the class I pasted in above, following instrumentation, this should look something like: | package wilken.informationssystem.berechtigung; | | public class BerichtBearbeitenBerechtigungImpl implements Advised | { | //Advisor fields get added | Advisor _advisor = ...; | InstanceAdvisor _instanceAdvisor = ...; | public Advisor _getAdvisor(){return _advisor;} | public InstanceAdvisor _getAdvisor(){return _instanceAdvisor;} | | //Introduced method contains the contents of original method | public int wilken$informationssystem$berechtigung$BerichtBearbeitenBerechtigungImpl$getId$aop() | { | return 2938; | } | | //The original method with your name with the hooks for AOP to happen | public int getId() | { | if (aop$MethodInfo_getId_N_6040770469254561000.interceptors != (Object[])null || (_instanceAdvisor != null && _instanceAdvisor.hasInstanceAspects)) | { | //Create invocation and invoke on it | ... | return invocation.invokeNext(); | } | else | { | return wilken$informationssystem$berechtigung$BerichtBearbeitenBerechtigungImpl$getId$aop | (); | } | | } | If you look at org.jboss.aop.instrument.MethodExecutionTransformer.optimized() you should see that the extra method is created first? Can you please post some more information about what exactly you are doing? It sounds like it works for you "most of the time", what is different when it goes wrong? View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3878244#3878244 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3878244 |