Custom MBeans are registered in the PlatformMBeanServer returned by the java.lang.management.ManagementFactory.getPlatformMBeanServer() method. This MBeanServer is associated with a standard JMX connector server.
You can use any JMX connector to look up MBeans in this MBeanServer just as you would any other MBeanServer. If your JMX connector is remote, you can connect to this MBeanServer using the following information:
Host name of the Enterprise Server machine
MBeanServer port, which is 8686 by default
Administrator username
Administrator password
For example, if you use JConsole, you can enter this information under the Remote tab. JConsole is a generic JMX connector you can use to look up and manage MBeans. For more information about JConsole, see http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html, the JMX tutorial at http://java.sun.com/javase/6/docs/technotes/guides/jmx/tutorial/tutorialTOC.html, and Using JConsole in Sun GlassFish Enterprise Server v2.1.1 Administration Guide.
The connection to this MBeanServer is non-SSL by default for the developer profile and SSL by default for the cluster profile.
If SSL is enabled, you must provide the location of the truststore that contains the server certificate that the JMX connector should trust. For example, if you are using JConsole, you supply this location at the command line as follows:
jconsole -J-Djavax.net.ssl.trustStore=home-directory/.asadmintruststore |
Look up the MBean by its name. By default, the name is the same as the implementation class.
You can reconfigure the JMX connector server's naming service port in one of the following ways:
In the Admin Console, open the Admin Service component under the relevant configuration, select the system subcomponent, edit the Port field, and select Save. For details, click the Help button in the Admin Console.
Use the asadmin set command as in the following example:
asadmin set --user adminuser server1.admin-service.jmx-connector.system.port=8687 |
For details, see the Sun GlassFish Enterprise Server v2.1.1 Reference Manual.