|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
org.exolab.core.mipc.MultiplexConnection
org.exolab.core.mipc.MultiplexSSLConnection
public class MultiplexSSLConnection
The MultiplexSSLConnection encapsulates a single network connection. It allows for multiple channels or multiplexed message streams. The object is thread-safe and uses threads within it to do its job. The design for the Multiplexed streaming borrows concepts from the book "Java Network Programming : A Complete Guide to Networking, Streams, and Distributed Computing", by Merlin Hughes, Michael Shoffner, Derek Hamner The MultiplexConnection is designed as follows: - users of the connection register themselves as channels. each channel is given a stream to place outbound messages on, and gives the MC a stream to write inbound messages on. Typically this "inbound" stream is a Queue Stream and the user sucks messages off of the queue on a separate thread. That way the multiplex delivery mechanism does not have to wait for a channel handler to process a message. - As channel producers send messages, they are multiplexed and placed on a queue for outbound delivery. A separate MessageCopier thread takes messages from this queue and sends them onto to the "raw" outbound stream. - Inbound messages are handled by Demultiplixer. The Demux manages a list of channels. It unwraps a packet and uses the name encoded in the packet to pass the message onto an output stream. This outputstream is the one passed into "register" by the channel consumer/producer. The Demux runs within the same thread as MultiplexConnection. It is important to note: All activity on the "raw" inbound and outbound streams are synchronized, as well as the objects used to build the MultiplexConnection. So everything is thread-safe.
MultiplexConnectionServer
,
MessageCopier
,
Demultiplexer
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class org.exolab.core.mipc.MultiplexConnection |
---|
_finished |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
MultiplexSSLConnection(javax.net.ssl.SSLSocket socket)
Creates a MultiplexSSLConnection on top of an existing Socket |
|
MultiplexSSLConnection(java.lang.String host,
int port)
Creates new MultiplexSSLConnection on the specified host and port. |
|
MultiplexSSLConnection(java.lang.ThreadGroup group,
javax.net.ssl.SSLSocket socket)
Creates a MultiplexSSLConnection on top of an existing Socket |
Method Summary |
---|
Methods inherited from class org.exolab.core.mipc.MultiplexConnection |
---|
deregister, disconnected, finish, getHost, getPort, init, register, run, setDisconnectionEventListener |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MultiplexSSLConnection(java.lang.String host, int port) throws java.io.IOException
host
- the host name to create a socket connection toport
- the port to connect to
java.io.IOException
public MultiplexSSLConnection(javax.net.ssl.SSLSocket socket) throws java.io.IOException
socket
- The existing socket to wrap.
java.io.IOException
public MultiplexSSLConnection(java.lang.ThreadGroup group, javax.net.ssl.SSLSocket socket) throws java.io.IOException
group
- the thread group that the connection belongs tosocket
- the existing socket to wrap
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |