edu.UCL.xmiddle.framework.controller
Class Locator

java.lang.Object
  |
  +--edu.UCL.xmiddle.framework.controller.Locator
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
UDPLocator

public abstract class Locator
extends java.lang.Object
implements java.lang.Runnable

Locator.java Locator is the xmiddle component which is responsible for maintaining a list of which hosts are in reach with the local host at the time. How the list is maintained accurate, is left up to the implementor. Created: Fri Jul 20 12:45:15 2001


Field Summary
protected  Manager caller
          This is a reference to the Manager object of the platform.
protected  java.util.Hashtable inReach
          This is the list of hosts in reach.
protected  LocalHost localhost
          This is the reference to the local host object, as given by the setLocalHost method
 
Constructor Summary
Locator()
           
 
Method Summary
abstract  void exit()
          Signifies to the Locator implementation that the platform is going to stop operating.
abstract  Host getHost(java.lang.Object primaryID)
          Returns the host (if it is inReach) identified by the given primary ID.
 java.util.Hashtable getHosts()
          Returns the hosts which are currently in reach
abstract  boolean isInReach(java.lang.Object primaryID)
          Returns true if the Host identified by the given primary ID is currently in reach.
abstract  void pause()
          Stops the process (until a start() call is made).
abstract  void run()
          Starts the Locator thread.
 void setLocalHost(LocalHost localhost)
          Gives a reference to the localhost.
abstract  void start()
          Starts the process, after a pause() call for example.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inReach

protected java.util.Hashtable inReach
This is the list of hosts in reach. This is expected to be maintained by the Locator thread.


caller

protected Manager caller
This is a reference to the Manager object of the platform. This can be used for notification when specific hosts are online, printing debugging information, etc


localhost

protected LocalHost localhost
This is the reference to the local host object, as given by the setLocalHost method

Constructor Detail

Locator

public Locator()
Method Detail

run

public abstract void run()
Starts the Locator thread.

Specified by:
run in interface java.lang.Runnable

exit

public abstract void exit()
Signifies to the Locator implementation that the platform is going to stop operating.


pause

public abstract void pause()
Stops the process (until a start() call is made). This can be used for example in the case of a network disconnection, battery conservation mode, etc.


start

public abstract void start()
Starts the process, after a pause() call for example.


getHosts

public java.util.Hashtable getHosts()
Returns the hosts which are currently in reach

Returns:
a Hashtable value

getHost

public abstract Host getHost(java.lang.Object primaryID)
Returns the host (if it is inReach) identified by the given primary ID.

Parameters:
primaryID - the primary ID of the host
Returns:
The host's representation

setLocalHost

public void setLocalHost(LocalHost localhost)
Gives a reference to the localhost. This can be used by the Locator implementation to automatically queue protocol requests

Parameters:
localhost - The local host representation

isInReach

public abstract boolean isInReach(java.lang.Object primaryID)
Returns true if the Host identified by the given primary ID is currently in reach.

Parameters:
primaryID - The primary ID of the host.
Returns:
true if the host is currently in reach, or false otherwise