org.apache.jcs.auxiliary.lateral.socket.tcp.discovery
Class UDPDiscoverySenderThread

java.lang.Object
  extended by org.apache.jcs.auxiliary.lateral.socket.tcp.discovery.UDPDiscoverySenderThread
All Implemented Interfaces:
java.lang.Runnable

public class UDPDiscoverySenderThread
extends java.lang.Object
implements java.lang.Runnable

Used to periodically broadcast our location to other caches that might be listening.


Constructor Summary
UDPDiscoverySenderThread(java.lang.String discoveryAddress, int discoveryPort, java.lang.String myHostName, int myPort, java.util.ArrayList cacheNames)
          Constructs the sender with the port to tell others to connect to.
 
Method Summary
protected  java.util.ArrayList getCacheNames()
           
 void run()
          Send a message.
protected  void setCacheNames(java.util.ArrayList cacheNames)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UDPDiscoverySenderThread

public UDPDiscoverySenderThread(java.lang.String discoveryAddress,
                                int discoveryPort,
                                java.lang.String myHostName,
                                int myPort,
                                java.util.ArrayList cacheNames)
Constructs the sender with the port to tell others to connect to.

On construction the sender will request that the other caches let it know their addresses.

Parameters:
discoveryAddress - host to broadcast to
discoveryPort - port to broadcast to
myHostName - host name we can be found at
myPort - port we are listening on
cacheNames - List of strings of the names of the regiond participating.
Method Detail

setCacheNames

protected void setCacheNames(java.util.ArrayList cacheNames)
Parameters:
cacheNames - The cacheNames to set.

getCacheNames

protected java.util.ArrayList getCacheNames()
Returns:
Returns the cacheNames.

run

public void run()
Send a message.

Specified by:
run in interface java.lang.Runnable


Copyright © 2002-2010 Apache Software Foundation. All Rights Reserved.