|
DRCL J-Sim API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectdrcl.DrclObj
drcl.comp.Component
drcl.net.Module
A module is a component which implements a protocol. The ports of a module are
categorized into "up" and "down" groups. "Up" and "down" indicate the direction
of data flow in the protocol stack of a node.
By default, it contains one "up" port (up@)
and one "down" port (down@).
A module is also equipped with a timer port (.timer@) and defines
a set of methods to set up and cancel timeout events
(setTimeout(Object, double), setTimeoutAt(Object, double), and
cancelTimeout(drcl.comp.ACATimer). The first two methods return an
ACATimer
object which contains the event object and the time when the timer expires.
The timer object can be used to cancel the timeout event using
cancelTimeout(ACATimer).
Incoming data is dispatched in process(Object, Port) to four handlers by the port at which data arrives:
dataArriveAtUpPort(Object, Port),
dataArriveAtDownPort(Object, Port),
#timeout(Object),
and processOther(Object, Port).
A subclass should override one or more of the handlers to handle the incoming data
as necessary.
| Nested Class Summary |
| Nested classes inherited from class drcl.comp.Component |
Component.Locks |
| Field Summary | |
Port |
downPort
The default "down" port. |
static java.lang.String |
PortGroup_DOWN
The ID of the "down" port group. |
static java.lang.String |
PortGroup_UP
The ID of the "up" port group. |
Port |
upPort
The default "up" port. |
| Constructor Summary | |
Module()
|
|
Module(java.lang.String id_)
|
|
| Method Summary | |
void |
cancelTimeout(ACATimer handle_)
Cancels a timeout event. |
void |
duplicate(java.lang.Object source_)
Duplicates the content of source_, including ID, name, child components and connections among them, to this component. |
ACATimer |
setTimeout(java.lang.Object evt_,
double duration_)
Sets up a timeout event at the specified time later. |
ACATimer |
setTimeoutAt(java.lang.Object evt_,
double time_)
Sets up a timeout event at the specified absolute time. |
| Methods inherited from class drcl.DrclObj |
clone |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final java.lang.String PortGroup_UP
public static final java.lang.String PortGroup_DOWN
public Port downPort
public Port upPort
| Constructor Detail |
public Module()
public Module(java.lang.String id_)
| Method Detail |
public void duplicate(java.lang.Object source_)
Component
duplicate in interface ObjectDuplicableduplicate in class Component
public final ACATimer setTimeoutAt(java.lang.Object evt_,
double time_)
#timeout(Object)
public final ACATimer setTimeout(java.lang.Object evt_,
double duration_)
#timeout(Object)public final void cancelTimeout(ACATimer handle_)
|
DRCL J-Sim API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||