ants
Class Node

java.lang.Object
  |
  +--ants.Entity
        |
        +--ants.ManagedObject
              |
              +--ants.Node

public class Node
extends ManagedObject
implements java.lang.Runnable

node of an active network


Field Summary
static java.lang.String[] defaults
           
 
Fields inherited from class ants.ManagedObject
lp
 
Fields inherited from class ants.Entity
defaults, L, logLevel, name
 
Constructor Summary
Node(Manager b, java.lang.String n, java.lang.String a)
          constructs a node with given address
 
Method Summary
 void addMediator(java.lang.Class cl)
          Add a class to the list of security check mediators
 void attachApplication(Application c, int port)
           
 void attachChannel(Channel l)
           
 void attachExtension(Extension e, java.lang.String name)
           
 void checkCapsule()
          Security check to see if a capsule directs the invocation
 boolean deliverToApp(Capsule c, int d)
           
 void exportClass(java.lang.String name)
          Export a class for use by capsules
 int getAddress()
           
 java.util.Hashtable getApplications()
           
 AutoNodeCache getCache()
           
 Channel getChannels()
           
 Extension getExtension(java.lang.String name)
           
 java.util.Hashtable getExtensions()
           
 RouteTable getRoutes()
           
 void log(java.lang.String msg)
           
 void register(Protocol p)
          Register a protocol for use at this node
 boolean routeForNode(Capsule c, int dst)
           
 void run()
           
 boolean sendToNeighbors(Capsule c)
           
 void setArgs(KeyArgs k)
           
 void sleep(long millis)
          For use by node components and applications to delay execution
 void start()
           
 long time()
           
 void unregister(Protocol p)
          Unregister a protocol previously registered at this node
 
Methods inherited from class ants.ManagedObject
getBoss, log, setBoss, setName
 
Methods inherited from class ants.Entity
assert, error, finalize, getLogLevel, getName, info, setArgs, setArgs, setLogLevel, warn
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaults

public static final java.lang.String[] defaults
Constructor Detail

Node

public Node(Manager b,
            java.lang.String n,
            java.lang.String a)
     throws java.lang.Exception
constructs a node with given address
Method Detail

getAddress

public int getAddress()

getRoutes

public RouteTable getRoutes()

getApplications

public java.util.Hashtable getApplications()

getChannels

public Channel getChannels()

getExtensions

public java.util.Hashtable getExtensions()

getExtension

public Extension getExtension(java.lang.String name)

getCache

public AutoNodeCache getCache()

setArgs

public void setArgs(KeyArgs k)
             throws java.lang.Exception
Overrides:
setArgs in class Entity

start

public void start()
           throws java.lang.Exception
Overrides:
start in class Entity

register

public void register(Protocol p)
              throws java.lang.Exception
Register a protocol for use at this node

unregister

public void unregister(Protocol p)
Unregister a protocol previously registered at this node

attachApplication

public void attachApplication(Application c,
                              int port)
                       throws java.lang.Exception

attachChannel

public void attachChannel(Channel l)

attachExtension

public void attachExtension(Extension e,
                            java.lang.String name)

exportClass

public void exportClass(java.lang.String name)
                 throws java.lang.ClassNotFoundException
Export a class for use by capsules

checkCapsule

public void checkCapsule()
Security check to see if a capsule directs the invocation

addMediator

public void addMediator(java.lang.Class cl)
Add a class to the list of security check mediators

routeForNode

public boolean routeForNode(Capsule c,
                            int dst)

sendToNeighbors

public boolean sendToNeighbors(Capsule c)

deliverToApp

public boolean deliverToApp(Capsule c,
                            int d)

time

public long time()

log

public void log(java.lang.String msg)

sleep

public void sleep(long millis)
For use by node components and applications to delay execution

run

public void run()
Specified by:
run in interface java.lang.Runnable