All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----com.sun.jaw.impl.agent.services.jawdiscovery.DiscoveryMonitor
DiscoveryMonitor class implements the m-bean that
listens for registering and deregistering information sent by
DiscoveryResponder objects on a given multicast group.
Any agent that is to use multicast discovery must have a
DiscoveryResponder registered in its framework.
When a DiscoveryResponder is registered with or deregistered
from a framework, it informs the rest of the multicast group by sending
a multicast message. The format of this message is not exposed.
Whenever a DiscoveryMonitor receives a registration or
deregistration message, it sends a DiscoveryResponderEvent
to its event listener.
A DiscoveryMonitor can be instantiated either in stand alone
mode (Client side) or added to an agent. In the first case, the client should
call the appropriate constructor to initialize the multicastGroup
and multicastPort
parameters. When a DiscoveryMonitor is added to a Java DMK agent,
it uses the group and port specified by the properties multicastGroup
and multicastPort.
The default values for the group and the port are 224.224.224.224 and
9000. These values can be changed when the DiscoveryResponder is registered
with the framework by specifying the group and port
keys in the ObjectName.
For instance if you want to register a DiscoveryMonitor which uses
the group 224.224.224.222 and port 4404, use the following object name:
domain:com.sun.jaw.impl.agent.services.jawdiscovery.DiscoveryResponder.group=224.224.224.222,port=4404DiscoveryMonitor can be stopped by calling the
performStop method. When it is stopped, the
DiscoveryMonitor no longer listens for registering and
deregistering messages from DiscoveryResponder objects.
A DiscoveryMonitorcan be restarted by invoking the
performStart method.
A DiscoveryMonitor has a state property which reflects its
activity.
| DiscoveryMonitor | State |
|---|---|
running | ONLINE |
stopped | OFFLINE |
stopping | STOPPING |
The transition between ONLINE and OFFLINE may not
be immediate. The DiscoveryMonitor may need some time to finish
or interrupt the active requests. During this time the state of the
DiscoveryMonitor is STOPPING.
When a DiscoveryMonitor is added to a Java DMK agent, it is automatically started.
When a DiscoveryMonitor is removed from a Java DMK agent, it is automatically stopped.
DiscoveryResponderListener events.
DiscoveryMonitor.
DiscoveryMonitor in string form.
DiscoveryResponder objects registering/deregistering.
DiscoveryMonitor.
public static final int ONLINE
public static final int OFFLINE
public static final int STOPPING
public DiscoveryMonitor() throws IOException
DiscoveryResponder
objects registering or deregistering.
The default group (224.224.224.224) and port (9000) are used.
public void initCmf(Framework cmf,
ObjectName name,
boolean db,
ModificationList list) throws IllegalAccessException, ServiceNotFoundException, InstanceAlreadyExistException
public void deleteCmf() throws InstanceNotFoundException, IllegalAccessException, ServiceNotFoundException
public void performStart()
DiscoveryResponder objects registering/deregistering.
This method has no effect if the DiscoveryMonitor is ONLINE or
STOPPING.
public void performStop()
DiscoveryMonitor.
This method has no effect if the monitor is OFFLINE or
STOPPING.
public synchronized void addDiscoveryResponderListener(DiscoveryResponderListener x)
DiscoveryResponderListener events.
The method is compliant with the Bean design pattern.
x - The listener to add.
public synchronized void removeDiscoveryResponderListener(DiscoveryResponderListener x)
x - The listener to remove.
public void deliverEvent(DiscoveryResponderEvent event)
public String getClassVersion()
public Integer getState()
DiscoveryMonitor.
ONLINE,OFFLINE or STOPPING.
public String getStateString()
DiscoveryMonitor in string form.
public String getMulticastGroup()
public void setMulticastGroup(String multicastGroup)
public int getMulticastPort()
public void setMulticastPort(int multicastPort)
All Packages Class Hierarchy This Package Previous Next Index