public abstract class AbstractClientChannel extends AbstractChannel implements ClientChannel
| Modifier and Type | Field and Description |
|---|---|
protected java.io.OutputStream |
err |
protected java.lang.String |
exitSignal |
protected java.lang.Integer |
exitStatus |
protected java.io.InputStream |
in |
protected java.io.InputStream |
invertedErr |
protected java.io.OutputStream |
invertedIn |
protected java.io.InputStream |
invertedOut |
protected boolean |
opened |
protected java.lang.String |
openFailureMsg |
protected int |
openFailureReason |
protected OpenFuture |
openFuture |
protected java.io.OutputStream |
out |
protected java.lang.String |
type |
CLOSE_RECV, CLOSE_SENT, DEFAULT_PACKET_SIZE, DEFAULT_WINDOW_SIZE, eof, gracefulState, handlers, id, localWindow, recipient, remoteWindow, service, sessionCLOSED, closeFuture, GRACEFUL, IMMEDIATE, lock, log, OPENED, stateCHANNEL_EXEC, CHANNEL_SHELL, CHANNEL_SUBSYSTEM, CLOSED, EOF, EXIT_SIGNAL, EXIT_STATUS, OPENED, STDERR_DATA, STDOUT_DATA, TIMEOUT| Modifier | Constructor and Description |
|---|---|
protected |
AbstractClientChannel(java.lang.String type) |
| Modifier and Type | Method and Description |
|---|---|
CloseFuture |
close(boolean immediately)
Close this resource asynchronously and return a future.
|
protected abstract void |
doOpen() |
protected void |
doWriteData(byte[] data,
int off,
int len) |
protected void |
doWriteExtendedData(byte[] data,
int off,
int len) |
java.io.OutputStream |
getErr() |
java.lang.Integer |
getExitStatus() |
java.io.InputStream |
getIn() |
java.io.InputStream |
getInvertedErr() |
java.io.OutputStream |
getInvertedIn()
Access to an output stream to send data directly to the remote channel.
|
java.io.InputStream |
getInvertedOut() |
java.io.OutputStream |
getOut() |
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 rmpsize,
Buffer buffer)
For a client channel, this method will be called internally by the session when the confirmation
has been received.
|
protected OpenFuture |
internalOpen() |
OpenFuture |
open(int recipient,
int rwsize,
int rmpsize,
Buffer buffer)
For a server channel, this method will actually open the channel
|
protected void |
postClose() |
void |
setErr(java.io.OutputStream err) |
void |
setIn(java.io.InputStream in)
Set an input stream that will be read by this channel and forwarded to
the remote channel.
|
void |
setOut(java.io.OutputStream out) |
int |
waitFor(int mask,
long timeout) |
addRequestHandler, configureWindow, getGracefulCloseable, getId, getInnerCloseable, getLocalWindow, getRecipient, getRemoteWindow, getSession, handleClose, handleData, handleEof, handleExtendedData, handleFailure, handleRequest, handleWindowAdjust, init, notifyStateChanged, sendEof, sendWindowAdjust, toString, writePacketdoCloseGracefully, doCloseImmediatelyclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitopenprotected volatile boolean opened
protected final java.lang.String type
protected java.io.InputStream in
protected java.io.OutputStream invertedIn
protected java.io.OutputStream out
protected java.io.InputStream invertedOut
protected java.io.OutputStream err
protected java.io.InputStream invertedErr
protected java.lang.Integer exitStatus
protected java.lang.String exitSignal
protected int openFailureReason
protected java.lang.String openFailureMsg
protected OpenFuture openFuture
public java.io.OutputStream getInvertedIn()
ClientChannelClientChannel.setIn(java.io.InputStream) method
and having the channel polling for data in that stream.getInvertedIn in interface ClientChannelpublic java.io.InputStream getIn()
public void setIn(java.io.InputStream in)
ClientChannelClientChannel.getInvertedIn() method instead and write data directly.setIn in interface ClientChannelin - an InputStream to be polled and forwardedpublic java.io.InputStream getInvertedOut()
getInvertedOut in interface ClientChannelpublic java.io.OutputStream getOut()
public void setOut(java.io.OutputStream out)
setOut in interface ClientChannelpublic java.io.InputStream getInvertedErr()
getInvertedErr in interface ClientChannelpublic java.io.OutputStream getErr()
public void setErr(java.io.OutputStream err)
setErr in interface ClientChannelpublic CloseFuture close(boolean immediately)
Closeableclose in interface ClientChannelclose in interface Channelclose in interface Closeableclose in class CloseableUtils.AbstractCloseableimmediately - true if the resource should be shut down abruptly,
false for a graceful closeprotected void postClose()
postClose in class AbstractChannelpublic int waitFor(int mask,
long timeout)
waitFor in interface ClientChannelprotected OpenFuture internalOpen() throws java.io.IOException
java.io.IOExceptionpublic OpenFuture open(int recipient, int rwsize, int rmpsize, Buffer buffer)
Channelpublic void handleOpenSuccess(int recipient,
int rwsize,
int rmpsize,
Buffer buffer)
ChannelhandleOpenSuccess in interface Channelprotected abstract void doOpen()
throws java.io.IOException
java.io.IOExceptionpublic void handleOpenFailure(Buffer buffer)
ChannelhandleOpenFailure in interface Channelprotected void doWriteData(byte[] data,
int off,
int len)
throws java.io.IOException
doWriteData in class AbstractChanneljava.io.IOExceptionprotected void doWriteExtendedData(byte[] data,
int off,
int len)
throws java.io.IOException
doWriteExtendedData in class AbstractChanneljava.io.IOExceptionpublic java.lang.Integer getExitStatus()
getExitStatus in interface ClientChannelCopyright © 2008-2014 The Apache Software Foundation. All Rights Reserved.