|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.mina.io.IoHandlerAdapter
org.apache.mina.io.handler.StreamIoHandler
public abstract class StreamIoHandler
A IoHandler that adapts asynchronous MINA events to stream I/O.
Please extend this class and implement
processStreamIo(IoSession, InputStream, OutputStream) to
execute your stream I/O logic; please note that you must forward
the process request to other thread or thread pool.
| Constructor Summary | |
|---|---|
protected |
StreamIoHandler()
|
| Method Summary | |
|---|---|
void |
dataRead(IoSession session,
ByteBuffer buf)
Forwards read data to input stream. |
void |
exceptionCaught(IoSession session,
java.lang.Throwable cause)
Forwards caught exceptions to input stream. |
int |
getReadTimeout()
Returns read timeout in seconds. |
int |
getWriteTimeout()
Returns write timeout in seconds. |
protected abstract void |
processStreamIo(IoSession session,
java.io.InputStream in,
java.io.OutputStream out)
Implement this method to execute your stream I/O logic; please note that you must forward the process request to other thread or thread pool. |
void |
sessionClosed(IoSession session)
Closes input stream. |
void |
sessionIdle(IoSession session,
IdleStatus status)
Handles read timeout. |
void |
sessionOpened(IoSession session)
Initializes streams and timeout settings. |
void |
setReadTimeout(int readTimeout)
Sets read timeout in seconds. |
void |
setWriteTimeout(int writeTimeout)
Sets write timeout in seconds. |
| Methods inherited from class org.apache.mina.io.IoHandlerAdapter |
|---|
dataWritten, sessionCreated |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected StreamIoHandler()
| Method Detail |
|---|
protected abstract void processStreamIo(IoSession session,
java.io.InputStream in,
java.io.OutputStream out)
public int getReadTimeout()
public void setReadTimeout(int readTimeout)
public int getWriteTimeout()
public void setWriteTimeout(int writeTimeout)
public void sessionOpened(IoSession session)
sessionOpened in interface IoHandlersessionOpened in class IoHandlerAdapterpublic void sessionClosed(IoSession session)
sessionClosed in interface IoHandlersessionClosed in class IoHandlerAdapter
public void dataRead(IoSession session,
ByteBuffer buf)
dataRead in interface IoHandlerdataRead in class IoHandlerAdapter
public void exceptionCaught(IoSession session,
java.lang.Throwable cause)
exceptionCaught in interface IoHandlerexceptionCaught in class IoHandlerAdapter
public void sessionIdle(IoSession session,
IdleStatus status)
sessionIdle in interface IoHandlersessionIdle in class IoHandlerAdapter
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||