|
RSE Release 3.3 |
|||||||||
| 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.AbstractTerminalShell
public abstract class AbstractTerminalShell
Abstract base class for clients to create an ITerminalShell instance.
This abstract base class provides valid default implementations for all
ITerminalShell methods where possible. Clients should extend this
base class rather than implementing ITerminalShell directly, in order to
remain compatible when the ITerminalShell interface is evolved in the future.
| Constructor Summary | |
|---|---|
AbstractTerminalShell()
|
|
| Method Summary | |
|---|---|
int |
exitValue()
Return the exit value of the Process connected by this shell. |
String |
getDefaultEncoding()
Return the default encoding that the terminal service had specified when creating this terminal connection, or that's known from the remote side to be expected. |
InputStream |
getErrorStream()
Get a remote-to-local InputStream connected to the standard error output of the underlying Process. |
String |
getPtyType()
Get the Terminal Type that's expected on this connection. |
protected long |
getWaitForPollInterval()
Return the interval (in milliseconds) for polling the method during the waitFor(long) method. |
boolean |
isLocalEcho()
Test if local echo is needed on this terminal connection. |
void |
setTerminalSize(int newWidth,
int newHeight)
Notify the remote site that the size of the terminal has changed. |
boolean |
waitFor(long timeout)
Wait for the shell to terminate. |
| Methods inherited from class org.eclipse.core.runtime.PlatformObject |
|---|
getAdapter |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.eclipse.rse.services.terminals.IBaseShell |
|---|
exit, getInputStream, getOutputStream, isActive |
| Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
|---|
getAdapter |
| Constructor Detail |
|---|
public AbstractTerminalShell()
| Method Detail |
|---|
public String getDefaultEncoding()
ITerminalShellnull.
TODO I'm not actually sure if this method is a good idea. Perhaps we
should use the IAdaptable mechanism for dealing with encodings, since our
shells basically deal with binary data only.
getDefaultEncoding in interface ITerminalShellnull if
unknown.public String getPtyType()
ITerminalShell
getPtyType in interface ITerminalShellnull
if the ITerminalShell does not know what kind of Terminal Type is
expected.public boolean isLocalEcho()
ITerminalShellfalse if in doubt.
isLocalEcho in interface ITerminalShelltrue if a local echo is needed.
public void setTerminalSize(int newWidth,
int newHeight)
ITerminalShell
setTerminalSize in interface ITerminalShellpublic InputStream getErrorStream()
IBaseShellnull 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 IBaseShellnull 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 int exitValue()
IBaseShell
exitValue in interface IBaseShellProcess.exitValue()protected long getWaitForPollInterval()
waitFor(long) method. Subclasses may override
to return different poll intervals.
The interval may be changed dynamically as appropriate for the current
state of this shell. That way, wait polling mechanisms such as
exponential backoff can be implemented.
Or, a concrete implementation that supports a notification mechanism for
knowing when the shell terminates, can use this to tweak the waitFor()
method by returning Long.MAX_VALUE here (wait forever), but calling
Object.notifyAll() when the shell is dead.
public boolean waitFor(long timeout)
throws InterruptedException
getWaitForPollInterval().
waitFor in interface IBaseShelltimeout - 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.waitFor(long)
|
RSE Release 3.3 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||