|
Bees v0.5.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--bees.core.ProtocolSession | +--bees.core.ExtendedProtocolSession
An ExtendedProtocolSession is a ProtocolSession that provides functionality for tracking interested applications and managing the addition and removal of neighbors.
Field Summary | |
static int |
METHOD_ADD_NEIGHBOR
Add a neighbor object to the protocol. |
static int |
METHOD_ERROR
Report an error. |
static int |
METHOD_NONE
Null method identifier. |
static int |
METHOD_REGISTER
Register an application with the protocol. |
static int |
METHOD_REM_NEIGHBOR
Remove a neighbor object from the protocol. |
static int |
METHOD_REPLY
Flag indicating that the message is a reply to another message. |
static int |
METHOD_UNREGISTER
Unregister an application from a protocol. |
static int |
METHOD_USER
The start of user messages. |
static IntegerPermission |
REGISTER_TIMEOUT
Timeout for registered applications. |
Fields inherited from class bees.core.ProtocolSession |
neighbors |
Constructor Summary | |
ExtendedProtocolSession()
Construct an empty ExtendedProtocolSession. |
Method Summary | |
void |
addNeighbor(Node node,
ExternalCapsule ec,
NeighborImpl ni)
Handle a neighbor addition. |
java.util.Hashtable |
getInterests()
|
java.util.Hashtable |
getNeighbors()
|
void |
notifyInterests(ExternalCapsule ec)
Broadcast an ExternalCapsule to any interested applications. |
void |
receive(Node node,
ExternalCapsule ec)
Call back used to handle a newly received ExternalCapsule. |
void |
register(Node node,
ExternalCapsule cap,
ExternalChannel ec)
Handle a registration. |
void |
removeNeighbor(Node node,
ExternalCapsule ec,
NeighborImpl ni)
Handle a neighbor removal. |
void |
reply(ExternalChannel channel,
int method)
Send a reply to a specific application. |
void |
reply(ExternalChannel channel,
int method,
java.lang.Throwable th)
Send a reply to a specific application. |
java.lang.String |
toString()
|
void |
unregister(Node node,
ExternalCapsule cap,
ExternalChannel ec)
Handle an unregistration. |
protected void |
userReceive(Node node,
int method,
ExternalCapsule ec)
|
Methods inherited from class bees.core.ProtocolSession |
addNeighbor, attachNeighbor, detachNeighbor, getByteArray, getCache, removeNeighbor |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static IntegerPermission REGISTER_TIMEOUT
public static final int METHOD_NONE
public static final int METHOD_ERROR
public static final int METHOD_REGISTER
public static final int METHOD_UNREGISTER
public static final int METHOD_ADD_NEIGHBOR
public static final int METHOD_REM_NEIGHBOR
public static final int METHOD_USER
public static final int METHOD_REPLY
Constructor Detail |
public ExtendedProtocolSession()
Method Detail |
public java.util.Hashtable getNeighbors()
public java.util.Hashtable getInterests()
public void notifyInterests(ExternalCapsule ec)
ec
- The ExternalCapsule to broadcast.public void reply(ExternalChannel channel, int method, java.lang.Throwable th)
channel
- The destination for the reply.method
- The method send a reply for.th
- An exception or NULL if the operation succeeded.public void reply(ExternalChannel channel, int method)
channel
- The destination for the reply.method
- The method send a reply for.public void register(Node node, ExternalCapsule cap, ExternalChannel ec)
node
- The current node.cap
- The ExternalCapsule containing the registration message.ec
- The ExternalChannel that should be registered.public void unregister(Node node, ExternalCapsule cap, ExternalChannel ec)
node
- The current node.cap
- The ExternalCapsule containing the unregistration message.ec
- The ExternalChannel that should be unregistered.public void addNeighbor(Node node, ExternalCapsule ec, NeighborImpl ni)
node
- The current node.cap
- The ExternalCapsule containing the message.ni
- The NeighborImpl that should be added.public void removeNeighbor(Node node, ExternalCapsule ec, NeighborImpl ni)
node
- The current node.cap
- The ExternalCapsule containing the message.ni
- The NeighborImpl that should be removed.public void receive(Node node, ExternalCapsule ec)
ExternalCapsuleReceiver
receive
in class ProtocolSession
bees.core.ExternalCapsuleReceiver
node
- The Node object for this domain.ec
- The newly received ExternalCapsule.protected void userReceive(Node node, int method, ExternalCapsule ec)
public java.lang.String toString()
toString
in class ProtocolSession
|
Bees v0.5.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |