12.11.2014 Views

web server - Borland Technical Publications

web server - Borland Technical Publications

web server - Borland Technical Publications

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

JMX support in Partitions<br />

Figure 3.2<br />

Partition MBeans<br />

The MBeans are available only if you enable the JMX feature in the Performance<br />

Tuning wizard. See Chapter 2, “Using Partitions” for information on how to enable the<br />

JMX feature. The level of information that is provided in the MBeans depends on the<br />

statistics level you set in the Performance Tuning Wizard. Complete JSR-77 statistics<br />

will be available only if you select the statistics level as “maximum”. You will get only a<br />

subset of the JSR-77 statistics if you select “medium” or “minimum”.<br />

Deploying custom MBeans<br />

To deploy custom MBeans:<br />

1 Decide where to initialize your MBeans (possible places include a servlet or Startup<br />

class).<br />

2 Add the JNDI lookup code to locate the MBeanServer.<br />

There is currently no standard way for the application to locate the JMX agent<br />

(<strong>server</strong>) in an application <strong>server</strong> infrastructure. So, what you should do is follow the<br />

model that is similar to the J2EE approach of looking up the ORB, UserTransaction,<br />

etc. that is shown in the code snippet below.<br />

Note that JMX agent is a <strong>server</strong> side feature, and the lookup operation in the client<br />

VM will not be able to find a pointer to the <strong>server</strong> instance as the <strong>server</strong> is only<br />

initialized in the <strong>server</strong> VM. A client will need to use the RMI-IIOP connection to<br />

connect to a remote JMX agent.<br />

3 Register the MBeans.<br />

Once the MBean <strong>server</strong> is located, the registration step is just a normal process.<br />

Note that your MBeans have to be in the classpath when you are doing these steps.<br />

Also note that depending upon where you end up having your JMX code, you may<br />

want to clean up your MBeans (unregister them) when your module is unloaded. For<br />

example if your MBeans were registered in the Startup class, you may want to<br />

unregister your MBeans in a Shutdown class.<br />

24 BES Developer’s Guide

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!