private static class LinkManager.LinksToNodeHolder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.HashSet |
links |
private Link |
linkWithNoSpecifiedFacilities
A link with no special facilities.
|
private NodeID |
target |
private java.util.Hashtable |
waiting
The processes waiting for a link.
|
Constructor and Description |
---|
LinksToNodeHolder(NodeID target) |
Modifier and Type | Method and Description |
---|---|
int |
addLink(Link link,
boolean addIfNoQueue)
This sends the supplied link to any processes that are waiting for
matching link.
|
Link |
getLink(Profile profile) |
NodeID |
getTarget() |
boolean |
joinQueue(ChannelOutput channel,
Profile profile)
This method allows processes to join a queue waiting for a link
to a Node (with a known NodeID) to be established.
|
int |
notifyQueuedProcesses(Profile profile,
java.lang.Object toSend) |
int |
notifyQueuedProcesses(Specification[] specs,
Link linkToSend)
This takes a set of link specifications, looks through the set of
queues, checks whether the specifications meet requirements of
the profile of a queue, and if so, sends the supplied Link to the
processes in that queue.
|
void |
removeLink(Link conn) |
private NodeID target
private java.util.HashSet links
private Link linkWithNoSpecifiedFacilities
private java.util.Hashtable waiting
public LinksToNodeHolder(NodeID target)
public NodeID getTarget()
public int addLink(Link link, boolean addIfNoQueue)
addIfNoQueue
parameter was true, then the link is
added to this link manager.link
- the Link to add.addIfNoQueue
- boolean inidicating whether to add the link
if there were no queued processes.public int notifyQueuedProcesses(Profile profile, java.lang.Object toSend)
public int notifyQueuedProcesses(Specification[] specs, Link linkToSend)
specs
- an array of Specifcation objects that
the link provides.linkToSend
- the link to send to the queued processes.public void removeLink(Link conn)
public boolean joinQueue(ChannelOutput channel, Profile profile)
channel
- the channel to put in the queue.profile
- the profile that the required link must meet.