|
ANTS v2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ants.core.Entity | +--ants.core.Application | +--ants.dante.DanteServer
This class dynamically distributes addresses for a core server.
DanteServer accepts the following arguments:
Fields inherited from class ants.core.Application |
defaults |
Fields inherited from interface ants.dante.DanteConstants |
DANTE_CLIENT_PORT,
DANTE_SERVER_PORT,
DANTE_VERSION,
ERROR,
INIT,
JOIN,
KEEP_ALIVE_FREQUENCY,
LEAVE,
MAX_FAILURES,
REFRESH,
RESPONSE,
TIMEOUT,
UNDEFINED |
Constructor Summary | |
DanteServer()
|
Method Summary | |
int |
allocateAddress(edu.utah.janos.nodeos.Address link)
Allocate a new (unused) address, and a build a provisional gateway |
void |
markAddress(int address,
edu.utah.janos.nodeos.Address link)
Called on receiving a keep-alive update to reset the timeout field. |
void |
receive(Capsule c)
Callback for packets that are delivered to this application. |
void |
returnAddress(int address)
Return a timed-out address to the pool. |
void |
run()
Clear the use bits after each timeout period. |
void |
setArgs(KeyArgs k)
Parse command line arguments for this application. |
void |
start()
Start this Application rolling. |
Methods inherited from class ants.core.Application |
getDefaultResources,
getDefaultTTL,
getNode,
getNodeAddress,
getPort,
getPrincipal,
send,
send,
setDefaultResources,
setDefaultTTL,
thisNode,
toString |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public DanteServer()
Method Detail |
public void start() throws java.lang.Exception
Note that implementations of start should just set things up. If the application wants to do things like send packets, this function should start a new thread to do that. Creating a GUI and associating callbacks is a good thing to do here.
XXX mostly stuff that could just be done in the no-arg constructor, no?
public void setArgs(KeyArgs k) throws InvalidKeyArgsException
It is guaranteed that this method will be invoked before the application starts running (i.e. shortly after the constructor is invoked).
XXX A security issue related to this method is that a mallicious application could change its parameters by invoking this method after startup. For example, the application could change its principal to "Administrator". To avoid any pitfalls, the local copies of the argument variables should be ignored once control is given over to the application's start method
#port
,
KeyArgs
public void receive(Capsule c)
cap
- the Capsule that got delivered. XXX state of Xdr?public int allocateAddress(edu.utah.janos.nodeos.Address link) throws AddressExhaustionException
public void markAddress(int address, edu.utah.janos.nodeos.Address link)
public void returnAddress(int address)
public void run()
|
ANTS v2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |