|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--SSF.OS.ProtocolSession
Base class for Protocol implementations. Specifies default mechanisms
for how to behave when configured, when opened by another
ProtocolSession, when a ProtocolMessage is pushed to this protocol by
another ProtocolSession, and so forth. Subclasses may extend these
behaviors with their own specific behaviors.
Since release 1.4: Provides uniform support for protocol monitoring
by classes implementing interface SSF.OS.ProtocolMonitor.
A derived ProtocolSession with monitoring
enabled will call monitorReceive, monitorSend, monitorDrop
when it receives, sends or drops a message, respectively.
A ProtocolMonitor can be added/removed and enabled/disabled at runtime.
| Field Summary | |
java.lang.String |
name
Symbolic name of the protocol this session implements |
java.lang.String |
use
Protocol class name to instantiate to make this session |
| Constructor Summary | |
ProtocolSession()
|
|
| Method Summary | |
void |
close(ProtocolSession S)
Called by a neighboring session to close (unconfigure) this session. |
void |
closed(ProtocolSession S)
Called by a neighboring session to confirm to this session that a close operation has succeeded, and that this session is now successfully unconfigured from the caller session. |
void |
config(com.renesys.raceway.DML.Configuration cfg)
Configure this ProtocolSession. |
java.lang.String |
debugIdentifier()
Returns a standardized prefix string "time, NHI address, protocol_name" for diagnostic messages from this protocol. |
ProtocolGraph |
inGraph()
Return a handle to the protocol graph within which this session is currently configured, or NULL if it stands alone. |
void |
init()
Initialization routine, called by the ProtocolGraph after instantiation. |
void |
open(ProtocolSession S,
java.lang.Object request)
Called by a neighboring session to open this session. |
void |
opened(ProtocolSession S)
Called by a neighboring session to confirm to this session that an open operation has succeeded, and that this session is now successfully configured over/under the caller session. |
abstract boolean |
push(ProtocolMessage message,
ProtocolSession fromSession)
Routine to call when a message is being sent to ("pushed into") this ProtocolSession by another ProtocolSession. |
boolean |
pushAfterDelay(ProtocolMessage message,
ProtocolSession fromSession,
double seconds)
Push the message into this protocol session after the specified number of ticks of CPU time have been consumed. |
protected void |
pushAfterDelayFailed(ProtocolException pex)
Method called back when pushAfterDelay has failed. |
void |
setGraph(ProtocolGraph G)
Set the protocol graph in which this session is configured. |
java.lang.String |
version()
"Type" string identifying the version of this protocol. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public java.lang.String name
public java.lang.String use
| Constructor Detail |
public ProtocolSession()
| Method Detail |
public void init()
throws ProtocolException
ProtocolException
public abstract boolean push(ProtocolMessage message,
ProtocolSession fromSession)
throws ProtocolException
If you desire "safe" interaction with other CPU activities, even though your push() consumes no measurable/modelable CPU cycles, define the "cpudelay true" attribute for the ProtocolGraph and use pushAfterDelay(message,fromSession,0.0). This will guarantee proper ordering; that is, the framework will wait until the CPU is free before proceeding with the requested push().
ProtocolException
public boolean pushAfterDelay(ProtocolMessage message,
ProtocolSession fromSession,
double seconds)
throws ProtocolException
ProtocolExceptionprotected void pushAfterDelayFailed(ProtocolException pex)
public void config(com.renesys.raceway.DML.Configuration cfg)
throws com.renesys.raceway.DML.configException
config in interface com.renesys.raceway.DML.Configurablecom.renesys.raceway.DML.configExceptionpublic java.lang.String version()
public ProtocolGraph inGraph()
public void setGraph(ProtocolGraph G)
throws ProtocolException
ProtocolException - if the session is already configured in a protocol graph
public void open(ProtocolSession S,
java.lang.Object request)
throws ProtocolException
ProtocolException - if neither the opening session nor the opened session are contained within a valid protocol graph, or if they are already contained within different protocol graphs, or if the opening session could not be added to the list of open sessions, perhaps because the max session count has been exceeded
public void opened(ProtocolSession S)
throws ProtocolException
ProtocolException - if the opened session could not be added to the list of open sessions, perhaps because the max session count has been exceeded
public void close(ProtocolSession S)
throws ProtocolException
ProtocolException - if the closing session could not be removed from the list of open sessions
public void closed(ProtocolSession S)
throws ProtocolException
ProtocolException - if the closed session could not be removed from the list of open sessionspublic java.lang.String debugIdentifier()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||