|
||||||||||
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
valueMethod Detail |
public java.lang.Object getSecondaryID()
LocalHost
getSecondaryID
in interface LocalHost
getSecondaryID
in class UDPHost
public java.lang.Object getPrimaryID()
LocalHost
getPrimaryID
in interface LocalHost
getPrimaryID
in class UDPHost
public LinkTable getLinks()
LocalHost
getLinks
in interface LocalHost
getLinks
in class Host
public void exit()
exit
in interface LocalHost
public void pause()
pause
in interface LocalHost
public void start()
start
in interface LocalHost
public void run()
run
in interface LocalHost
public void flushqueue()
flushqueue
in interface LocalHost
public void queue(java.lang.Object[] request)
queue
in interface LocalHost
request
- The request and its parameterspublic void addHostListener(HostListener application)
addHostListener
in interface LocalHost
application
- The HostListener to be notified.public void addHostListener(java.lang.Object primaryID, HostListener application)
addHostListener
in interface LocalHost
primaryID
- The host, identified by its primary ID.application
- The HostListener to be notified.public void removeHostListener(HostListener application)
removeHostListener
in interface LocalHost
application
- The HostListener not to be notified any morepublic void removeHostListener(java.lang.Object primaryID, HostListener application)
removeHostListener
in interface LocalHost
primaryID
- The host, identified by its primaryIDapplication
- The object not to be notified any morepublic void hostInReach(Host host)
hostInReach
in interface HostListener
host
- The online hostpublic void hostOutOfReach(Host host)
hostOutOfReach
in interface HostListener
host
- The offline host
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |