public class ChannelSession extends AbstractClientChannel
AbstractChannel.GracefulChannelCloseable, AbstractChannel.GracefulState
AbstractCloseable.State
ClientChannel.Streaming
AttributeRepository.AttributeKey<T>
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_INPUT_STREAM_PUMP_CHUNK_SIZE
Default (and also minimum) value of "stdin-pump-chunk-size"
|
static java.lang.String |
INPUT_STREAM_PUMP_CHUNK_SIZE
On some platforms, a call to always throws an
IOException . |
private java.util.concurrent.Future<?> |
pumper |
private CloseableExecutorService |
pumperService |
asyncErr, asyncIn, asyncOut, err, exitSignalHolder, exitStatusHolder, in, invertedErr, invertedIn, invertedOut, opened, openFailureLang, openFailureMsg, openFailureReason, openFuture, out, streaming
channelListenerProxy, channelListeners, eofReceived, eofSent, gracefulFuture, gracefulState, initialized, RESPONSE_BUFFER_GROWTH_FACTOR, service
closeFuture, futureLock, state
log
CHANNEL_EXEC, CHANNEL_SHELL, CHANNEL_SUBSYSTEM
EMPTY
NONE
CLOSE_WAIT_TIMEOUT, DEFAULT_CLOSE_WAIT_TIMEOUT
Constructor and Description |
---|
ChannelSession() |
Modifier and Type | Method and Description |
---|---|
protected void |
closeImmediately0() |
protected void |
doOpen() |
protected Closeable |
getInnerCloseable() |
protected RequestHandler.Result |
handleInternalRequest(java.lang.String req,
boolean wantReply,
Buffer buffer)
Called by
AbstractChannel.handleUnknownChannelRequest(String, boolean, Buffer) in order to allow channel request
handling if none of the registered handlers processed the request - last chance. |
protected RequestHandler.Result |
handleXonXoff(Buffer buffer,
boolean wantReply) |
protected void |
pumpInputStream() |
protected int |
securedRead(java.io.InputStream in,
int maxChunkSize,
byte[] buf,
int off,
int len) |
addChannelSignalRequestHandlers, doWriteData, doWriteExtendedData, getAsyncErr, getAsyncIn, getAsyncOut, getChannelState, getChannelType, getErr, getExitSignal, getExitStatus, getIn, getInvertedErr, getInvertedIn, getInvertedOut, getOut, getStreaming, handleOpenFailure, handleOpenSuccess, handleWindowAdjust, open, open, setErr, setIn, setOut, setStreaming, updateCurrentChannelState, waitFor
addChannelListener, addPendingRequest, addRequestHandler, attributeKeys, clearAttributes, computeAttributeIfAbsent, configureWindow, getAttribute, getAttributesCount, getChannelListenerProxy, getChannelStreamPacketWriterResolver, getExecutorService, getId, getLocalWindow, getParentPropertyResolver, getProperties, getRecipient, getRemoteWindow, getRequestHandlers, getSession, handleChannelRequest, handleClose, handleData, handleEof, handleExtendedData, handleFailure, handleRequest, handleSuccess, handleUnknownChannelRequest, init, invokeChannelSignaller, isEofSent, isEofSignalled, isInitialized, notifyStateChanged, notifyStateChanged, preClose, removeAttribute, removeChannelListener, removePendingRequest, removeRequestHandler, resolveChannelStreamPacketWriterResolver, sendEof, sendResponse, sendWindowAdjust, setAttribute, setChannelStreamPacketWriterResolver, setRecipient, signalChannelClosed, signalChannelClosed, signalChannelInitialized, signalChannelInitialized, signalChannelOpenFailure, signalChannelOpenFailure, signalChannelOpenSuccess, signalChannelOpenSuccess, toString, validateIncomingDataSize, writePacket
doCloseGracefully, doCloseImmediately
addCloseFutureListener, builder, close, getFutureLock, isClosed, isClosing, removeCloseFutureListener
getSimplifiedLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getClientSession, validateCommandExitStatusCode, waitFor
addRequestHandler, addRequestHandlers, getId, getLocalWindow, getRecipient, getRemoteWindow, getRequestHandlers, handleClose, handleData, handleEof, handleExtendedData, handleFailure, handleRequest, handleSuccess, init, isEofSignalled, isInitialized, removeRequestHandler, removeRequestHandlers, resolveAttribute, resolveAttribute
getSession, getSessionContext
addChannelListener, getChannelListenerProxy, removeChannelListener
getBoolean, getBooleanProperty, getCharset, getInteger, getIntProperty, getLong, getLongProperty, getObject, getParentPropertyResolver, getProperties, getString, getStringProperty
clearAttributes, computeAttributeIfAbsent, removeAttribute, setAttribute
attributeKeys, getAttribute, getAttributesCount, ofAttributesMap, ofKeyValuePair
calculatePadLength, writePacket
getChannelStreamPacketWriterResolver, resolveChannelStreamPacketWriter, resolveChannelStreamPacketWriterResolver, setChannelStreamPacketWriterResolver
addCloseFutureListener, close, close, close, getMaxCloseWaitTime, isClosed, isClosing, isOpen, removeCloseFutureListener
public static final java.lang.String INPUT_STREAM_PUMP_CHUNK_SIZE
IOException
. So we need to protect against that and chunk the call into smaller calls. This problem was
found on Windows, JDK 1.6.0_03-b05.public static final int DEFAULT_INPUT_STREAM_PUMP_CHUNK_SIZE
private CloseableExecutorService pumperService
private java.util.concurrent.Future<?> pumper
protected void doOpen() throws java.io.IOException
doOpen
in class AbstractClientChannel
java.io.IOException
protected RequestHandler.Result handleInternalRequest(java.lang.String req, boolean wantReply, Buffer buffer) throws java.io.IOException
AbstractChannel
AbstractChannel.handleUnknownChannelRequest(String, boolean, Buffer)
in order to allow channel request
handling if none of the registered handlers processed the request - last chance.handleInternalRequest
in class AbstractChannel
req
- The request typewantReply
- Whether reply is requestedbuffer
- The Buffer
containing extra request-specific datanull
or Unsupported
and reply is required then a
failure message will be sentjava.io.IOException
- If failed to process the request internallyprotected RequestHandler.Result handleXonXoff(Buffer buffer, boolean wantReply) throws java.io.IOException
java.io.IOException
protected Closeable getInnerCloseable()
getInnerCloseable
in class AbstractClientChannel
protected void closeImmediately0()
protected void pumpInputStream()
protected int securedRead(java.io.InputStream in, int maxChunkSize, byte[] buf, int off, int len) throws java.io.IOException
java.io.IOException