Oracle Application Server TopLink API Reference
10g Release 2 (10.1.2)

B15903-01


oracle.toplink.remotecommand
Class DiscoveryManager

java.lang.Object
  extended byjava.lang.Thread
      extended byoracle.toplink.remotecommand.DiscoveryManager

All Implemented Interfaces:
java.lang.Runnable

public class DiscoveryManager
extends java.lang.Thread

Purpose: Detects new members of a logical TopLink cluster.

Description: Each RemoteCommandManager has its own DiscoveryManager, which handles the detection of other remote command services as they become available. The DiscoveryManager is an active object (in that it extends Thread) and becomes a separate thread when it is started using startDiscovery().

Discovery is done through the use of a multicast. Each discovery manager joins the multicast group and announces itself to the group. As it receives service announcements from other discovery managers it notifies the RCM to establish connections to and from the new service.

Since:
OracleAS TopLink 10g (9.0.4)
See Also:
RemoteCommandManager, MulticastSocket

Field Summary
static int DEFAULT_ANNOUNCEMENT_DELAY
static java.lang.String DEFAULT_MULTICAST_GROUP
Default value constants
static int DEFAULT_MULTICAST_PORT

Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY

Constructor Summary
DiscoveryManager(RemoteCommandManager mgr)
Constructors to create a discvovery manager.
DiscoveryManager(java.lang.String address, int port, int delay, RemoteCommandManager mgr)
DiscoveryManager(java.lang.String address, int port, RemoteCommandManager mgr)

Method Summary
int getAnnouncementDelay()
PUBLIC: Return the amount of time in millis that the service should wait between the time that this Remote Service is available and a session announcement is sent out to other discovery managers.
java.lang.String getMulticastGroupAddress()
PUBLIC: Return the host adddress of the multicast group.
int getMulticastPort()
PUBLIC: Return the multicast port used for discovery.
boolean isDiscoveryStopped()
ADVANCED: Return true if discovery has been stopped at the time this method is called.
void setAnnouncementDelay(int millisecondsToDelay)
PUBLIC: Set the amount of time in millis that the service should wait between the time that this Remote Service is available and a session announcement is sent out to other discovery managers.
void setMulticastGroupAddress(java.lang.String address)
PUBLIC: Set the host adddress of the multicast group.
void setMulticastPort(int port)
PUBLIC: Set the multicast port used for discovery.
void startDiscovery()
ADVANCED: Announce the local service and join the cluster
void stopDiscovery()
ADVANCED: Stop accepting announcements from other services becoming available.

Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

DEFAULT_MULTICAST_GROUP

public static final java.lang.String DEFAULT_MULTICAST_GROUP
Default value constants
See Also:
Constant Field Values

DEFAULT_MULTICAST_PORT

public static final int DEFAULT_MULTICAST_PORT
See Also:
Constant Field Values

DEFAULT_ANNOUNCEMENT_DELAY

public static final int DEFAULT_ANNOUNCEMENT_DELAY
See Also:
Constant Field Values

Constructor Detail

DiscoveryManager

public DiscoveryManager(RemoteCommandManager mgr)
Constructors to create a discvovery manager.

DiscoveryManager

public DiscoveryManager(java.lang.String address,
                        int port,
                        RemoteCommandManager mgr)

DiscoveryManager

public DiscoveryManager(java.lang.String address,
                        int port,
                        int delay,
                        RemoteCommandManager mgr)

Method Detail

startDiscovery

public void startDiscovery()
ADVANCED: Announce the local service and join the cluster

stopDiscovery

public void stopDiscovery()
ADVANCED: Stop accepting announcements from other services becoming available. Note that this does not remove the local service from the cluster.

isDiscoveryStopped

public boolean isDiscoveryStopped()
ADVANCED: Return true if discovery has been stopped at the time this method is called. If false is returned then it is undefined whether discovery is started or stopped. It may be started, or it may be in the process of starting or stopping.

setAnnouncementDelay

public void setAnnouncementDelay(int millisecondsToDelay)
PUBLIC: Set the amount of time in millis that the service should wait between the time that this Remote Service is available and a session announcement is sent out to other discovery managers. This may be needed to give some systems more time to post their connections into the naming service. Takes effect the next time listening is started.

getAnnouncementDelay

public int getAnnouncementDelay()
PUBLIC: Return the amount of time in millis that the service should wait between the time that this Remote Service is available and a session announcement is sent out to other discovery managers.

getMulticastGroupAddress

public java.lang.String getMulticastGroupAddress()
PUBLIC: Return the host adddress of the multicast group.

setMulticastGroupAddress

public void setMulticastGroupAddress(java.lang.String address)
PUBLIC: Set the host adddress of the multicast group. Takes effect the next time listening is started.

setMulticastPort

public void setMulticastPort(int port)
PUBLIC: Set the multicast port used for discovery. Takes effect the next time listening is started.

getMulticastPort

public int getMulticastPort()
PUBLIC: Return the multicast port used for discovery.

Copyright © 1998, 2005 Oracle Corporation. All Rights Reserved.