|
 |
|
|
org.eclipse.rse.services.terminals
Class AbstractDelegatingTerminalService
java.lang.Object
org.eclipse.core.runtime.PlatformObject
org.eclipse.rse.services.AbstractService
org.eclipse.rse.services.terminals.AbstractTerminalService
org.eclipse.rse.services.terminals.AbstractDelegatingTerminalService
-
All Implemented Interfaces:
-
IAdaptable,
IService,
ITerminalService
-
public abstract class AbstractDelegatingTerminalService
- extends
AbstractTerminalService
Base class that can be used for decorating an existing terminal service with
additional functionality. By default, all method calls are passed through to
the original service.
-
Since:
- 3.1
Methods inherited from class java.lang.
Object
|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
|
AbstractDelegatingTerminalService
public AbstractDelegatingTerminalService()
getRealTerminalService
public abstract
ITerminalService getRealTerminalService()
-
launchTerminal
public
ITerminalShell launchTerminal(
String ptyType,
String encoding,
String[] environment,
String initialWorkingDirectory,
String commandToRun,
IProgressMonitor monitor)
throws
SystemMessageException
-
Description copied from interface:
ITerminalService
- Launch a new terminal connection, also known as shell session with
Streams.
-
-
Parameters:
-
ptyType - requested terminal type for the new Terminal. Since not
all Terminal implementations support specifying the Terminal
Type, there is no guarantee that a particular setting has any
effect. Use null to fall back to a default
terminal type. -
encoding - Stream encoding to use for sending initial working
directory and initial commandToRun, and to return on
ITerminalShell.getDefaultEncoding() request. Use
null to fall back to a default encoding. The
Terminal Service will make efforts to determine a proper
default encoding on the remote side but this is not guaranteed
to be correct. -
environment - Array of environment variable Strings of the form
"var=text". Since not all terminal implementations support the
passing of environment variables, there is no guarantee that
the created shell will actually have the specified environment
set. Passing null is allowed in order to
specify that no specific environment needs to be passed. -
initialWorkingDirectory - initial working directory or empty String
("") if not relevant. The remote shell will launch in a
directory of its own choice in that case (typically a user's
home directory). -
commandToRun - initial command to send to the remote side. -
monitor - Progress Monitor for monitoring and cancellation during
connection creation.
-
Returns:
- the terminal connection object. Note that the connection may not
actually be usable in case the remote side allows opening a
channel but immediately closes it again. In this case,
IBaseShell.getInputStream() will throw an
exception or be closed from the very beginning.
-
Throws:
-
SystemMessageException
- in case an error occurred or the user
chose to cancel the operation via the progress monitor.
getDescription
public
String getDescription()
-
Description copied from interface:
IService
- Get the description of this Service as a translated, UI-visible String.
Extenders are expected to override this method.
-
-
Specified by:
-
getDescription
in interface
IService
-
Overrides:
-
getDescription
in class
AbstractService
-
-
Returns:
- the description of this Service.
getName
public
String getName()
-
Description copied from interface:
IService
- Get the name of this Service as a translated, UI-visible String.
Extenders are expected to override this method.
-
-
Specified by:
-
getName
in interface
IService
-
Overrides:
-
getName
in class
AbstractService
-
-
Returns:
- the name of this Service.
initService
public void initService(
IProgressMonitor monitor)
throws
SystemMessageException
-
Description copied from class:
AbstractService
- Default implementation of initService. Extenders who override this method
must call
super.initService(monitor) as the first call in
their implementation.
-
-
Specified by:
-
initService
in interface
IService
-
Overrides:
-
initService
in class
AbstractService
-
-
Parameters:
-
monitor - A progress monitor to provide progress of long-running
operation. There is no guarantee that cancellation is actually
supported by a Service since it would leave the service in a
potentially inconsistent, partially initialized state.
-
Throws:
-
SystemMessageException
- if an error occurs during initialization.
uninitService
public void uninitService(
IProgressMonitor monitor)
-
Description copied from class:
AbstractService
- Default implementation of uninitService. Extenders who override this
method must call
super.uninitService(monitor) as the last
call in their implementation.
-
-
Specified by:
-
uninitService
in interface
IService
-
Overrides:
-
uninitService
in class
AbstractService
-
-
Parameters:
-
monitor - A progress monitor to provide progress of long-running
operation. There is no guarantee that cancellation is actually
supported by a Service since it would leave the service in a
potentially inconsistent, partially initialized state.
getAdapter
public
Object getAdapter(
Class adapter)
-
-
Specified by:
-
getAdapter
in interface
IAdaptable
-
Overrides:
-
getAdapter
in class
PlatformObject
-
Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.
|
|
|