|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--edu.UCL.xmiddle.framework.host.Host
|
+--edu.UCL.xmiddle.host.UDPHost
|
+--edu.UCL.xmiddle.host.SimpleLocalHost
SimpleLocalHost.java
The SimpleLocalHost is essentially a Host
which also services requests. Examples of
requests include linking, reconciliation etc
Created: Mon Jul 30 12:36:40 2001
| Field Summary |
| Fields inherited from class edu.UCL.xmiddle.host.UDPHost |
primaryID, secondaryID |
| Fields inherited from class edu.UCL.xmiddle.framework.host.Host |
links |
| Constructor Summary | |
SimpleLocalHost(java.lang.String primaryID,
java.lang.String secondaryID)
Creates a new instance. |
|
| 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 this LocalHost. |
void |
exit()
Signals that we are about to exit; |
void |
flushqueue()
Clears 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 |
hostInReach(Host host)
Called by the Locator when it detects a new online host It traverses the list of HostListeners and notifies any hosts registered to receive online events for the given host. |
void |
hostOutOfReach(Host host)
Called by the Locator when it detects a host going offline It traverses the list of HostListeners and notifies any hosts registered to receive offline events for the given host. |
void |
pause()
Signals that we should stop servicing requests |
void |
queue(java.lang.Object[] request)
Enqueue a request to be serviced |
void |
removeHostListener(HostListener application)
Unregisters a HostListener with this localhost. |
void |
removeHostListener(java.lang.Object primaryID,
HostListener application)
Unregisters a HostListener for a given host with this localhost. |
void |
run()
The SimpleLocalHost thread, when running, gets requests off the queue, and launches them onto a new ProtocolChooser thread |
void |
start()
Starts servicing requests |
| Methods inherited from class edu.UCL.xmiddle.host.UDPHost |
getAddress, getPort, getSegmentSize |
| Methods inherited from class edu.UCL.xmiddle.framework.host.Host |
setLinks |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SimpleLocalHost(java.lang.String primaryID,
java.lang.String secondaryID)
primaryID - a String valuesecondaryID - a String value| Method Detail |
public java.lang.Object getSecondaryID()
LocalHost
getSecondaryID in interface LocalHostgetSecondaryID in class UDPHostpublic java.lang.Object getPrimaryID()
LocalHost
getPrimaryID in interface LocalHostgetPrimaryID in class UDPHostpublic LinkTable getLinks()
LocalHost
getLinks in interface LocalHostgetLinks in class Hostpublic void exit()
exit in interface LocalHostpublic void pause()
pause in interface LocalHostpublic void start()
start in interface LocalHostpublic void run()
run in interface LocalHostpublic void flushqueue()
flushqueue in interface LocalHostpublic void queue(java.lang.Object[] request)
queue in interface LocalHostrequest - The request and its parameterspublic void addHostListener(HostListener application)
addHostListener in interface LocalHostapplication - The HostListener to be notified.
public void addHostListener(java.lang.Object primaryID,
HostListener application)
addHostListener in interface LocalHostprimaryID - The host, identified by its primary ID.application - The HostListener to be notified.public void removeHostListener(HostListener application)
removeHostListener in interface LocalHostapplication - The HostListener not to be notified any more
public void removeHostListener(java.lang.Object primaryID,
HostListener application)
removeHostListener in interface LocalHostprimaryID - The host, identified by its primaryIDapplication - The object not to be notified any morepublic void hostInReach(Host host)
hostInReach in interface HostListenerhost - The online hostpublic void hostOutOfReach(Host host)
hostOutOfReach in interface HostListenerhost - The offline host
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||