Re: Using bytecode instrumentation in application servers and frameworks
Yao Qi <[email protected]>
| Newsgroups | gmane.comp.java.objectweb.asm |
|---|---|
| Message-ID | <[email protected]> |
On Tue, May 11, 2010 at 12:08 AM, Kuperberg, Michael <[email protected]> wrote: > Hi all, > > using java.lang.instrument package, it is possible to specify an load-time > instrumentation agent for "standard" Java programs, i.e. Java SE. > > Does anybody have experience with agent-based instrumentation of Java EE > (enterprise edition) or Spring framework applications? > Yes, we had. We instrumented Java EE application on Websphere Application Server. However, we don't differentiate application classes and middleware classes. > Reusing java.lang.instrument would be an option, but the agent needs to be > configured to distinguish the application classes (that I want to > instrument) from the middleware classes (that shouln't / cannot be > instrumented). I would like to use load-time instrumentation as "the last in > the chain" agent so that BCI performed by the app server itself is covered. > We can distinguish classes by class full name. Yes, BCI performed by the app server make it complicated, for example, openjpa will enhance the code. > The Java EE specification seems not to have an own mechanism; > vendor-specific interfaces (if any) are hard to find. Does anybody have > experience/suggestions/ideas about bytecode instrumentation in scenarios > other than Java SE? > IMO, there is no general solution to this. However, our observation is that these J2EE application classes will be instrumented TWICE by agent, because agent is invoked for the first time when class is being loaded, and the agent is invoked for the 2nd time when class is being defined after BCI in app server. If our observation is correct, we can instrument J2EE classes in the 2nd time. -- Yao Qi <qiyaoltc AT gmail DOT com> GNU/Linux Developer http://duewayqi.googlepages.com/
message-footer.txt
(text/plain, 238 B)
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws