Service Convenience Methods; Jmx - Adobe 38000382 - Macromedia JRun - Mac Manual

Jrun sdk guide
Table of Contents

Advertisement

Service convenience methods

For all services that extend
jrunx.kernel.ServicePartition
accessing other running services, including the following methods:
Object lookup(String serviceName)
lookup in the JMX namespace, which has the general format of
java:comp/jrun/jrun_server/domainname/servicename. When called, the
method first searches for the service in the current partition (if one exists), and then
searches for the service in the default partition. For example, if the current service is
part of the ejb partition in the default server, and the following is called:
SchedulerService scheduler = (SchedulerService) lookup("SchedulerService");
the
If a service is not bound at that location,
java:comp/jrun/default/SchedulerService. If no service is found,
javax.management.ObjectInstance findObjectInstance(String
serviceName)
server. Like the
the service in the current partition (if one exists), and then searches for the service in
the default partition. After an
methods that are exposed through its
shows:
...
// Get the scheduler
javax.management.ObjectInstance oi = findObjectInstance("SchedulerService");
if (oi != null)
{
}
...
Note: The convenience method, invokeMethod, is a wrapper around the MBeanServer
invoke method.

JMX

The JMX specification prohibits users from directly referencing services by type. Instead,
services return
methods through the MBeanServer. For details, see the JMX specification.
Typically, custom services use either JNDI or convenience methods, as described in
"Creating services" on page
90
Chapter 8 JRun Services
jrunx.kernel.ServiceAdapter
method will first search for java:comp/jrun/default/ejb/SchedulerService.
lookup
use this method for finding other running JMX services in the
method, the
lookup
try
{
// Invoke the scheduler
Object[] params = new Object[] { this, new Long(interval) };
String[] types = new String[] { "java.lang.Runnable", "long" };
invokeMethod(oi.getObjectName(), "scheduleFromNow", params, types);
}
catch (Exception ex)
{
debug(ex);
}
ObjectInstance
82.
), there are a series of convenience methods for
use this method for performing a JNDI
then searches for
lookup
findObjectInstance
is found it can be used to invoke
ObjectInstance
interface, as the following example
MBean
and
objects that are used to invoke service
ObjectName
(including
lookup
returns null.
lookup
method first searches for

Advertisement

Table of Contents
loading

This manual is also suitable for:

Macromedia jrun 4

Table of Contents