RSE
Release 3.0

org.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem
Class ShellServiceSubSystem

java.lang.Object
  extended byorg.eclipse.rse.core.model.RSEPersistableObject
      extended byorg.eclipse.rse.core.model.PropertySetContainer
          extended byorg.eclipse.rse.core.model.RSEModelObject
              extended byorg.eclipse.rse.core.subsystems.SubSystem
                  extended byorg.eclipse.rse.subsystems.shells.core.subsystems.RemoteCmdSubSystem
                      extended byorg.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem.ShellServiceSubSystem
All Implemented Interfaces:
IAdaptable, ICommunicationsListener, IPropertySetContainer, IRemoteCmdSubSystem, IRemoteObjectResolver, IRSEModelObject, IRSEPersistableContainer, ISchedulingRule, IShellServiceSubSystem, ISubSystem, ISystemFilterPoolReferenceManagerProvider

public final class ShellServiceSubSystem
extends RemoteCmdSubSystem
implements IShellServiceSubSystem


Nested Class Summary
 
Nested classes inherited from class org.eclipse.rse.subsystems.shells.core.subsystems.RemoteCmdSubSystem
RemoteCmdSubSystem.CancelShellJob, RemoteCmdSubSystem.Refresh, RemoteCmdSubSystem.RefreshRemovedShell, RemoteCmdSubSystem.RefreshSubSystem, RemoteCmdSubSystem.RemoveShellJob, RemoteCmdSubSystem.RunCommandJob, RemoteCmdSubSystem.RunShellJob, RemoteCmdSubSystem.SendCommandToShellJob
 
Nested classes 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
 
Field Summary
protected  IShellService _hostService
           
protected  String _userHome
           
 
Fields inherited from class org.eclipse.rse.subsystems.shells.core.subsystems.RemoteCmdSubSystem
_cmdShells, _defaultShell, _fileSubSystem
 
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
 
Fields inherited from interface org.eclipse.rse.core.model.IRSEPersistableContainer
NO_CHILDREN
 
Constructor Summary
ShellServiceSubSystem(IHost host, IConnectorService connectorService, IShellService hostService)
           
 
Method Summary
 boolean canSwitchTo(ISubSystemConfiguration configuration)
          Determine is this subsystem is compatible with this specified configuration.
protected  IServiceCommandShell createRemoteCommandShell(IRemoteCmdSubSystem cmdSS, IHostShell hostShell)
           
 String[] getHostEnvironment()
           
 List getHostEnvironmentVariables()
           
 Class getServiceType()
          Returns the interface type (i.e. a Class object that is an Interface) of a service subsystem.
 IShellService getShellService()
           
protected  String getUserHome()
           
 void initializeSubSystem(IProgressMonitor monitor)
          Called on each subsystem associated with a particular IConnectorService after it connects successfully.
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)
          Called on each subsystem associated with a particular IConnectorService after it disconnects
 
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 org.eclipse.rse.core.model.RSEModelObject
getDescription
 
Methods inherited from class org.eclipse.rse.core.model.PropertySetContainer
addPropertySet, addPropertySets, createPropertySet, getPropertySet, getPropertySets, removePropertySet
 
Methods inherited from class org.eclipse.rse.core.model.RSEPersistableObject
compareStrings, isDirty, isTainted, setDirty, setTainted, setWasRestored, wasRestored
 
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
 
Methods inherited from interface org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManagerProvider
filterEventFilterCreated, filterEventFilterPoolReferenceCreated, filterEventFilterPoolReferenceDeleted, filterEventFilterPoolReferenceRenamed, filterEventFilterPoolReferenceReset, filterEventFilterPoolReferencesRePositioned, filterEventFilterPoolReferencesReset, filterEventFilterStringCreated, getUniqueOwningSystemFilterPool
 
Methods inherited from interface org.eclipse.rse.core.subsystems.IRemoteObjectResolver
getObjectWithAbsoluteName, getObjectWithAbsoluteName
 
Methods inherited from interface org.eclipse.core.runtime.jobs.ISchedulingRule
contains, isConflicting
 
Methods inherited from interface org.eclipse.rse.core.model.IRSEModelObject
getDescription
 
Methods inherited from interface org.eclipse.rse.core.model.IPropertySetContainer
addPropertySet, addPropertySets, createPropertySet, createPropertySet, getPropertySet, getPropertySets, removePropertySet
 
Methods inherited from interface org.eclipse.rse.core.model.IRSEPersistableContainer
commit, getPersistableChildren, getPersistableParent, isDirty, isTainted, setDirty, setTainted, setWasRestored, wasRestored
 

Field Detail

_userHome

protected String _userHome

_hostService

protected IShellService _hostService
Constructor Detail

ShellServiceSubSystem

public ShellServiceSubSystem(IHost host,
                             IConnectorService connectorService,
                             IShellService hostService)
Method Detail

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:
SystemMessageException - if the command results in an error on the target system
InvocationTargetException - if something else bad happens
InterruptedException - if the user cancels the operation

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:
SystemMessageException - if the command results in an error on the target system
InterruptedException - if the user cancels the operation
InvocationTargetException - if something else bad happens

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:
InterruptedException - if the user cancels the operation
InvocationTargetException - if something else bad happens
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:
InterruptedException - if the user cancels the operation
InvocationTargetException - if something else bad happens

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:
InterruptedException - if the user cancels the operation
InvocationTargetException - if something else bad happens

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 interface: ISubSystem
Determine is this subsystem is compatible with this specified configuration.

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 interface: ISubSystem
Returns the interface type (i.e. a Class object that is an Interface) of a service 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)
Description copied from interface: ISubSystem
Called on each subsystem associated with a particular IConnectorService after it connects successfully. This call is always made on a background Thread, so it's allowed to be long-running.

Specified by:
initializeSubSystem in interface ISubSystem
Overrides:
initializeSubSystem in class RemoteCmdSubSystem

uninitializeSubSystem

public void uninitializeSubSystem(IProgressMonitor monitor)
Description copied from interface: ISubSystem
Called on each subsystem associated with a particular IConnectorService after it disconnects

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.

RSE
Release 3.0

Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.