edu.umn.cs.crisys
Class RSM.SendInterface
java.lang.Object
|
+--edu.umn.cs.crisys.RSM.Interface
|
+--edu.umn.cs.crisys.RSM.SendInterface
- All Implemented Interfaces:
- java.lang.Runnable
- Enclosing class:
- RSM
- public static class RSM.SendInterface
- extends edu.umn.cs.crisys.RSM.Interface
- implements java.lang.Runnable
RSML-e Send Interfaces. This provides an (asynchronous) send operation
by running as a separate thread sending queued output messages over its channel.
The state-machine implementation should call the send method to send
messages over this output interface. Since the receives are synchronous,
the sends or asynchronous, otherwise there is a possibility of deadlock.
Field Summary |
protected boolean |
isOpen
flag to indicate state of this RMSL-e interface. |
protected edu.umn.cs.crisys.nimbus.NimbusJavaWrapper |
myChannel
|
edu.umn.cs.crisys.RSM.Message |
myMessage
Reference to my message object which stores the latest message
on this interface. |
java.lang.String |
myName
Descriptive name for this interface. |
Constructor Summary |
RSM.SendInterface(java.lang.String name,
java.lang.String channelName,
edu.umn.cs.crisys.RSM.Message msg)
Constructor. |
Method Summary |
void |
close()
Closes this interface by calling super.close(). |
void |
open()
Initializes interface for communication by calling super.open(). |
void |
run()
The main method called by the execution thread for this interface. |
void |
send()
Method to be called by state-machine implementations to send
messages over this interface. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
myName
public final java.lang.String myName
- Descriptive name for this interface.
myChannel
protected edu.umn.cs.crisys.nimbus.NimbusJavaWrapper myChannel
myMessage
public final edu.umn.cs.crisys.RSM.Message myMessage
- Reference to my message object which stores the latest message
on this interface.
isOpen
protected boolean isOpen
- flag to indicate state of this RMSL-e interface.
RSM.SendInterface
public RSM.SendInterface(java.lang.String name,
java.lang.String channelName,
edu.umn.cs.crisys.RSM.Message msg)
- Constructor. Calls the interface constructor with the passed parameters
adding the appropriate channel type.
run
public void run()
- The main method called by the execution thread for this interface.
Waits for an output message to be queued and then sends it over its
channel. Stops when the interface is closed.
- Specified by:
run
in interface java.lang.Runnable
open
public void open()
- Initializes interface for communication by calling super.open().
Starts off its execution thread to send messages over the channel.
- Overrides:
open
in class edu.umn.cs.crisys.RSM.Interface
close
public void close()
- Closes this interface by calling super.close(). Interrupts its
execution thread so that it can verify the closed status and
stop execution.
- Overrides:
close
in class edu.umn.cs.crisys.RSM.Interface
send
public void send()
- Method to be called by state-machine implementations to send
messages over this interface. The message, in reality, gets
queued and is later sent by this interface's execution thread.