public abstract class AbstractClientChannel extends AbstractChannel implements ClientChannel
AbstractChannel.GracefulChannelCloseable, AbstractChannel.GracefulStateCloseableUtils.AbstractCloseable.StateClientChannel.Streaming| Modifier and Type | Field and Description |
|---|---|
protected ChannelAsyncInputStream |
asyncErr |
protected ChannelAsyncOutputStream |
asyncIn |
protected ChannelAsyncInputStream |
asyncOut |
protected OutputStream |
err |
protected String |
exitSignal |
protected Integer |
exitStatus |
protected InputStream |
in |
protected InputStream |
invertedErr |
protected OutputStream |
invertedIn |
protected InputStream |
invertedOut |
protected AtomicBoolean |
opened |
protected String |
openFailureMsg |
protected int |
openFailureReason |
protected OpenFuture |
openFuture |
protected OutputStream |
out |
protected ClientChannel.Streaming |
streaming |
protected String |
type |
DEFAULT_CHANNEL_CLOSE_TIMEOUT, DEFAULT_PACKET_SIZE, DEFAULT_WINDOW_SIZE, eof, executor, gracefulFuture, gracefulState, handlers, id, localWindow, recipient, remoteWindow, RESPONSE_BUFFER_GROWTH_FACTOR, service, session, shutdownExecutorcloseFuture, lock, statelogCHANNEL_EXEC, CHANNEL_SHELL, CHANNEL_SUBSYSTEM, CLOSED, EOF, EXIT_SIGNAL, EXIT_STATUS, OPENED, STDERR_DATA, STDOUT_DATA, TIMEOUT| Modifier | Constructor and Description |
|---|---|
protected |
AbstractClientChannel(String type) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
doOpen() |
protected void |
doWriteData(byte[] data,
int off,
int len) |
protected void |
doWriteExtendedData(byte[] data,
int off,
int len) |
IoInputStream |
getAsyncErr() |
IoOutputStream |
getAsyncIn() |
IoInputStream |
getAsyncOut() |
OutputStream |
getErr() |
Integer |
getExitStatus() |
InputStream |
getIn() |
protected Closeable |
getInnerCloseable() |
InputStream |
getInvertedErr() |
OutputStream |
getInvertedIn()
Access to an output stream to send data directly to the remote channel.
|
InputStream |
getInvertedOut() |
OutputStream |
getOut() |
ClientChannel.Streaming |
getStreaming() |
void |
handleOpenFailure(Buffer buffer)
For a client channel, this method will be called internally by the
session when the server has rejected this channel opening.
|
void |
handleOpenSuccess(int recipient,
int rwSize,
int packetSize,
Buffer buffer)
For a client channel, this method will be called internally by the
session when the confirmation has been received.
|
void |
handleWindowAdjust(Buffer buffer) |
OpenFuture |
open() |
OpenFuture |
open(int recipient,
int rwSize,
int packetSize,
Buffer buffer)
For a server channel, this method will actually open the channel
|
void |
setErr(OutputStream err) |
void |
setIn(InputStream in)
Set an input stream that will be read by this channel and forwarded to
the remote channel.
|
void |
setOut(OutputStream out) |
void |
setStreaming(ClientChannel.Streaming streaming) |
int |
waitFor(int mask,
long timeout) |
addRequestHandler, configureWindow, doCloseImmediately, getExecutorService, getId, getLocalWindow, getRecipient, getRemoteWindow, getSession, handleClose, handleData, handleEof, handleExtendedData, handleFailure, handleRequest, init, isEofSignalled, isShutdownOnExit, notifyStateChanged, sendEof, sendResponse, sendWindowAdjust, setEofSignalled, setExecutorService, setShutdownOnExit, toString, writePacketdoCloseGracefullybuilder, close, isClosed, isClosing, preCloseclose, isOpenclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcloseprotected final AtomicBoolean opened
protected final String type
protected ClientChannel.Streaming streaming
protected ChannelAsyncOutputStream asyncIn
protected ChannelAsyncInputStream asyncOut
protected ChannelAsyncInputStream asyncErr
protected InputStream in
protected OutputStream invertedIn
protected OutputStream out
protected InputStream invertedOut
protected OutputStream err
protected InputStream invertedErr
protected Integer exitStatus
protected String exitSignal
protected int openFailureReason
protected String openFailureMsg
protected OpenFuture openFuture
protected AbstractClientChannel(String type)
public ClientChannel.Streaming getStreaming()
getStreaming in interface ClientChannelpublic void setStreaming(ClientChannel.Streaming streaming)
setStreaming in interface ClientChannelpublic IoOutputStream getAsyncIn()
getAsyncIn in interface ClientChannelpublic IoInputStream getAsyncOut()
getAsyncOut in interface ClientChannelpublic IoInputStream getAsyncErr()
getAsyncErr in interface ClientChannelpublic OutputStream getInvertedIn()
ClientChannelClientChannel.setIn(java.io.InputStream) method
and having the channel polling for data in that stream.getInvertedIn in interface ClientChannelpublic InputStream getIn()
public void setIn(InputStream in)
ClientChannelClientChannel.getInvertedIn() method instead and write data directly.setIn in interface ClientChannelin - an InputStream to be polled and forwardedpublic InputStream getInvertedOut()
getInvertedOut in interface ClientChannelpublic OutputStream getOut()
public void setOut(OutputStream out)
setOut in interface ClientChannelpublic InputStream getInvertedErr()
getInvertedErr in interface ClientChannelpublic OutputStream getErr()
public void setErr(OutputStream err)
setErr in interface ClientChannelprotected Closeable getInnerCloseable()
getInnerCloseable in class AbstractChannelpublic int waitFor(int mask,
long timeout)
waitFor in interface ClientChannelpublic OpenFuture open() throws IOException
open in interface ClientChannelIOExceptionpublic OpenFuture open(int recipient, int rwSize, int packetSize, Buffer buffer)
Channelrecipient - Recipient identifierrwSize - Read/Write window sizepacketSize - Preferred maximum packet sizebuffer - Incoming Buffer that triggered the call.
Note: the buffer's read position is exactly
after the information that read to this call
was decodedOpenFuture for the channel open requestpublic void handleOpenSuccess(int recipient,
int rwSize,
int packetSize,
Buffer buffer)
Channelrecipient - Recipient identifierrwSize - Read/Write window sizepacketSize - Preferred maximum packet sizebuffer - Incoming Buffer that triggered the call.
Note: the buffer's read position is exactly
after the information that read to this call
was decodedprotected abstract void doOpen()
throws IOException
IOExceptionpublic void handleOpenFailure(Buffer buffer)
Channelbuffer - Incoming Buffer that triggered the call.
Note: the buffer's read position is exactly
after the information that read to this call
was decodedprotected void doWriteData(byte[] data,
int off,
int len)
throws IOException
doWriteData in class AbstractChannelIOExceptionprotected void doWriteExtendedData(byte[] data,
int off,
int len)
throws IOException
doWriteExtendedData in class AbstractChannelIOExceptionpublic void handleWindowAdjust(Buffer buffer) throws IOException
handleWindowAdjust in class AbstractChannelIOExceptionpublic Integer getExitStatus()
getExitStatus in interface ClientChannelCopyright © 2008–2015 The Apache Software Foundation. All rights reserved.