OSMQ
v2.0.1

osmq.pulsar
Class ServicePulsar

java.lang.Object
  extended byosmq.util.Threaded
      extended byosmq.pulsar.ServicePulsar
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
HeartbeatTransmitter, ServiceAlertTransmitter

public class ServicePulsar
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

Field Summary
 
Fields inherited from class osmq.util.Threaded
HIGH_PRIORITY, HIGHEST_PRIORITY, INCREASED_PRIORITY, VERY_HIGH_PRIORITY
 
Method Summary
 java.lang.String getGroupAddress()
           
 DataRecord getRecord()
           
 java.lang.String getServiceName()
           
 int getServicePort()
           
 boolean isDiscovery()
           
 boolean isHeartbeat()
           
 void setDiscovery(boolean v)
           
 void setGroupAddress(java.lang.String a)
           
 void setHeartbeat(boolean v)
           
 void setServiceName(java.lang.String s)
           
 void setServicePort(int p)
           
 
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
 

Method Detail

setHeartbeat

public void setHeartbeat(boolean v)

isHeartbeat

public boolean isHeartbeat()

setDiscovery

public void setDiscovery(boolean v)

isDiscovery

public boolean isDiscovery()

setServicePort

public void setServicePort(int p)

getServicePort

public int getServicePort()

setGroupAddress

public void setGroupAddress(java.lang.String a)

getGroupAddress

public java.lang.String getGroupAddress()

setServiceName

public void setServiceName(java.lang.String s)

getServiceName

public java.lang.String getServiceName()

getRecord

public DataRecord getRecord()

(c) 2000 - 2003 MQue Systems
All Rights Reserved