|
J-Sim v1.2.1-p7 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
drcl.inet.application.SApplication
Single-session (or simplified) application base class. No open or close is needed. Assume that the connection is already established at the transport layer. This class provides a set of send() and receive() methods to send/receive byte streams to/from the peer application process. One can also use getInputStream() and getOutputStream() to send/receive byte stream using the stream classes in java.io.
| Nested Class Summary |
| Nested classes inherited from class drcl.comp.Component |
Component.Locks |
| Field Summary |
| Fields inherited from class drcl.net.Module |
address, downPort, PortGroup_DOWN, PortGroup_UP, timerPort, upPort |
| Constructor Summary | |
SApplication()
|
|
SApplication(java.lang.String id_)
|
|
| Method Summary | |
java.io.InputStream |
getInputStream()
|
java.io.OutputStream |
getOutputStream()
|
protected void |
process(java.lang.Object data_,
Port inPort_)
This method classifies inPort_ and delegates process of data
to the appropriate handler. |
protected int |
receive()
Receives whatever is currently available through the down port. |
protected int |
receive(byte[] buffer_)
Receives a buffer of data through the down port. |
protected int |
receive(byte[] buffer_,
int size_)
Receives a maximun of size_ data through the down port. |
protected int |
receive(int size_)
Receives size_ bytes of data through the down port. |
protected void |
send(byte[] buffer_,
int len_)
Sends len_ bytes of data from buffer_ through the down port. |
protected void |
send(int len_)
Sends len_ bytes of pseudo-data through the down port. |
| Methods inherited from class drcl.net.Module |
cancelTimeout, dataArriveAtDownPort, dataArriveAtUpPort, deliver, duplicate, getAddress, processOther, removeDefaultDownPort, removeDefaultUpPort, removeTimerPort, setAddress, setTimeout, setTimeoutAt, timeout |
| Methods inherited from class drcl.DrclObj |
clone |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public SApplication()
public SApplication(java.lang.String id_)
| Method Detail |
public java.io.InputStream getInputStream()
public java.io.OutputStream getOutputStream()
protected void send(int len_)
throws java.io.IOException
len_ bytes of pseudo-data through the down port.
len_ - size of the data to send.
java.io.IOException
protected void send(byte[] buffer_,
int len_)
throws java.io.IOException
len_ bytes of data from buffer_ through the down port.
Pseudo-data is sent if buffer_ is null.
buffer_ - where is put the data to be sent.len_ - size of the data to send.
java.io.IOException
protected int receive()
throws java.io.IOException
java.io.IOException
protected int receive(int size_)
throws java.io.IOException
size_ bytes of data through the down port.
No real data is received.
If size_ is greater than 0, this method will be blocked until exactly
the amount of data is available.
If size_ is less than 0, then the method will grab all the data
available right now.
java.io.IOException
protected int receive(byte[] buffer_)
throws java.io.IOException
buffer_ - the buffer to store the incoming data.
java.io.IOException
protected int receive(byte[] buffer_,
int size_)
throws java.io.IOException
size_ data through the down port.
No real data is received if buffer_ is null.
If size_ is greater than 0, this method will be blocked until exactly
the amount of data is filled to the buffer.
If size_ is less than 0, then the method will grab all the data
available right now till the buffer is full.
buffer_ - the buffer to store the incoming data.
java.io.IOException
protected void process(java.lang.Object data_,
Port inPort_)
ModuleinPort_ and delegates process of data
to the appropriate handler. If a subclass decides to override this method,
then it should call super.process(data_, inPort_) to make those
handlers effective.
process in class ModuleModule.dataArriveAtUpPort(Object, drcl.comp.Port),
Module.dataArriveAtDownPort(Object, drcl.comp.Port),
Module.processOther(Object, drcl.comp.Port)
|
J-Sim v1.2.1-p7 API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||