All Packages  This Package  Class Hierarchy  Class Search  Index

Class edu.utah.janos.antsr.core.PrimordialNode
java.lang.Object
   |
   +----edu.utah.janos.antsr.core.PrimordialNode

  Summary

class  PrimordialNode
     extends java.lang.Object
{
          // Fields 16
     private static int address;
     private static int consolePort;
     private static final String[] defaults;
     private static final Log logger;
     private static String msgPrefix;
     private static CommSpaceHandle neighborsSpace;
     private static boolean oneTrickPony;
     private static String physAddr;
     private static final Hashtable pidToFlowQueue;
     private static int queryPort;
     private static RouteTable routeTable;
     private static String routefile;
     private static long startupTime;
     static final UnknownMidPackets unknownMidPackets;
     private static boolean updateRoutes;
     private static int watchDogPort;

          // Constructors 1
     private PrimordialNode();

          // Methods 24
     static synchronized void addMID(TypeID, UserID, TypeID, TypeID, int);
     static void dumpStackTrace(Throwable);
     static CommSpaceHandle fillNeighborSpace() throws IOException;
     static void fireUpNewAppFlow(AppConfig) throws InterruptedException, IOException;
     static CommSpaceHandle fireUpNewFlow(Credentials, ThreadPoolSpec, MemSpec, TypeID, CommQueue, String, String[]) throws InterruptedException, IOException;
     static void fireUpNewProtocolFlow(TypeID, CommQueue) throws InterruptedException, IOException;
     public static int getAddress();
     static String getPhysicalAddress();
     static CommQueue getProtocolQueue(TypeID);
     static RouteTable getRouteTable();
     static long getStartupTime();
     static synchronized void installProtocol(TypeID, String);
     private static RouteTable loadRouteTableImpl(int, boolean, String);
     static void message(int, String);
     static void message(String);
     static int nextHopToNode(int);
     static boolean oneTrick();
     static void setAddress(int);
     static void setArgs(KeyArgs) throws InvalidKeyArgsException;
     static void setPhysicalAddress(String);
     static void shutdown();
     static void start(Vector, Vector) throws IOException, AddressFormatException, NoSuchNodeAddress, InterruptedException;
     private static void startConsole(Node, int);
     private static void startWatchDog(Node, int);


          // Inner Classes 1
     private static class PrimordialNode.StdoutListener
}

The root Node object that boots the system and tracks system-wide state. This is as opposed to the per-flow Node interface that every protocol/application sees.

XXX move the ConfigurationManager stuff into here.

XXX Move the command line option stuff OUT of here. Make start() method take functions, or make them static method (e.g, if can be changed at run-time).

Author:
Janos Ministry of Development , Janos Ministry of Development




  Fields

· defaults

Summary  |  Top

   private static final String[] defaults

Arguments the PrimordialNode understands and their defaults.


· consolePort

Summary  |  Top
   private static int consolePort

Port to start a console thread on this port (if > -1).


· watchDogPort

Summary  |  Top
   private static int watchDogPort


· queryPort

Summary  |  Top
   private static int queryPort


· startupTime

Summary  |  Top
   private static long startupTime


· oneTrickPony

Summary  |  Top
   private static boolean oneTrickPony

Is this a one-trick node?

See Also: oneTrick


· logger

Summary  |  Top
   private static final Log logger


· msgPrefix

Summary  |  Top
   private static String msgPrefix


· routefile

Summary  |  Top
   private static String routefile


· updateRoutes

Summary  |  Top
   private static boolean updateRoutes


· routeTable

Summary  |  Top
   private static RouteTable routeTable


· neighborsSpace

Summary  |  Top
   private static CommSpaceHandle neighborsSpace


· address

Summary  |  Top
   private static int address

32-bit logical address of this Node.

XXX replace with a real Address object?


· physAddr

Summary  |  Top
   private static String physAddr

Physical address as an "opaque" String. ("only" addr can parse it...


· pidToFlowQueue

Summary  |  Top
   private static final Hashtable pidToFlowQueue


· unknownMidPackets

Summary  |  Top
   static final UnknownMidPackets unknownMidPackets

Global cache of packets for MIDs that haven't been loaded/resolved.

The Dead Letter Office.


  Constructors

· PrimordialNode

Summary  |  Top

   private PrimordialNode() 

No instance of this class is ever created.



  Methods

· getProtocolQueue

Summary  |  Top
   static CommQueue getProtocolQueue(TypeID pid) 


· getStartupTime

Summary  |  Top
   static long getStartupTime() 


· loadRouteTableImpl

Summary  |  Top
   private static RouteTable loadRouteTableImpl(int addr, 
                                                boolean updateRoutes, 
                                                String routeTableFile) 


· start

Summary  |  Top
   static void start(Vector appConfigs, 
                     Vector extConfigs)  throws IOException, AddressFormatException, NoSuchNodeAddress, InterruptedException

Start the node on its way.



· startConsole

Summary  |  Top
   private static void startConsole(Node node, 
                                    int consolePort) 


· startWatchDog

Summary  |  Top
   private static void startWatchDog(Node node, 
                                     int watchDogPort) 


· fillNeighborSpace

Summary  |  Top
   static CommSpaceHandle fillNeighborSpace()  throws IOException

Setup one outchan direct to each neighbor node. Enter each into a hashtable indexed by the logical address of the neighbor.

XXX record the logical address of each neighbor in the neigborsSpace commSpace. Child protocols and apps will create a set of OutChannels from this info. Seems rather weak and ugly, though. Perhaps push-able OutChannelHandles would be a good idea?

XXX this is now redundant with the per-node outchannels, no?

XXX Its really, really sad that I call this once for each Flow I create. Kinda stupid, no?



· getRouteTable

Summary  |  Top
   static RouteTable getRouteTable() 


· nextHopToNode

Summary  |  Top
   static int nextHopToNode(int addr) 

Return the logical ANTSR address of the next node on the path to the given addr.



· setArgs

Summary  |  Top
   static void setArgs(KeyArgs k)  throws InvalidKeyArgsException


· oneTrick

Summary  |  Top
   static boolean oneTrick() 


· shutdown

Summary  |  Top
   static void shutdown() 

Shut down the entire VM. Only invoked (occasionally) by Node.shutdown().



· getAddress

Summary  |  Top
   public static int getAddress() 


· setAddress

Summary  |  Top
   static void setAddress(int address) 

Set this node's logical address. Only invoked once during configuration of the system after the Node object is created.

See Also: parseCommands



· setPhysicalAddress

Summary  |  Top
   static void setPhysicalAddress(String addr) 

Set the physical address of this node. Needed by the route table update algorithms. Not parsed. Only understood by the core.Address class.

Parameter Description
addr the String representation of this node's physical address.



· getPhysicalAddress

Summary  |  Top
   static String getPhysicalAddress() 


· message

Summary  |  Top
   static void message(String msg) 


· message

Summary  |  Top
   static void message(int level, 
                       String msg) 


· dumpStackTrace

Summary  |  Top
   static void dumpStackTrace(Throwable exc) 


· addMID

Summary  |  Top
   static synchronized void addMID(TypeID pid, 
                                   UserID userInfo, 
                                   TypeID mid, 
                                   TypeID gid, 
                                   int prevNode) 

Add the given MID to the set understood by this node. This creates a flow to handle the mid (using the resource defined by the userInfo field).

XXX Currently the whole method is synchronized. This protects the race-prone lookup/create in the pidToFlowQueue map. It doesn't need to protect the fireUpNewProtocolFlow.

Parameter Description
pid the PID of the new flow.
userInfo the user identity/credentials of the new flow
mid the MID that caused the flow to get loaded.
prevNode the node that sent the initial MID-labeled packet.



· installProtocol

Summary  |  Top
   static synchronized void installProtocol(TypeID pid, 
                                            String name) 

Install a protocol, this will start up the a new flow if necessary and load in the code.

Parameter Description
pid The protocol ID to be loaded
name The class name of the protocol to install



· fireUpNewAppFlow

Summary  |  Top
   static void fireUpNewAppFlow(AppConfig app)  throws InterruptedException, IOException


· fireUpNewProtocolFlow

Summary  |  Top
   static void fireUpNewProtocolFlow(TypeID pid, 
                                     CommQueue queue)  throws InterruptedException, IOException


· fireUpNewFlow

Summary  |  Top
   static CommSpaceHandle fireUpNewFlow(Credentials cred, 
                                        ThreadPoolSpec tps, 
                                        MemSpec ms, 
                                        TypeID pid, 
                                        CommQueue queue, 
                                        String className, 
                                        String[] args)  throws InterruptedException, IOException


All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7