All Packages This Package Class Hierarchy Class Search Index
Class edu.utah.janos.ants.ants.Node
java.lang.Object
|
+----edu.utah.janos.ants.ants.Node
public class Node
extends java.lang.Object
{
// Fields 8
private final Hashtable GIDtoCodeGroup;
private final Hashtable MIDtoCapsuleClass;
private final int address;
private static final Hashtable applications;
private final Hashtable nameToCapsuleClass;
private final CommSpaceHandle neighbors;
private final Hashtable outChannels;
final UnknownMidPackets unknownMidPackets;
// Constructors 1
Node(Flow, CommSpaceHandle, int, UnknownMidPackets);
// Methods 23
static void attachApplication(Application, int) throws AttachException;
static Node currentNode();
private void addOutChannel(int, Address);
public boolean deliverToApp(Capsule, int);
TypeID findMID(String);
TypeID findPID(String);
public int getAddress();
private void getNeighbors();
public String getPhysicalAddress();
public RouteTable getRouteTable();
public void log(int, String);
CapsuleClass lookupCapsuleClass(TypeID);
CodeGroup lookupCodeGroup(TypeID);
void publishCapsuleClass(CapsuleClass) throws DuplicateCapsuleClassException;
void publishCodeGroup(CodeGroup);
public void register(Protocol);
public boolean routeForNode(Capsule, int);
public boolean send(Capsule);
public void shutdown();
public void sleep(int) throws InterruptedException;
public Thread threadStart(Runnable);
public long time();
public String toString();
}
The per-flow Node interface.
An instance of Node is created in the context of each Application
and protocol.
%AUTHOR_PAT%
%AUTHOR_CKH%
- Returned By:
- Application.thisNode(), Booster.setupLocalNode(), Extension.thisNode(), Node.currentNode()
private final int address
private final Hashtable outChannels
private final CommSpaceHandle neighbors
final UnknownMidPackets unknownMidPackets
private final Hashtable GIDtoCodeGroup
Maps groupsIDs to CodeGroups.
private final Hashtable MIDtoCapsuleClass
Maps MIDs to CapsuleClasses.
private final Hashtable nameToCapsuleClass
Maps name to CapsuleClass. This table is used to supply
a PID or MID given the name of a CapsuleClass.
private static final Hashtable applications
XXX this is static. That is bad, and wrong. It shouldn't be
static any more as app ports are Flow-private.
XXX probably should only allocate this on demand.
Node(Flow flow,
CommSpaceHandle neighbors,
int address,
UnknownMidPackets unknownMidPackets)
Construct a node. A node is only constructed by the boot
routine in PrimordialNode, AppBooster or ProtocolBooster.
public int getAddress()
Return the logical 32-bit IP-like "active" address for this Node.
- Returns:
- the 32-bit IP-like "active" address of this Node
public String getPhysicalAddress()
static Node currentNode()
Return the Node interface associated with the current flow.
XXX This method is a hack and should go away once we get
free reign to re-write the basic ANTS interfaces.
private void getNeighbors()
Lookup the neighbor table and construct outchans to
each neighbor.
private void addOutChannel(int logicalAddress,
Address physicalAddress)
public void register(Protocol p)
Called by applications that want to instantiate a
locally originiating protocol.
This is a public interface that we really can't change.
public boolean deliverToApp(Capsule cap,
int port)
Deliver the given capsule to the Application on the
given port number.
XXX access control?
- Throws: NoSuchApplicationError
- if the port doesn't have an app listening on it.
public boolean send(Capsule cap)
public Thread threadStart(Runnable r)
public boolean routeForNode(Capsule cap,
int destination)
void publishCapsuleClass(CapsuleClass cc) throws DuplicateCapsuleClassException
Publish the given CapsuleClass in both the name -> cc map and the
MID -> cc map.
Parameter | Description |
cc | the CapsuleClass to publish. Must have a name and methodID defined. |
- Throws: DuplicateCapsuleClassException
- if a CC is already registered under the cc's name.
void publishCodeGroup(CodeGroup group)
TypeID findMID(String name)
TypeID findPID(String name)
CapsuleClass lookupCapsuleClass(TypeID mid)
CodeGroup lookupCodeGroup(TypeID gid)
static void attachApplication(Application app,
int port) throws AttachException
public void sleep(int millis) throws InterruptedException
public void shutdown()
public long time()
public void log(int level,
String msg)
public RouteTable getRouteTable()
public String toString()
- Overrides:
- toString in class Object
All Packages This Package Class Hierarchy Class Search Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7