osmq.pulsar
Class DynamicPulsar
java.lang.Object
osmq.util.Threaded
osmq.pulsar.DynamicPulsar
- All Implemented Interfaces:
- java.lang.Runnable
- public class DynamicPulsar
- extends Threaded
MCNS (multicast Name Service)
MulticastPulsar uses an ip multicast channel to repeatedly broadcast a service name, ip adddress and port
at a fixed time frequency. This feature permits the discovery of a service without having to maintain
that information on an NIS or DNS table, and further provides the advantage of not requiring that a
service be tied to a specific server. (Useful for implementing redundant hot backup servers).
Another use of the pulsar is to identify whether a service has failed. For example, after a client
discovers and attaches to a service, it can listen to the multicast port for the continued broadcast
and take appropriate action if and when the broadcast of that service is no longer heard.
Similarly, in the event of a server failure, the broadcast channel can be used by a backup server
to broadcast a changed ip address / port combination for the service.
Reciprocal classes include
1) DiscoveryServer -- a service class that performs the function of a name server of MulticastPulsars.
Clients pass the name of a sercie to the DiscoveryServer and are returned the
current ip address port number for that service.
It logs
all active service pulsars and acts as a centralized lookup for clients, and
2) the ServicePulsarMonitor class which a client uses to monitor the that a service
remains alive during an active session.
- See Also:
DiscoveryServer
Methods inherited from class osmq.util.Threaded |
getExceptionListener, getIterations, getPriority, getSequenceNumber, getUserDefinedName, getYieldToPeers, hasTerminated, isPaused, isRunning, isShutdownCompleted, killAll, killAllInGroup, run, setExceptionListener, setPaused, setPriority, setUserDefinedName, setYieldCount, shutdownRequested, sleepSecs, sleepTenths, start, stop, successfulInit |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DynamicPulsar
public DynamicPulsar(StringGenerator sg)
DynamicPulsar
public DynamicPulsar(DataRecordGenerator dsg)
setDelayInSeconds
public void setDelayInSeconds(int secs)
getDelayInSeconds
public int getDelayInSeconds()
setHeartbeat
public void setHeartbeat(boolean v)
isHeartbeat
public boolean isHeartbeat()
setDiscovery
public void setDiscovery(boolean v)
isDiscovery
public boolean isDiscovery()
setServiceChannel
public void setServiceChannel(int p)
getServiceChannel
public int getServiceChannel()
setGroupAddress
public void setGroupAddress(java.lang.String a)
getGroupAddress
public java.lang.String getGroupAddress()
setGenerator
public void setGenerator(StringGenerator sg)
getGenerator
public StringGenerator getGenerator()