|
RSE Release 3.4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.runtime.PlatformObject
org.eclipse.rse.services.terminals.BaseShellDecorator
public abstract class BaseShellDecorator
Abstract base class for clients to decorate an IBaseShell instance they have with additional functionality. Typically, such additional functionality can be provided either by additional knowledge about the underlying system or process, or by analyzing the input and output streams for some well-known data that gives such additional knowledge.
Field Summary | |
---|---|
protected IBaseShell |
fDelegate
|
Constructor Summary | |
---|---|
BaseShellDecorator(IBaseShell delegate)
|
Method Summary | |
---|---|
void |
exit()
Exit this shell. |
int |
exitValue()
Return the exit value of the Process connected by this shell. |
Object |
getAdapter(Class adapterType)
|
InputStream |
getErrorStream()
Get a remote-to-local InputStream connected to the standard error output of the underlying Process. |
InputStream |
getInputStream()
Get a remote-to-local InputStream connected to the standard output of the underlying Process. |
OutputStream |
getOutputStream()
Get a local-to-remote OutputStream connected to the standard input of the underlying Process. |
boolean |
isActive()
Test whether this connection is active. |
boolean |
waitFor(long timeout)
Block the calling Thread until this shell is no longer active, or the specified timeout has elapsed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final IBaseShell fDelegate
Constructor Detail |
---|
public BaseShellDecorator(IBaseShell delegate)
Method Detail |
---|
public void exit()
IBaseShell
IBaseShell.waitFor(long)
after calling
this method to know when the shell is really terminated. At any rate, the
exit() method returns quickly and guarantees that the shell will be
terminated as soon as possible, after any required (and possible) cleanup
is finished.
exit
in interface IBaseShell
Process.destroy()
public int exitValue()
IBaseShell
exitValue
in interface IBaseShell
Process.exitValue()
public InputStream getErrorStream()
IBaseShell
null
if they do not support
separate Streams for output and error.
Clients must not close the obtained InputStream themselves, since the
behavior that this may have on the underlying shell or process is
undefined. Use {#exit()} instead to terminate the shell if that is
desired, it will close all relevant Streams.
getErrorStream
in interface IBaseShell
null
if separate output and error
streams are not supported. Error output will be merged with the
Stream obtained from IBaseShell.getInputStream()
in that case.public InputStream getInputStream()
IBaseShell
getInputStream
in interface IBaseShell
public OutputStream getOutputStream()
IBaseShell
getOutputStream
in interface IBaseShell
public boolean isActive()
IBaseShell
isActive
in interface IBaseShell
true
if the connection is active, i.e. the Process
underlying this connection is running, and the Streams connected
to it are not closed.IBaseShell.exitValue()
public boolean waitFor(long timeout) throws InterruptedException
IBaseShell
false
, the shell is no longer
active, so an IBaseShell.exitValue()
may be obtained.
waitFor
in interface IBaseShell
timeout
- the maximum time (in milliseconds) to wait.
Implementations may return sooner even if the underlying
Process has not yet terminated, so clients always need to keep
track of time themselves and need to check the return value. A
timeout value of zero causes this method to not limit the wait
time. Negative wait time has undefined behavior.
true
if the Shell is still active after waiting
(e.g. because the timeout has elapsed); false
if
the shell is no longer active.
InterruptedException
- if the waiting Thread has been interrupted,
e.g. because the main application is shutting down.IBaseShell.isActive()
public Object getAdapter(Class adapterType)
getAdapter
in interface IAdaptable
getAdapter
in class PlatformObject
|
RSE Release 3.4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |