-
1. Re: Identification of classes intercepted by pointcuts
Fábio Costa Dec 23, 2006 1:37 PM (in response to Fábio Costa)I tried with this code;
AspectManager.instance().getAdvisors() //NOTHING Map mapBindings = AspectManager.instance().getBindings(); Iterator iBindings = mapBindings.values().iterator(); System.out.println("pointcuts:"); while (iBindings.hasNext()) { AdviceBinding bind = (AdviceBinding) iBindings.next(); System.out.println(" " + bind.getPointcut().getExpr()); ArrayList aAdvisors = bind.getAdvisors(); //NOTHING System.out.println(aAdvisors); }
-
2. Re: Identification of classes intercepted by pointcuts
Kabir Khan Dec 23, 2006 5:23 PM (in response to Fábio Costa)You can get the bindings from the aspectmanager and get the advisors from those
-
3. Re: Identification of classes intercepted by pointcuts
Kabir Khan Dec 23, 2006 5:25 PM (in response to Fábio Costa)Duh I only read your initial question!
The advisors only become populated once you load the affected classes -
4. Re: Identification of classes intercepted by pointcuts
Fábio Costa Dec 23, 2006 7:09 PM (in response to Fábio Costa)And how I load the affected classes ? I want exactly to discover the affected classes. Example:
pointcut: within($instanceof{javax.servlet.http.HttpServlet})
Affected Classes:
ServletA, ServletB, ServletC ... -
5. Re: Identification of classes intercepted by pointcuts
Flavia Rainone Dec 26, 2006 1:45 PM (in response to Fábio Costa)Hi, Fabio!
The moment a JVM loads a class may vary depending on the JVM implementation...
But, according to Java Specification, a JVM must have already loaded a class once it is actively used.
This means that, after you use a class of your interest, this class will have been loaded.
Like this:MyClass a = new MyClass();
I hope this helps! -
6. Re: Identification of classes intercepted by pointcuts
Fábio Costa Dec 26, 2006 3:09 PM (in response to Fábio Costa)This load can be made for classloader in load time weaving mode?
-
7. Re: Identification of classes intercepted by pointcuts
Flavia Rainone Dec 26, 2006 5:50 PM (in response to Fábio Costa)Exactly. JBoss AOP instruments the classes in load time, matching pointcut expressions and associating the classes to advisors, if you are using load time weaving mode.
So, once the class has been loaded by the JVM, you know the pointcut matching has already occurred for that class. All loaded instrumented classes (whose one or more join points is matched by one or more pointcut) are associated to an Advisor. -
8. Re: Identification of classes intercepted by pointcuts
Fábio Costa Dec 26, 2006 7:23 PM (in response to Fábio Costa)Exists some method of jboss aop source code to make the measurement ?offline?? I am using metrics to evaluate jboss aop, but the dependence of the load of objects makes it difficult the evaluation
-
9. Re: Identification of classes intercepted by pointcuts
Flavia Rainone Dec 27, 2006 1:56 PM (in response to Fábio Costa)No, there isn't a jboss aop method to measure the time.
What you can do is, first, load all classes. Then, measure the time it takes to execute intercepted join points. After that, run the same code without jboss aop... so you can compare the time it takes to execute the same join points without interception. -
10. Re: Identification of classes intercepted by pointcuts
Paolo Confessore Dec 28, 2006 6:10 AM (in response to Fábio Costa)Could you tell me the name of the method or the class where it is declared?
Thanks -
11. Re: Identification of classes intercepted by pointcuts
Fábio Costa Dec 28, 2006 11:04 AM (in response to Fábio Costa)Ok,
I go to look some technique to load all the classes -
12. Re: Identification of classes intercepted by pointcuts
Flavia Rainone Dec 29, 2006 6:45 PM (in response to Fábio Costa)Hi, Robotics80!
Sorry, but we discussed so many subjects on this thread that I don't know which declaration you're talking about.
Please, let me know so I can answer your question.
Thank's!