|
org.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem
Class ShellServiceSubSystem
java.lang.Object
org.eclipse.rse.core.model.RSEPersistableObject
org.eclipse.rse.core.model.PropertySetContainer
org.eclipse.rse.core.model.RSEModelObject
org.eclipse.rse.core.subsystems.SubSystem
org.eclipse.rse.subsystems.shells.core.subsystems.RemoteCmdSubSystem
org.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem.ShellServiceSubSystem
-
All Implemented Interfaces:
-
IAdaptable,
ISchedulingRule,
ISystemFilterPoolReferenceManagerProvider,
IPropertySetContainer,
IRSEModelObject,
IRSEPersistableContainer,
ICommunicationsListener,
IRemoteObjectResolver,
ISubSystem,
IRemoteCmdSubSystem,
IShellServiceSubSystem
-
public final class ShellServiceSubSystem
- extends
RemoteCmdSubSystem
- implements
IShellServiceSubSystem
Nested classes/interfaces inherited from class org.eclipse.rse.core.subsystems.
SubSystem
|
SubSystem.ChangeStatusJob,
SubSystem.ConnectJob,
SubSystem.DisconnectJob,
SubSystem.DisplayErrorMessageJob,
SubSystem.GetPropertiesJob,
SubSystem.GetPropertyJob,
SubSystem.ResolveAbsoluteJob,
SubSystem.ResolveAbsolutesJob,
SubSystem.ResolveRelativeJob,
SubSystem.SetPropertiesJob,
SubSystem.SetPropertyJob,
SubSystem.SubSystemOperationJob,
SubSystem.SystemMessageDialogRunnable
|
Fields inherited from class org.eclipse.rse.core.subsystems.
SubSystem
|
_connectionError,
_connectorService,
_disconnecting,
_hidden,
_host,
_name,
_subsystemConfigurationId,
cancelable,
doConnection,
filterPoolReferenceManager,
OPERATION_CANCEL_SHELL,
OPERATION_CONNECT,
OPERATION_DISCONNECT,
OPERATION_GET_PROPERTIES,
OPERATION_GET_PROPERTY,
OPERATION_REMOVE_SHELL,
OPERATION_RESOLVE_ABSOLUTE,
OPERATION_RESOLVE_ABSOLUTES,
OPERATION_RESOLVE_RELATIVE,
OPERATION_RUN_COMMAND,
OPERATION_RUN_SHELL,
OPERATION_SEND_COMMAND_TO_SHELL,
OPERATION_SET_PROPERTIES,
OPERATION_SET_PROPERTY,
parentSubSystemConfiguration,
pmDialog,
previousUserIdKey,
runInThread,
saveFileName,
shell,
sortResults,
SUBSYSTEM_FILE_NAME,
supportsConnecting
|
Method Summary
|
boolean
|
canSwitchTo
(
ISubSystemConfiguration configuration)
Determine if a service subsystem is capable of switching to this new
configuration. |
protected
IServiceCommandShell
|
createRemoteCommandShell
(
IRemoteCmdSubSystem cmdSS,
IHostShell hostShell)
|
String[]
|
getHostEnvironment
()
|
List
|
getHostEnvironmentVariables
()
|
Class
|
getServiceType
()
Return the service type for this subsystem. |
IShellService
|
getShellService
()
|
protected
String
|
getUserHome
()
|
void
|
initializeSubSystem
(
IProgressMonitor monitor)
Initialize this subsystem instance after the corresponding
IConnectorService connect method finishes. |
protected void
|
internalCancelShell
(
Object command,
IProgressMonitor monitor)
Cancels a running shell. |
protected
Object[]
|
internalRunCommand
(
String cmd,
Object context,
boolean interpretOutput,
IProgressMonitor monitor)
Runs a remote command and interprets any resulting output. |
protected
Object[]
|
internalRunCommand
(
String cmd,
Object context,
IProgressMonitor monitor)
Runs a remote command. |
protected
IRemoteCommandShell
|
internalRunShell
(
Object context,
IProgressMonitor monitor)
Establishes a new shell. |
protected void
|
internalSendCommandToShell
(
String cmd,
Object command,
IProgressMonitor monitor)
Sends a command to a shell for execution. |
protected void
|
internalSwitchSubSystemConfiguration
(
ISubSystemConfiguration newConfiguration)
Perform the subsystem specific processing required to complete a
subsystem configuration switch for a service subsystem. |
void
|
setShellService
(
IShellService service)
|
void
|
uninitializeSubSystem
(
IProgressMonitor monitor)
Uninitialize this subsystem just after disconnect. |
Methods inherited from class org.eclipse.rse.subsystems.shells.core.subsystems.
RemoteCmdSubSystem
|
addEnvironmentVariable,
addEnvironmentVariable,
cancelAllShells,
cancelShell,
cancelShell,
canRunCommand,
canRunShell,
checkForCancel,
communicationsStateChange,
createPropertySet,
getCandidateCommands,
getChildren,
getCommandSubSystem,
getDefaultShell,
getEnvironmentVariable,
getEnvironmentVariableList,
getEnvironmentVariableValue,
getEnvVarsAsStringArray,
getFileSubSystem,
getInvalidEnvironmentVariableNameCharacters,
getObjectWithAbsoluteName,
getParentRemoteCmdSubSystemConfiguration,
getShells,
getUserAndHostEnvVarsAsStringArray,
hasChildren,
internalRemoveShell,
internalResolveFilterString,
isPassiveCommunicationsListener,
isUniqueVariable,
isWindows,
parsePathEnvironmentVariable,
removeEnvironmentVariable,
removeEnvironmentVariable,
removeShell,
restoreShellState,
runCommand,
runCommand,
runCommand,
runCommand,
runShell,
runShell,
saveShellState,
sendCommandToShell,
setEnvironmentVariableList
|
Methods inherited from class org.eclipse.rse.core.subsystems.
SubSystem
|
addResolvedFilterStringObjects,
checkIsConnected,
clearLocalUserId,
commit,
connect,
connect,
contains,
deletingConnection,
disconnect,
disconnect,
displayAsyncMsg,
doesFilterListContentsOf,
doesFilterMatch,
doesFilterStringListContentsOf,
doesFilterStringMatch,
doesFilterTypeMatch,
filterEventFilterCreated,
filterEventFilterPoolReferenceCreated,
filterEventFilterPoolReferenceDeleted,
filterEventFilterPoolReferenceRenamed,
filterEventFilterPoolReferenceReset,
filterEventFilterPoolReferencesRePositioned,
filterEventFilterPoolReferencesReset,
filterEventFilterStringCreated,
fireEvent,
fireEvent,
fireEvent,
fireEvent,
fireEvent,
fireEvent,
forceUserIdToUpperCase,
getAdapter,
getCacheManager,
getConfigurationId,
getConnectionOwnedFilterPoolName,
getConnectionPrivateFilterPool,
getConnectorService,
getExecutedCommands,
getFilterPoolReferenceManager,
getFilterReferenceWithAbsoluteName,
getFirstParentFilterString,
getHost,
getHostAliasName,
getHostName,
getInteractionProvider,
getLocalUserId,
getLocalUserId,
getName,
getObjectWithAbsoluteName,
getPersistableChildren,
getPersistableParent,
getPreferencesKey,
getPreferencesKey,
getPrimarySubSystem,
getProperties,
getProperty,
getPropertyPage,
getQueryingMessage,
getQueryingMessage,
getRemoteAttribute,
getResolvingMessage,
getRunnableContext,
getRunningMessage,
getSettingMessage,
getSettingMessage,
getShell,
getSubSystemConfiguration,
getSystemFilterPoolReferenceManager,
getSystemProfile,
getSystemProfileName,
getTargetForFilter,
getTargetsForFilter,
getUniqueOwningSystemFilterPool,
getUserId,
getVendorAttribute,
implicitConnect,
internalDisconnect,
internalGetProperties,
internalGetProperty,
internalResolveFilterString,
internalResolveFilterStrings,
internalSetProperties,
internalSetProperty,
isConflicting,
isConnected,
isConnectionError,
isHidden,
isOffline,
isPrimarySubSystem,
promptForPassword,
promptForPassword,
renamingConnection,
renamingProfile,
resolveFilterString,
resolveFilterString,
resolveFilterStrings,
scheduleJob,
selectCommandSubSystem,
setConfigurationId,
setConnectionError,
setConnectorService,
setFilterPoolReferenceManager,
setHidden,
setHost,
setInteractionProvider,
setName,
setProperties,
setProperty,
setRemoteAttribute,
setSubSystemConfiguration,
setVendorAttribute,
showConnectCancelledMessage,
showConnectErrorMessage,
showDisconnectCancelledMessage,
showDisconnectErrorMessage,
showOperationCancelledMessage,
showOperationErrorMessage,
showOperationMessage,
sortResolvedFilterStringObjects,
supportsCaching,
switchServiceFactory
|
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.subsystems.shells.core.subsystems.
IRemoteCmdSubSystem
|
addEnvironmentVariable,
addEnvironmentVariable,
cancelShell,
canRunCommand,
canRunShell,
getCandidateCommands,
getDefaultShell,
getEnvironmentVariable,
getEnvironmentVariableList,
getEnvironmentVariableValue,
getExecutedCommands,
getInvalidEnvironmentVariableNameCharacters,
getParentRemoteCmdSubSystemConfiguration,
getShells,
removeEnvironmentVariable,
removeEnvironmentVariable,
removeShell,
restoreShellState,
runCommand,
runCommand,
runShell,
sendCommandToShell,
setEnvironmentVariableList
|
Methods inherited from interface org.eclipse.rse.core.subsystems.
ISubSystem
|
checkIsConnected,
clearLocalUserId,
connect,
connect,
deletingConnection,
disconnect,
disconnect,
doesFilterListContentsOf,
doesFilterMatch,
doesFilterStringListContentsOf,
doesFilterStringMatch,
forceUserIdToUpperCase,
getCacheManager,
getChildren,
getConfigurationId,
getConnectorService,
getFilterPoolReferenceManager,
getHost,
getHostAliasName,
getLocalUserId,
getName,
getPrimarySubSystem,
getProperties,
getProperty,
getSubSystemConfiguration,
getSystemFilterPoolReferenceManager,
getSystemProfile,
getSystemProfileName,
getTargetForFilter,
getUserId,
getVendorAttribute,
hasChildren,
isConnected,
isConnectionError,
isHidden,
isOffline,
isPrimarySubSystem,
renamingConnection,
renamingProfile,
resolveFilterString,
resolveFilterString,
resolveFilterStrings,
setConfigurationId,
setConnectionError,
setConnectorService,
setFilterPoolReferenceManager,
setHidden,
setHost,
setName,
setProperties,
setProperty,
setSubSystemConfiguration,
setVendorAttribute,
supportsCaching,
switchServiceFactory
|
_userHome
protected
String _userHome
_hostService
protected
IShellService _hostService
ShellServiceSubSystem
public ShellServiceSubSystem(
IHost host,
IConnectorService connectorService,
IShellService hostService)
getShellService
public
IShellService getShellService()
-
-
Specified by:
-
getShellService
in interface
IShellServiceSubSystem
-
setShellService
public void setShellService(
IShellService service)
-
-
getUserHome
protected
String getUserHome()
-
-
internalRunCommand
protected
Object[] internalRunCommand(
String cmd,
Object context,
IProgressMonitor monitor)
throws
InvocationTargetException,
InterruptedException,
SystemMessageException
-
Description copied from class:
RemoteCmdSubSystem
- Runs a remote command.
This method must be overridden by implementers of command subsystems.
-
-
Overrides:
-
internalRunCommand
in class
RemoteCmdSubSystem
-
-
Parameters:
-
cmd - The command to execute. -
context - The IServiceCommandShell that provides the context in which to run this command. -
monitor - a monitor for progress and cancellation, the caller is expected to call monitor.done()
-
Returns:
- an array of 1 object, the IServiceCommandShell, which can be queried for output.
-
Throws:
-
InvocationTargetException
- if something else bad happens
-
InterruptedException
- if the user cancels the operation
-
SystemMessageException
- if the command results in an error on the target system
internalRunCommand
protected
Object[] internalRunCommand(
String cmd,
Object context,
boolean interpretOutput,
IProgressMonitor monitor)
throws
InvocationTargetException,
InterruptedException,
SystemMessageException
-
Description copied from class:
RemoteCmdSubSystem
- Runs a remote command and interprets any resulting output.
This method must be overridden by implementers of command subsystems.
-
-
Overrides:
-
internalRunCommand
in class
RemoteCmdSubSystem
-
-
Parameters:
-
cmd - The command to execute. -
context - The IServiceCommandShell that provides the context in which to run this command. -
monitor - a monitor for progress and cancellation, the caller is expected to call monitor.done()
-
Returns:
- an array of 1 object, the IServiceCommandShell, which can be queried for output.
-
Throws:
-
InvocationTargetException
- if something else bad happens
-
InterruptedException
- if the user cancels the operation
-
SystemMessageException
- if the command results in an error on the target system
internalRunShell
protected
IRemoteCommandShell internalRunShell(
Object context,
IProgressMonitor monitor)
throws
InvocationTargetException,
InterruptedException,
SystemMessageException
-
Description copied from class:
RemoteCmdSubSystem
- Establishes a new shell. This causes the shell to start and establish its initial environment.
This method must be overridden by implementers of command subsystems.
-
-
Overrides:
-
internalRunShell
in class
RemoteCmdSubSystem
-
-
Parameters:
-
context - the current directory for this shell. Can be a String containing a path
name to be used as the current directory or an IRemoteFile representing
a directory. If null or "null", the home directory is used. -
monitor - a monitor for progress and cancellation, the caller is expected to call monitor.done()
-
Returns:
- the newly established shell.
-
Throws:
-
InvocationTargetException
- if something else bad happens
-
InterruptedException
- if the user cancels the operation
-
SystemMessageException
- if the command results in an error on the target system
internalCancelShell
protected void internalCancelShell(
Object command,
IProgressMonitor monitor)
throws
InvocationTargetException,
InterruptedException
-
Description copied from class:
RemoteCmdSubSystem
- Cancels a running shell.
This method must be overridden by implementers of command subsystems.
-
-
Overrides:
-
internalCancelShell
in class
RemoteCmdSubSystem
-
-
Parameters:
-
command - the IServiceCommandShell to cancel. -
monitor - a monitor for progress and cancellation, the caller is expected to call monitor.done()
-
Throws:
-
InvocationTargetException
- if something else bad happens
-
InterruptedException
- if the user cancels the operation
internalSendCommandToShell
protected void internalSendCommandToShell(
String cmd,
Object command,
IProgressMonitor monitor)
throws
InvocationTargetException,
InterruptedException
-
Description copied from class:
RemoteCmdSubSystem
- Sends a command to a shell for execution.
This method must be overridden by implementers of command subsystems.
-
-
Overrides:
-
internalSendCommandToShell
in class
RemoteCmdSubSystem
-
-
Parameters:
-
cmd - the command to execute. -
command - the IServiceCommandShell that provides the context in which to execute the command. -
monitor - a monitor for progress and cancellation, the caller is expected to call monitor.done()
-
Throws:
-
InvocationTargetException
- if something else bad happens
-
InterruptedException
- if the user cancels the operation
createRemoteCommandShell
protected
IServiceCommandShell createRemoteCommandShell(
IRemoteCmdSubSystem cmdSS,
IHostShell hostShell)
-
-
getHostEnvironment
public
String[] getHostEnvironment()
-
-
getHostEnvironmentVariables
public
List getHostEnvironmentVariables()
-
-
Specified by:
-
getHostEnvironmentVariables
in interface
IRemoteCmdSubSystem
-
canSwitchTo
public boolean canSwitchTo(
ISubSystemConfiguration configuration)
-
Description copied from class:
SubSystem
- Determine if a service subsystem is capable of switching to this new
configuration. This is usually a test of this configuration's type
against the type expected by this subsystem. This supplied implementation
returns false. Subclasses should override if they implement a service
subsystem.
-
-
Specified by:
-
canSwitchTo
in interface
ISubSystem
-
Overrides:
-
canSwitchTo
in class
SubSystem
-
-
Parameters:
-
configuration - the configuration to which this subsystem may switch
-
Returns:
- true if this subsystem is capable of switching to this
configuration, false otherwise. This implementation returns false.
-
See Also:
-
ISubSystem.canSwitchTo(ISubSystemConfiguration)
internalSwitchSubSystemConfiguration
protected void internalSwitchSubSystemConfiguration(
ISubSystemConfiguration newConfiguration)
-
Description copied from class:
SubSystem
- Perform the subsystem specific processing required to complete a
subsystem configuration switch for a service subsystem. The subsystem
will typically query this configuration for interesting properties or
policies. It should also reset any state to a fresh start. This supplied
implementation does nothing. Subclasses may override if they implement a
service subsystem.
-
-
Overrides:
-
internalSwitchSubSystemConfiguration
in class
SubSystem
-
-
Parameters:
-
newConfiguration - the configuration this subsystem should use from
this point.
getServiceType
public
Class getServiceType()
-
Description copied from class:
SubSystem
- Return the service type for this subsystem.
-
-
Specified by:
-
getServiceType
in interface
ISubSystem
-
Overrides:
-
getServiceType
in class
SubSystem
-
-
Returns:
- the default implementation returns null. Subclasses that
implement service subsystems should return a type as specified in the
interface.
-
See Also:
-
ISubSystem.getServiceType()
initializeSubSystem
public void initializeSubSystem(
IProgressMonitor monitor)
throws
SystemMessageException
-
Description copied from class:
SubSystem
- Initialize this subsystem instance after the corresponding
IConnectorService connect method finishes. This method should be
overridden if any initialization for the subsystem needs to occur at this
time.
The default implementation currently does nothing, but overriding methods
should call super before doing any other work.
-
-
Specified by:
-
initializeSubSystem
in interface
ISubSystem
-
Overrides:
-
initializeSubSystem
in class
RemoteCmdSubSystem
-
-
Parameters:
-
monitor - a progress monitor that can be used to show progress
during long-running operation. Cancellation is typically not
supported since it might leave the system in an inconsistent
state.
-
Throws:
-
SystemMessageException
- if an error occurs during initialization.
uninitializeSubSystem
public void uninitializeSubSystem(
IProgressMonitor monitor)
-
Description copied from class:
SubSystem
- Uninitialize this subsystem just after disconnect. The default
implementation currently does nothing. Overriding methods should call
super after doing their own work.
-
-
Specified by:
-
uninitializeSubSystem
in interface
ISubSystem
-
Overrides:
-
uninitializeSubSystem
in class
SubSystem
-
-
Parameters:
-
monitor - a progress monitor that can be used to show progress
during long-running operation. Cancellation is typically not
supported since it might leave the system in an inconsistent
state.
Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.
|
|