|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.core.messenger.StreamDemultiplexer
public class StreamDemultiplexer
This class implements a demultiplexer that reads packets from an
InputStream
streams and sends them to their associated
Channel
instance.
It is intended to run in a separate thread, terminating if one of the following conditions occur:
close()
is invokedPacketQueue
closes
PacketConnection
,
Demultiplexer
Constructor Summary | |
---|---|
StreamDemultiplexer(ManagedPacketConnection connection,
java.io.InputStream stream)
Construct a new multiplexer |
Method Summary | |
---|---|
void |
close()
Close the multiplexer, freeing any allocated resources. |
boolean |
closed()
Returns true if the demultiplexer is closed |
protected void |
demultiplex()
Stream packets from the connection's input stream, and dispatch them to the appropriate channel |
protected void |
dispatch(org.exolab.core.messenger.Packet packet)
Dispatches a packet to its associated channel |
void |
start()
Start demultiplexing. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StreamDemultiplexer(ManagedPacketConnection connection, java.io.InputStream stream)
connection
- the connection to read packets fromstream
- the stream to read packets from
java.lang.IllegalArgumentException
- if any argument is nullMethod Detail |
---|
public void start()
InputStream
instance, and dispatches them to the appropriate channel.
start
in interface Demultiplexer
java.lang.IllegalStateException
- if the demultiplexer is running, or
has been closedpublic void close()
close
in interface Demultiplexer
public boolean closed()
true
if the demultiplexer is closed
protected void demultiplex()
protected void dispatch(org.exolab.core.messenger.Packet packet)
packet
- the packet to dispatch
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |