public abstract class AbstractClientChannel extends AbstractChannel implements ClientChannel
Modifier and Type | Field and Description |
---|---|
protected OutputStream |
err |
protected String |
exitSignal |
protected Integer |
exitStatus |
protected InputStream |
in |
protected InputStream |
invertedErr |
protected OutputStream |
invertedIn |
protected InputStream |
invertedOut |
protected boolean |
opened |
protected String |
openFailureMsg |
protected int |
openFailureReason |
protected OpenFuture |
openFuture |
protected OutputStream |
out |
protected String |
type |
CLOSE_RECV, CLOSE_SENT, DEFAULT_PACKET_SIZE, DEFAULT_WINDOW_SIZE, eof, gracefulState, handlers, id, localWindow, recipient, remoteWindow, service, session
CLOSED, closeFuture, GRACEFUL, IMMEDIATE, lock, log, OPENED, state
CHANNEL_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 |
---|---|
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) |
OutputStream |
getErr() |
Integer |
getExitStatus() |
InputStream |
getIn() |
InputStream |
getInvertedErr() |
OutputStream |
getInvertedIn()
Access to an output stream to send data directly to the remote channel.
|
InputStream |
getInvertedOut() |
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(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) |
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, writePacket
doCloseGracefully, doCloseImmediately
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
open
protected volatile boolean opened
protected final String type
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 OutputStream getInvertedIn()
ClientChannel
ClientChannel.setIn(java.io.InputStream)
method
and having the channel polling for data in that stream.getInvertedIn
in interface ClientChannel
public InputStream getIn()
public void setIn(InputStream in)
ClientChannel
ClientChannel.getInvertedIn()
method instead and write data directly.setIn
in interface ClientChannel
in
- an InputStream to be polled and forwardedpublic InputStream getInvertedOut()
getInvertedOut
in interface ClientChannel
public OutputStream getOut()
public void setOut(OutputStream out)
setOut
in interface ClientChannel
public InputStream getInvertedErr()
getInvertedErr
in interface ClientChannel
public OutputStream getErr()
public void setErr(OutputStream err)
setErr
in interface ClientChannel
public CloseFuture close(boolean immediately)
Closeable
close
in interface ClientChannel
close
in interface Channel
close
in interface Closeable
close
in class CloseableUtils.AbstractCloseable
immediately
- true
if the resource should be shut down abruptly,
false
for a graceful closeprotected void postClose()
postClose
in class AbstractChannel
public int waitFor(int mask, long timeout)
waitFor
in interface ClientChannel
protected OpenFuture internalOpen() throws IOException
IOException
public OpenFuture open(int recipient, int rwsize, int rmpsize, Buffer buffer)
Channel
public void handleOpenSuccess(int recipient, int rwsize, int rmpsize, Buffer buffer)
Channel
handleOpenSuccess
in interface Channel
protected abstract void doOpen() throws IOException
IOException
public void handleOpenFailure(Buffer buffer)
Channel
handleOpenFailure
in interface Channel
protected void doWriteData(byte[] data, int off, int len) throws IOException
doWriteData
in class AbstractChannel
IOException
protected void doWriteExtendedData(byte[] data, int off, int len) throws IOException
doWriteExtendedData
in class AbstractChannel
IOException
public Integer getExitStatus()
getExitStatus
in interface ClientChannel
Copyright © 2008–2015 The Apache Software Foundation. All rights reserved.