jmx-dev 8038343: Eliminate use of reflection to access JavaBeans Introspector

Alan Bateman Alan.Bateman at oracle.com
Tue Mar 25 19:04:49 UTC 2014


Currently the introspection code in the JMX monitor API uses core 
reflection to access the JavaBeans Introspector. This came about when we 
had to eliminate this dependency - for example in the subset Profiles of 
Java SE then compact3 defines the JMX API but doesn't have java.beans.

I'd like to clean this up further and replace the reflection hack with a 
solution that uses the SharedSecrets mechanism. The reason is to avoid 
needing to suppress the access check when we move to modules in the 
future. The webrev with the proposed changes is here:

http://cr.openjdk.java.net/~alanb/8038343/webrev/

The changes are very simple and the only non-obvious thing is that the 
JMX introspector needs to ensure that the beans Introspector is 
initialized so this is the reason for the Class.forName. I've tried a 
number of other approaches to this but this one seems to simplest.

Thanks,

Alan.


More information about the jmx-dev mailing list