Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
com.caucho.hessian.mux.MuxServer
public class MuxServer
extends java.lang.Object
Field Summary | |
private Object | |
private Object | |
private boolean[] | |
private InputStream | |
private boolean | |
private boolean | |
private boolean | |
private boolean | |
private OutputStream |
Constructor Summary | |
| |
|
Method Summary | |
void |
|
(package private) void |
|
(package private) void |
|
(package private) void |
|
(package private) void |
|
InputStream |
|
OutputStream |
|
(package private) boolean | |
void |
|
(package private) InputStream |
|
private void |
|
boolean |
|
boolean |
|
boolean |
|
(package private) OutputStream |
|
(package private) void |
|
private Object READ_LOCK
private Object WRITE_LOCK
private boolean[] inputReady
private InputStream is
private boolean isClient
private boolean isClosed
private boolean isReadLocked
private boolean isWriteLocked
private OutputStream os
public MuxServer()
Null argument constructor.
public MuxServer(InputStream is, OutputStream os, boolean isClient)
Create a new multiplexor with input and output streams.
- Parameters:
is
- the underlying input streamos
- the underlying output streamisClient
- true if this is the connection client.
public void close() throws IOException
Close the mux
(package private) void close(int channel) throws IOException
(package private) void flush(int channel) throws IOException
(package private) void freeReadLock()
Frees the channel for reading.
(package private) void freeWriteLock()
Frees the channel for writing.
public InputStream getInputStream()
Gets the raw input stream. Clients will normally not call this.
public OutputStream getOutputStream()
Gets the raw output stream. Clients will normally not call this.
(package private) boolean getReadLock()
public void init(InputStream is, OutputStream os, boolean isClient)
Initialize the multiplexor with input and output streams.
- Parameters:
is
- the underlying input streamos
- the underlying output streamisClient
- true if this is the connection client.
(package private) InputStream readChannel(int channel) throws IOException
Reads data from a channel.
- Parameters:
channel
- the channel
- Returns:
- true if the channel is valid.
private void readData() throws IOException
Reads data until a channel packet 'C' or error 'E' is received.
public boolean readRequest(MuxInputStream in, MuxOutputStream out) throws IOException
Reads a server request.
public boolean startCall(MuxInputStream in, MuxOutputStream out) throws IOException
Starts a client call.
public boolean startCall(int channel, MuxInputStream in, MuxOutputStream out) throws IOException
Starts a client call.
(package private) OutputStream writeChannel(int channel) throws IOException
Grabs the channel for writing.
- Parameters:
channel
- the channel
- Returns:
- true if the channel has permission to write.
(package private) void yield(int channel) throws IOException