public abstract class AbstractChannel extends CloseableUtils.AbstractInnerCloseable implements Channel
| Modifier and Type | Field and Description |
|---|---|
protected static int |
CLOSE_RECV |
protected static int |
CLOSE_SENT |
static int |
DEFAULT_PACKET_SIZE |
static int |
DEFAULT_WINDOW_SIZE |
protected boolean |
eof |
protected java.util.concurrent.atomic.AtomicInteger |
gracefulState |
protected java.util.List<RequestHandler<Channel>> |
handlers |
protected int |
id |
protected Window |
localWindow |
protected int |
recipient |
protected Window |
remoteWindow |
protected ConnectionService |
service |
protected Session |
session |
CLOSED, closeFuture, GRACEFUL, IMMEDIATE, lock, log, OPENED, state| Constructor and Description |
|---|
AbstractChannel() |
| Modifier and Type | Method and Description |
|---|---|
void |
addRequestHandler(RequestHandler<Channel> handler) |
protected void |
configureWindow() |
protected abstract void |
doWriteData(byte[] data,
int off,
int len) |
protected abstract void |
doWriteExtendedData(byte[] data,
int off,
int len) |
protected Closeable |
getGracefulCloseable() |
int |
getId() |
protected Closeable |
getInnerCloseable() |
Window |
getLocalWindow() |
int |
getRecipient() |
Window |
getRemoteWindow() |
Session |
getSession() |
void |
handleClose() |
void |
handleData(Buffer buffer) |
void |
handleEof() |
void |
handleExtendedData(Buffer buffer) |
void |
handleFailure() |
void |
handleRequest(Buffer buffer) |
void |
handleWindowAdjust(Buffer buffer) |
void |
init(ConnectionService service,
Session session,
int id) |
protected void |
notifyStateChanged() |
protected void |
postClose() |
protected void |
sendEof() |
protected void |
sendWindowAdjust(int len) |
java.lang.String |
toString() |
protected void |
writePacket(Buffer buffer) |
doCloseGracefully, doCloseImmediatelycloseclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclose, handleOpenFailure, handleOpenSuccess, openpublic static final int DEFAULT_WINDOW_SIZE
public static final int DEFAULT_PACKET_SIZE
protected static final int CLOSE_SENT
protected static final int CLOSE_RECV
protected final Window localWindow
protected final Window remoteWindow
protected ConnectionService service
protected Session session
protected int id
protected int recipient
protected volatile boolean eof
protected java.util.concurrent.atomic.AtomicInteger gracefulState
protected final java.util.List<RequestHandler<Channel>> handlers
public void addRequestHandler(RequestHandler<Channel> handler)
public int getRecipient()
getRecipient in interface Channelpublic Window getLocalWindow()
getLocalWindow in interface Channelpublic Window getRemoteWindow()
getRemoteWindow in interface Channelpublic Session getSession()
getSession in interface Channelpublic void handleRequest(Buffer buffer) throws java.io.IOException
handleRequest in interface Channeljava.io.IOExceptionpublic void init(ConnectionService service, Session session, int id)
protected void notifyStateChanged()
public void handleClose()
throws java.io.IOException
handleClose in interface Channeljava.io.IOExceptionprotected Closeable getGracefulCloseable()
protected Closeable getInnerCloseable()
getInnerCloseable in class CloseableUtils.AbstractInnerCloseableprotected void postClose()
postClose in class CloseableUtils.AbstractCloseableprotected void writePacket(Buffer buffer) throws java.io.IOException
java.io.IOExceptionpublic void handleData(Buffer buffer) throws java.io.IOException
handleData in interface Channeljava.io.IOExceptionpublic void handleExtendedData(Buffer buffer) throws java.io.IOException
handleExtendedData in interface Channeljava.io.IOExceptionpublic void handleEof()
throws java.io.IOException
public void handleWindowAdjust(Buffer buffer) throws java.io.IOException
handleWindowAdjust in interface Channeljava.io.IOExceptionpublic void handleFailure()
throws java.io.IOException
handleFailure in interface Channeljava.io.IOExceptionprotected abstract void doWriteData(byte[] data,
int off,
int len)
throws java.io.IOException
java.io.IOExceptionprotected abstract void doWriteExtendedData(byte[] data,
int off,
int len)
throws java.io.IOException
java.io.IOExceptionprotected void sendEof()
throws java.io.IOException
java.io.IOExceptionprotected void configureWindow()
protected void sendWindowAdjust(int len)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2008-2014 The Apache Software Foundation. All Rights Reserved.