This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 237919 - Support instrumentation modules - a way for one module to patch bytecode of others
Summary: Support instrumentation modules - a way for one module to patch bytecode of o...
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 8.0
Hardware: PC Linux
: P1 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: API_REVIEW_FAST
Depends on:
Blocks:
 
Reported: 2013-11-03 12:51 UTC by Jaroslav Tulach
Modified: 2013-11-14 19:53 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2013-11-03 12:51:52 UTC
JDK5 came with generic support for instrumentation: 
http://docs.oracle.com/javase/7/docs/api/java/lang/instrument/package-summary.html
it however requires changes to the way one invokes Java.

NetBeans Platform also needs such kind of patching from time to time, yet it would be better to do it in a modular way. E.g. be able to define a module which can provide transformation behavior which would then be applied to other loaded classes.
Comment 1 Jaroslav Tulach 2013-11-03 12:52:51 UTC
It would be nice to reuse the API already defined by java.lang.instrument package.
Comment 2 Jaroslav Tulach 2013-11-03 13:00:19 UTC
Basic implementation:
http://hg.netbeans.org/ergonomics/rev/1ab79c331145

Y01 Need support for OSGi in Equinox mode

Y02 Need documentation and a use-case description in arch.xml
Comment 3 Jaroslav Tulach 2013-11-03 18:18:31 UTC
Re. Y01: Netbinox now supported: http://hg.netbeans.org/ergonomics/rev/1809b61e5c46
Comment 4 Jaroslav Tulach 2013-11-06 14:17:58 UTC
Intended usage can be seen in following OSGi bundles:
http://source.apidesign.org/hg/html~html4j/rev/86aabecda7a3
one of them defined Agent-Class and hopes that every module/bundle that depends on it will be processed by its JsAgent class.
Comment 5 Jaroslav Tulach 2013-11-13 14:48:13 UTC
I fixed the documentation. Unless there are objections I integrate tomorrow:
http://hg.netbeans.org/ergonomics/rev/b55a0cbcfa6c
Comment 6 Jaroslav Tulach 2013-11-14 19:53:57 UTC
Merged as 6869874b14af to core-main.