The RSE Terminal Services packages provides interfaces and basic utility classes for shell or terminal connections. The classes in this package are especially designed to be extendable by means of the Decorator pattern as well as the Adapter pattern:
IBaseShell
is the basic interface for communicating with a (potentially remote) process
through a channel supporting Streams. The Interface is modeled after the
java.lang.Process
class, but provides some nice enhancements such as a timeout for the
waitFor()
method, as well as an isActive()
method.ITerminalShell
extends IBaseShell, adding methods specific to the presentation of the data
transferred from the (remote) process: it provides for getDefaultEncoding(),
getPtyType(), isLocalEcho() as well as setTerminalSize() methods.AbstractTerminalShell
is an abstract base class that implementers of ITerminalShell must extend.
It provides default implementations of all methods where possible, and
ensures that future evolving of the ITerminalShell interface
can be done without breaking binary compatibility with extenders implementing it.BaseShellDecorator
and
TerminalShellDecorator
abstract base
classes should be used when clients want to add functionality by decorating
an existing IBaseShell or ITerminalShell object they have. Again, extending
these not only saves the extender typing default delegation methods, but also
ensures that they remain binary compatible in case the interfaces evolve.ITerminalService
is the RSE Service Interface, and currently only
provides one factory method launchTerminal()
for creating
a new Terminal Connection.
AbstractTerminalService
must be used as base
class by extenders who wish to implement the ITerminalService, in order to ensure
binary compatibility in case the interface evolves - even though
the AbstractTerminalService is currently empty.IBaseShell
and
BaseShellDecorator
are usable in
any environment, provided that mock objects are provided for Eclipse
IAdaptable and PlatformObject.