|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--jxtaimpl.AnthillPeerWS
This class implements the PeerFinder interface. So, after having initialized and started the Nest, its instance will periodically search for new advertisements.
Field Summary |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
AnthillPeerWS(Factory factory)
The constructor needs a Factory in order to instantiate all the other components of the Nest. |
Method Summary | |
void |
addKnownNest(NestId id)
When a new nest has been found, a call to this method will just record the new NestId associated to the nest. |
void |
discoverNest()
This method is used for discovering new Nest instances. |
protected void |
finalize()
Method for cleaning up before being garbage collected |
NestId |
getDestNestId()
This method should be invoked by a Nest instance in order to know to which Nest an ant wil be sent. |
Nest |
getNest()
This method returns the Nest instance created by the
AnthillPeerWorkSpace .
|
NestId |
getNestId()
This method returns the local nest ID |
NestId |
mkNestId(Advertisement adv)
When a new PipeAdvertisement is found, it is handled to this method to extract a valid NestId from it, since that's the smallest information we need to get connected to other nests. |
void |
run()
The run method will just periodically call the discoverNest() method and then go to sleep for a specified amount of time. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public AnthillPeerWS(Factory factory)
factory
- This is the factory instance used for reading in
configuration parametersMethod Detail |
public Nest getNest()
Nest
instance created by the
AnthillPeerWorkSpace
.
This method should be used by an application developed on the top of this
Anthill implementation in order to obtain a reference to the local Nest.
public NestId getNestId()
public NestId getDestNestId()
null
value will be returned.
getDestNestId
in interface PeerFinder
public void run()
run
in interface PeerFinder
run
in class Thread
public void addKnownNest(NestId id)
addKnownNest
in interface PeerFinder
id
- The id of the nest we want to add to the set of known neighbourspublic void discoverNest()
discoverNest
in interface PeerFinder
public NestId mkNestId(Advertisement adv)
mkNestId
in interface PeerFinder
adv
- The pipe advertisement from which we derive a valid jxtaimpl.ids.NestId
instanceprotected void finalize()
finalize
in class Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |