Community
Participate
Working Groups
This enhancement request is for JPA SE clients (not running on an application server) that wish to have runtime services JMX MBeans enabled and available via standard SE JConsole. Constraints: ----------- 1) How to register MBeans in Java SE? On the server we use a JNDI lookup to find the servers' implementation of MBeanServer - we don't have JNDI out of the box in SE. In SE we use the JMX bootstrap class and call ManagementFactory.getPlatformMBeanServer(); to get the MBeanServer. We then do the same type of registerMBean(mbean, name) call. 2) Subclass NoServerPlatform, CustomServerPlatform or a new platform off of the abstract ServerPlatformBase? I think we are ok expanding NoServerPlatform - see 3 and 4 After a discussion with Tom. 3) Code must be Java 5 compatible - yes (MBeanServer and ManagementFactory) have been in the JRE since 1.5 http://java.sun.com/j2se/1.5.0/docs/guide/management/mxbeans.html http://java.sun.com/j2se/1.5.0/docs/api/java/lang/management/ManagementFactory.html 4) Are we ok placing the SE functionality in NoServerPlatform as opposed to creating a configurable Java_SE_Platform subclass - yes The NoServerPlatform implementation is the default platform for all other platforms in the DatabaseSessionImpl constructor, later the actual platform for the server or NoServerPlatform in the case of an SE application is instantiated second. Therefore as long as any extended functionality is outside the constructor and static methods we are ok. 5) By default would any JMX functionality be instantiated out of the box? No, the user will need to run with the following flags set, one to enable visibility in JConsole and the other to enable MBean registration/unregistration as well as optional orm properties. -Dcom.sun.management.jmxremote -Declipselink.register.run.mbean=true Prototype: ---------- See the attached screencapture of a prototype Java SE registration of the runtime services mbean for the SE DDL generation example app used to populate the database for the server example at... http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/examples/org.eclipse.persistence.example.jpa.server.common.ddlgen/src/org/eclipse/persistence/example/jpa/server/common/DDLGenerationClient.java If you put a breakpoint anywhere in generateGlider() so that the SE process holds the JVM up in eclipse after platform registration - you will see the mbean for the session by running JConsole on this process. See related work in bug# 248748
Created attachment 126211 [details] Prototype Java SE JMX Runtime Services MBean in JConsole
>For constraint 1 Details on Java SE MBeanServer creation via bootstrap ManagementFactory http://java.sun.com/javase/6/docs/technotes/guides/jmx/tutorial/essential.html#wp1054889 See JEE to JSE migration issues http://java.sun.com/javase/technologies/core/mntr-mgmt/javamanagement/jmx-1.2-errata.jsp
Created attachment 126336 [details] Very rough proof of concept prototype for Java SE MBeans This version of NoServerPlatform.java needs to have it's own version of the runtime server MBean, for now I have use the MBean instantiated by WebLogic. The code needs a full cleanup and removal of any weblogic imports. Currently if you drop in this code and configure your JVM for remote MBeans you will see MBeans on your sessions while you are running or if the JVM is halted in debug mode. When we require this change in the future - this prototype will be fully reworked and/or discarded.
>Requested as well by PMO and the user vote above >now that the JMX MBean API has been moved up into JMXServerPlatformBase - we can revisit SE JMX support - we will likely make NoServerPlatform subclass the new JMX abstract class and implement JMXEnabledPlatform - this work should commence once bug# 316513 is fully implemented - as of SVN rev# 7777 the infrastructure is in place
>Upping priority to P2 - I would like to get this done just after 2.1.1 since the EE server refactor is now complete
Deferring to Future, as part of 2.2 bug scrub.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink