public abstract class AbstractChannel extends CloseableUtils.AbstractInnerCloseable implements Channel
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractChannel.GracefulChannelCloseable |
protected static class |
AbstractChannel.GracefulState |
CloseableUtils.AbstractCloseable.State| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PACKET_SIZE |
static int |
DEFAULT_WINDOW_SIZE |
protected boolean |
eof |
protected DefaultCloseFuture |
gracefulFuture |
protected AtomicReference<AbstractChannel.GracefulState> |
gracefulState |
protected List<RequestHandler<Channel>> |
handlers |
protected int |
id |
protected Window |
localWindow |
protected int |
recipient |
protected Window |
remoteWindow |
protected ConnectionService |
service |
protected Session |
session |
closeFuture, lock, log, state| Constructor and Description |
|---|
AbstractChannel() |
| Modifier and Type | Method and Description |
|---|---|
void |
addRequestHandler(RequestHandler<Channel> handler) |
protected void |
configureWindow() |
protected void |
doCloseImmediately()
doCloseImmediately is called once and only once
with state == Immediate
Overriding methods should always call the base implementation.
|
protected abstract void |
doWriteData(byte[] data,
int off,
int len) |
protected abstract void |
doWriteExtendedData(byte[] data,
int off,
int len) |
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 |
sendEof() |
protected void |
sendWindowAdjust(int len) |
String |
toString() |
protected void |
writePacket(Buffer buffer) |
doCloseGracefullybuilder, close, isClosed, isClosing, preCloseclone, 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 final Window localWindow
protected final Window remoteWindow
protected ConnectionService service
protected Session session
protected int id
protected int recipient
protected volatile boolean eof
protected AtomicReference<AbstractChannel.GracefulState> gracefulState
protected final DefaultCloseFuture gracefulFuture
protected final 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 IOException
handleRequest in interface ChannelIOExceptionpublic void init(ConnectionService service, Session session, int id)
protected void notifyStateChanged()
public void handleClose()
throws IOException
handleClose in interface ChannelIOExceptionprotected Closeable getInnerCloseable()
getInnerCloseable in class CloseableUtils.AbstractInnerCloseableprotected void doCloseImmediately()
CloseableUtils.AbstractCloseabledoCloseImmediately in class CloseableUtils.AbstractInnerCloseableprotected void writePacket(Buffer buffer) throws IOException
IOExceptionpublic void handleData(Buffer buffer) throws IOException
handleData in interface ChannelIOExceptionpublic void handleExtendedData(Buffer buffer) throws IOException
handleExtendedData in interface ChannelIOExceptionpublic void handleEof()
throws IOException
handleEof in interface ChannelIOExceptionpublic void handleWindowAdjust(Buffer buffer) throws IOException
handleWindowAdjust in interface ChannelIOExceptionpublic void handleFailure()
throws IOException
handleFailure in interface ChannelIOExceptionprotected abstract void doWriteData(byte[] data,
int off,
int len)
throws IOException
IOExceptionprotected abstract void doWriteExtendedData(byte[] data,
int off,
int len)
throws IOException
IOExceptionprotected void sendEof()
throws IOException
IOExceptionprotected void configureWindow()
protected void sendWindowAdjust(int len)
throws IOException
IOExceptionCopyright © 2008–2014 The Apache Software Foundation. All rights reserved.