All Packages Class Hierarchy This Package Previous Next Index
Class magician.Node.ActiveNodeManager
java.lang.Object
|
+----magician.Node.ActiveNodeManager
- public class ActiveNodeManager
- extends Object
- implements ExecEnvironment, PerfConstants
The Active Node Manager is the top-level manager of the Active Node. It starts up other entities of the
Active Node such as the Resource Manager, Routing Manager and the Event
Manager. It also provides some primitives for the user Smartpacket to
create and manage small state.
- See Also:
- ResourceMgr, RoutingMgr, EventManager
-
transmitter
-
-
ActiveNodeManager(String, String, String)
- Creates a SmartPacketLoader, starts all other managers, requests
connection information from InformationServer, and then creates a
socket and a new PortManager for each connection.
-
CreateGlobalState(String)
- creates global state.
-
CreateSmallState(String)
- creates small state.
-
DestroyGlobalState(String)
- removes global state associated with key
-
DestroySmallState(String)
- removes small state associated with key
-
enqueue(KUSmartPacketV2)
- enqueues Smartpackets into ready queue
-
GetGlobalState(String)
- returns the object stored in the global state associated with given key.
-
GetLinkBandwidthToNode(String)
- returns the bandwidth capacity to a neighboring node.
-
getNeighbors()
- returns a list of neighbors nodes
-
GetNetName()
- Get this node's virtual net name
-
GetNodeName()
- Get this node's virtual name
-
GetServices()
- Return the list of all services
-
GetSmallState(String)
- returns the object stored in the small state associated with given key.
-
GetSmallState(String, long)
- returns the object stored in the small state associated with given key.
-
GetTraceOutputStream()
- Get this node's trace output stream
return an OutputStream for trace output
-
HaveService(String)
- Check if a particular service is available
-
Process(byte[])
- entry point for executing packets received over the wire
-
Process(String, Object)
- entry point for executing packets handed by the sending node
-
ProcessSP(byte[])
- well-known entry method to send this environments packets for processing.
-
ProcessSP(String, KUSmartPacketV2)
- entry point for executing packets handed by the sending node
-
RegisterService(String, Object)
- Register a new service with the ActiveNodeManager.
-
run()
-
starts up the Node Manager
-
Send(String, Object)
- Called by Active nodes that behave as hosts to inject smartpackets
-
SendSmartPacket(String, Object)
- called by SmartPacket to send itself to the destination
-
SetGlobalState(String, Object)
- sets the contents of the global state
-
SetSmallState(String, Object)
- sets the contents of the small state
transmitter
public static PortInterface transmitter
ActiveNodeManager
public ActiveNodeManager(String ourHostId,
String ourNetId,
String traceOutputName)
- Creates a SmartPacketLoader, starts all other managers, requests
connection information from InformationServer, and then creates a
socket and a new PortManager for each connection.
- See Also:
- Four11
GetSmallState
public static Object GetSmallState(String key) throws StateNotFoundException, StateEmptyException
- returns the object stored in the small state associated with given key.
If the contents of the small state are being accessed by another SmartPacket,
then a NoSuchElementException exception is thrown. The normal procedure is
to then yield the CPU and try to reacquire the small state.
- Parameters:
- key - a string identifying the small state
- Returns:
- contents of the small state
- Throws: StateNotFoundException
- if the small state associated with the key does not exist
- Throws: StateEmptyException
- if small state exists but is empty, which is the case when some other SmartPacket is accessing the contents.
GetSmallState
public static Object GetSmallState(String key,
long timeout) throws StateNotFoundException, StateEmptyException
- returns the object stored in the small state associated with given key.
If the contents of the small state are being accessed by another SmartPacket,
then a NoSuchElementException exception is thrown. The normal procedure is
to then yield the CPU and try to reacquire the small state.
- Parameters:
- key - a string identifying the small state
- timeout - time period to wait for, else throw StateEmptyException
- Returns:
- contents of the small state
- Throws: StateNotFoundException
- if the small state associated with the key does not exist
- Throws: StateEmptyException
- if small state exists but is empty, which is the case when some other SmartPacket is accessing the contents.
SetSmallState
public static void SetSmallState(String key,
Object stateObj) throws StateNotFoundException
- sets the contents of the small state
- Parameters:
- key - a string identifying the small state
- stateObj - the content to be deposited
- Throws: StateNotFoundException
- if state named by key does not exist
CreateSmallState
public static synchronized void CreateSmallState(String key) throws StateExistsException
- creates small state. It is the task of the user to check if small state
same name already exists. The small state created by this method is accessible
only to SmartPackets of the same type as the one that created it. To share
state, use CreateGlobalState() method.
- Parameters:
- key - a string identifying the small state
- Throws: StateExistsException
- if state named by given key exists
DestroySmallState
public static void DestroySmallState(String key) throws StateNotFoundException
- removes small state associated with key
- Parameters:
- key - a string identifying the small state
- Throws: StateNotFoundException
- if named state does not exist
GetGlobalState
public static Object GetGlobalState(String key) throws NullPointerException, NoSuchElementException
- returns the object stored in the global state associated with given key.
If the contents of the global state are being accessed by another SmartPacket,
then a NoSuchElementException exception is thrown. The normal procedure is
to then yield the CPU and try to reacquire the global state.
- Parameters:
- key - a string identifying the global state
- Returns:
- the contents of the global state
- Throws: NullPointerException
- if the global state associated with the key does not exist
- Throws: NOSuchElementException
- if global state exists but is empty, which is the case when some other SmartPacket is accessing the contents.
SetGlobalState
public static void SetGlobalState(String key,
Object stateObj)
- sets the contents of the global state
- Parameters:
- key - a string identifying the global state
- stateObj - the content to be deposited
- Throws: StateNotFoundException
- if the global state associated with the key does not exist
CreateGlobalState
public static synchronized boolean CreateGlobalState(String key)
- creates global state. It is the task of the user to check if global state by
same name already exists. The state created by this method is accessible
to SmartPackets of all types. To create per-type small
state, use CreateSmallState() method.
- Parameters:
- key - a string identifying the global state
DestroyGlobalState
public static void DestroyGlobalState(String key)
- removes global state associated with key
- Parameters:
- key - a string identifying the global state
getNeighbors
public static UnsynchVector getNeighbors()
- returns a list of neighbors nodes
- Returns:
- s a Vector of adjoining neighbor nodes
RegisterService
public static void RegisterService(String ServiceName,
Object Server)
- Register a new service with the ActiveNodeManager. Any service can be added.
However, it has to be noted that the service is global in scope and can be
accessed by Smartpackets of other types.
- Parameters:
- ServiceName - the name of the service
- Server - the object implementing the service
GetLinkBandwidthToNode
public static int GetLinkBandwidthToNode(String nodeName)
- returns the bandwidth capacity to a neighboring node.
- Parameters:
- nodeName - name of the neighboring node
- Returns:
- the bandwidth in Kbps
GetServices
public static String GetServices()
- Return the list of all services
- Returns:
- the service listing
HaveService
public static Object HaveService(String ServiceName)
- Check if a particular service is available
- Parameters:
- ServiceName - name of the service
- Returns:
- object implementing service, else null
Send
public boolean Send(String PortName,
Object SPObject)
- Called by Active nodes that behave as hosts to inject smartpackets
- Parameters:
- Portname - name of destination active node
- SPObject - the SmartPacket object
- Returns:
- true if transmission was successful, false otherwise
SendSmartPacket
public static boolean SendSmartPacket(String PortName,
Object SPObject)
- called by SmartPacket to send itself to the destination
- Parameters:
- Portname - name of destination active node
- SPObject - the SmartPacket object
- Returns:
- true if transmission was successful, false otherwise
GetNodeName
public static String GetNodeName()
- Get this node's virtual name
- Returns:
- s the node name as a String
GetNetName
public static String GetNetName()
- Get this node's virtual net name
- Returns:
- the net name as a String
GetTraceOutputStream
public static OutputStream GetTraceOutputStream()
- Get this node's trace output stream
return an OutputStream for trace output
- See Also:
- OutputStream
ProcessSP
public static void ProcessSP(String destination,
KUSmartPacketV2 SPObject)
- entry point for executing packets handed by the sending node
- Parameters:
- destination - the destination of this SmartPacket
- SPObject - the executable object
Process
public void Process(String destination,
Object SPObject)
- entry point for executing packets handed by the sending node
- Parameters:
- destination - the destination of this SmartPacket
- SPObject - the executable object
ProcessSP
public static void ProcessSP(byte packetbytes[])
- well-known entry method to send this environments packets for processing.
This method accepts the entire packet as a stream of bytes. This is useful
when this VM is operating at another site
- Parameters:
- packetbytes - the stream of bytes comprising the packet
enqueue
protected static void enqueue(KUSmartPacketV2 SPObject)
- enqueues Smartpackets into ready queue
- Parameters:
- SPObject - KU_SmartPacket object
Process
public void Process(byte packetbytes[])
- entry point for executing packets received over the wire
- Parameters:
- packetbytes - the on-the-wire representation of the SmartPacket
run
public void run()
- starts up the Node Manager
All Packages Class Hierarchy This Package Previous Next Index