OSMQ
v2.0.1

osmq.net
Class DiscoveryServer

java.lang.Object
  extended byosmq.util.Threaded
      extended byosmq.mcns.MCResponder
          extended byosmq.net.DiscoveryServer
All Implemented Interfaces:
java.lang.Runnable

public class DiscoveryServer
extends MCResponder

An aggregate class of ServerSocket.class. MCNSServer is a seperately threaded class that answers name service requests from client applications. MCNSServer listens for discovery inquiry datagrams on a published address /port and responds if the request is for the service provided by the ServerSocket instance.


Field Summary
 
Fields inherited from class osmq.mcns.MCResponder
buf
 
Fields inherited from class osmq.util.Threaded
HIGH_PRIORITY, HIGHEST_PRIORITY, INCREASED_PRIORITY, VERY_HIGH_PRIORITY
 
Method Summary
 void addStateEventListener(StateEventListener l)
           
static DiscoveryServer createAndStart(java.lang.Object caller, RemoteService rs, int _ttl)
           
static DiscoveryServer createAndStart(java.lang.Object caller, java.lang.String servername, int portaddress, boolean binarymode, int _ttl)
           
static DiscoveryServer createAServer(ExceptionListener listener)
           
 int getPortID()
           
 java.lang.String getServiceID()
           
 java.lang.String onRequest(java.lang.String passed)
          If passed string is my service name , return a string containing my service name and IP address.
 void removeStateEventListener(StateEventListener l)
           
 void start(java.lang.String servicename, int portaddress, boolean binarymode)
           
 
Methods inherited from class osmq.mcns.MCResponder
getChannel, getDottedGroupAddress, getTimeToLive, isActive, setChannel, setDottedGroupAddress, setTimeToLive
 
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

start

public void start(java.lang.String servicename,
                  int portaddress,
                  boolean binarymode)
           throws java.io.IOException
Throws:
java.io.IOException

createAServer

public static DiscoveryServer createAServer(ExceptionListener listener)

createAndStart

public static DiscoveryServer createAndStart(java.lang.Object caller,
                                             java.lang.String servername,
                                             int portaddress,
                                             boolean binarymode,
                                             int _ttl)
                                      throws java.io.IOException
Throws:
java.io.IOException

createAndStart

public static DiscoveryServer createAndStart(java.lang.Object caller,
                                             RemoteService rs,
                                             int _ttl)
                                      throws java.io.IOException
Throws:
java.io.IOException

addStateEventListener

public void addStateEventListener(StateEventListener l)

removeStateEventListener

public void removeStateEventListener(StateEventListener l)

getPortID

public int getPortID()

getServiceID

public java.lang.String getServiceID()

onRequest

public java.lang.String onRequest(java.lang.String passed)
If passed string is my service name , return a string containing my service name and IP address. Nomatch return null, resulting in nothing being returned to the requestor process.


(c) 2000 - 2003 MQue Systems
All Rights Reserved