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.

Thread pools<br />

The following code snippet shows how to deploy the custom MBean.<br />

javax.naming.Context context = new javax.naming.InitialContext();<br />

<strong>server</strong> = (MBeanServer)context.lookup("java:comp/env/jmx/MBeanServer");<br />

// Create an ObjectName for the MBean<br />

ObjectName name =<br />

new ObjectName("qa:mbeanName=helloworld,mbeanType=Standard");<br />

com.borland.enterprise.qa.mbeans.helloworld.HelloWorld hello =<br />

new com.borland.enterprise.qa.mbeans.helloworld.HelloWorld();<br />

<strong>server</strong>.registerMBean(hello,name);<br />

// Invoke a method on it<br />

<strong>server</strong>.invoke(name, "reloadConfiguration", new Object[0], new String[0]);<br />

// Get an attribute value<br />

Integer times = (Integer)<strong>server</strong>.getAttribute(name, "HowManyTimes");<br />

Locating the JMX agent<br />

If you are unsure whether the JMX agent is running, use one of the following methods<br />

to locate it.<br />

■<br />

■<br />

Use osfind.<br />

To achieve uniqueness, the name of the JmxAgent running inside a Partition is<br />

derived as follows:<br />

___JmxAgent<br />

For example, a Partition with the following specs for each of the components:<br />

___JmxAgent<br />

will be registered with the following name in osagent:<br />

ojms_RKHAWAJA2_openjms_JmxAgent<br />

will show the following output on running osfind:<br />

prompt% set OSAGENT_PORT=<br />

prompt% osfind<br />

osfind: Following are the list of Implementations started manually.<br />

HOST: 172.20.20.53<br />

REPOSITORY ID:<br />

RMI:javax.management.remote.rmi.RMIServer:0000000000000000<br />

OBJECT NAME: ojms_RKHAWAJA2_openjms_JmxAgent<br />

Use the <strong>Borland</strong> Management Console.<br />

When you right-click on the Partition, and choose Launch JMX Console, the feature<br />

will only work if the JMX Agent is properly configured for the Partition and the<br />

Partition is running.<br />

Thread pools<br />

Default thread pool<br />

A Partition can process multiple concurrent application requests using Visibroker<br />

thread and connection management. Threads are assigned to process application<br />

requests from a thread pool configured through an entity called a <strong>server</strong> engine.<br />

Several <strong>server</strong> engines, and hence thread pool configurations, are available in<br />

Visibroker. By default, a Partition uses a thread pool for <strong>server</strong> engine IIOP.<br />

Chapter 3: Partitions 25

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

Saved successfully!

Ooh no, something went wrong!