edu.UCL.xmiddle.framework.host
Interface LocalHost

All Superinterfaces:
HostListener, java.lang.Runnable
All Known Implementing Classes:
SimpleLocalHost

public interface LocalHost
extends java.lang.Runnable, HostListener

LocalHost.java Essentially, the Xmiddle localhost is expected to extend Host and implement this interface. It provides methods to manage a queue of commands, get the IDs of the host, control the operation of the localhost, etc. Created: Fri Jul 20 15:32:15 2001


Method Summary
 void addHostListener(HostListener application)
          Registers a general HostListener with this LocalHost.
 void addHostListener(java.lang.Object primaryID, HostListener application)
          Registers a HostListener with the localhost.
 void exit()
          Signifies that we're about to exit the platform
 void flushqueue()
          Removes all pending requests from the queue
 LinkTable getLinks()
          Returns the local host's linktable.
 java.lang.Object getPrimaryID()
          Returns the primary ID of the host
 java.lang.Object getSecondaryID()
          Returns the secondary ID of the host
 void pause()
          Stops servicing requests
 void queue(java.lang.Object[] command)
          Queue a command to be serviced by the localhost.
 void removeHostListener(HostListener application)
          Unregisters a HostListener with this localhost.
 void removeHostListener(java.lang.Object primaryID, HostListener application)
          Unregisters a HostListener with the localhost.
 void run()
          Starts the thread which services requests
 void start()
          Starts servicing requests
 
Methods inherited from interface edu.UCL.xmiddle.framework.lib.HostListener
hostInReach, hostOutOfReach
 

Method Detail

queue

public void queue(java.lang.Object[] command)
Queue a command to be serviced by the localhost. Examples include linking, reconciliation, etc.

Parameters:
command - The command and its parameters (left to the implementor)

flushqueue

public void flushqueue()
Removes all pending requests from the queue


run

public void run()
Starts the thread which services requests

Specified by:
run in interface java.lang.Runnable

start

public void start()
Starts servicing requests


pause

public void pause()
Stops servicing requests


exit

public void exit()
Signifies that we're about to exit the platform


addHostListener

public void addHostListener(HostListener application)
Registers a general HostListener with this LocalHost. The HostListener will be notified when any host comes online or goes offline.

Parameters:
application - The HostListener to be notified.

addHostListener

public void addHostListener(java.lang.Object primaryID,
                            HostListener application)
Registers a HostListener with the localhost. The HostListener should be notified when a given host comes online or goes offline

Parameters:
primaryID - The host, identified by its primary ID
application - The object to be notified

removeHostListener

public void removeHostListener(HostListener application)
Unregisters a HostListener with this localhost.

Parameters:
application - The HostListener not to be notified any more

removeHostListener

public void removeHostListener(java.lang.Object primaryID,
                               HostListener application)
Unregisters a HostListener with the localhost.

Parameters:
primaryID - The host, identified by its primaryID
application - The object not to be notified any more

getLinks

public LinkTable getLinks()
Returns the local host's linktable.

Returns:
a LinkTable value

getPrimaryID

public java.lang.Object getPrimaryID()
Returns the primary ID of the host

Returns:
an Object value

getSecondaryID

public java.lang.Object getSecondaryID()
Returns the secondary ID of the host

Returns:
an Object value