com.ibm.etools.systems.localfilesubsys.impl
Class LocalCmdSubSystemImpl
java.lang.Object
EObjectImpl
com.ibm.etools.systems.subsystems.impl.SubSystemImpl
com.ibm.etools.systems.subsystems.impl.RemoteCmdSubSystemImpl
com.ibm.etools.systems.localfilesubsys.impl.LocalCmdSubSystemImpl
- All Implemented Interfaces:
- IAdaptable, ICommunicationsListener, IRemoteObjectResolver, ISystemResourceChangeEvents, LocalCmdSubSystem, RemoteCmdSubSystem, SubSystem, SystemFilterPoolReferenceManagerProvider
- public class LocalCmdSubSystemImpl
- extends RemoteCmdSubSystemImpl
- implements LocalCmdSubSystem
- See Also:
- Serialized Form
Fields inherited from class com.ibm.etools.systems.subsystems.impl.SubSystemImpl |
_connectionError, _disconnecting, _system, ADDITIONAL_ATTRIBUTES_EDEFAULT, additionalAttributes, additionalAttributesESet, cancelable, DELIM_VENDOR_ATTR_VALUE, DELIM_VENDOR_ATTRS, DELIM_VENDOR_NAME, doConnection, FACTORY_ID_EDEFAULT, factoryId, filterPoolReferenceManager, hidden, HIDDEN_EDEFAULT, IBM_ATTRIBUTES_EDEFAULT, ibmAttributes, ibmAttributesESet, ibmAttrs, monitor, name, NAME_EDEFAULT, operation, 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, parentConnection, parentSubSystemFactory, pmDialog, port, PORT_EDEFAULT, previousUserIdKey, remoteServerLauncher, runContext, runException, runInput, runInput2, runInputs, runInputs2, runInterpret, runInThread, runObject, runOutput, runOutputs, runOutputString, runOutputStrings, saveFileName, shell, sortResults, SUBSYSTEM_FILE_NAME, supportsConnecting, USE_SSL_EDEFAULT, USER_ID_EDEFAULT, userId, useSSL, VENDOR_ATTRIBUTES_EDEFAULT, vendorAttributes, vendorAttributesESet, vendorAttrs |
Fields inherited from interface com.ibm.etools.systems.model.ISystemResourceChangeEvents |
EVENT_ADD, EVENT_ADD_FILTER_REFERENCE, EVENT_ADD_FILTERSTRING_REFERENCE, EVENT_ADD_MANY, EVENT_ADD_RELATIVE, EVENT_CHANGE_CHILDREN, EVENT_CHANGE_FILTER_REFERENCE, EVENT_CHANGE_FILTERSTRING_REFERENCE, EVENT_COLLAPSE_ALL, EVENT_COLLAPSE_SELECTED, EVENT_COMMAND_FINISHED, EVENT_COMMAND_HISTORY_UPDATE, EVENT_COMMAND_MESSAGE, EVENT_COMMAND_RUN, EVENT_COMMAND_SHELL_FINISHED, EVENT_COMMAND_SHELL_REMOVED, EVENT_COMPILE_COMMAND_RUN, EVENT_DELETE, EVENT_DELETE_FILTER_REFERENCE, EVENT_DELETE_FILTERSTRING_REFERENCE, EVENT_DELETE_MANY, EVENT_EXPAND_SELECTED, EVENT_ICON_CHANGE, EVENT_MOVE_FILTER_REFERENCES, EVENT_MOVE_FILTERSTRING_REFERENCES, EVENT_MOVE_MANY, EVENT_MUST_COLLAPSE, EVENT_PROPERTY_CHANGE, EVENT_PROPERTYSHEET_UPDATE, EVENT_REFRESH, EVENT_REFRESH_REMOTE, EVENT_REFRESH_SELECTED, EVENT_REFRESH_SELECTED_FILTER, EVENT_REFRESH_SELECTED_PARENT, EVENT_RENAME, EVENT_RENAME_FILTER_REFERENCE, EVENT_REPLACE_CHILDREN, EVENT_REVEAL_AND_SELECT, EVENT_SEARCH_FINISHED, EVENT_SELECT, EVENT_SELECT_EXPAND, EVENT_SELECT_REMOTE, PROPERTYSHEET_UPDATE_EVENT |
Method Summary |
boolean |
canRunCommand()
Determine whether the command subsystem can run a command |
boolean |
canRunShell()
Determine whether the command subsystem can run a shell |
Object |
eGet(EStructuralFeature eFeature,
boolean resolve)
|
NotificationChain |
eInverseAdd(InternalEObject otherEnd,
int featureID,
Class baseClass,
NotificationChain msgs)
|
NotificationChain |
eInverseRemove(InternalEObject otherEnd,
int featureID,
Class baseClass,
NotificationChain msgs)
|
boolean |
eIsSet(EStructuralFeature eFeature)
|
void |
eSet(EStructuralFeature eFeature,
Object newValue)
|
protected EClass |
eStaticClass()
|
void |
eUnset(EStructuralFeature eFeature)
|
IRemoteCommandShell |
getDefaultShell(Shell shell)
Get the default running command shell for this command subsystem. |
String[] |
getExecutedCommands()
Provide list of executed commands on subsystem. |
List |
getHostEnvironmentVariables()
Override this to return a list of environment variables
for the host system |
List |
getPathEnvironment()
Override this to provide an appropriate path list for the
command subsystem. |
List |
getPathEnvironment(String var)
|
IRemoteCommandShell[] |
getShells()
Get all command shells and transient commands that have been run or are running for this command subsystem. |
AbstractSystemManager |
getSystemManager()
Return a singleton instance of an AbstractSystemManager subclass that manages
a pool of ISystem objects, one per system connection. |
protected void |
internalCancelShell(IProgressMonitor monitor,
Object command)
|
protected void |
internalDisconnect(IProgressMonitor monitor,
String hostName,
int port)
Actually disconnect from the remote host. |
protected Object[] |
internalRunCommand(IProgressMonitor monitor,
String command,
Object context)
Actually run a remote command. |
protected IRemoteCommandShell |
internalRunShell(IProgressMonitor monitor,
Object context)
|
protected void |
internalSendCommandToShell(IProgressMonitor monitor,
String cmd,
Object command)
|
protected List |
parsePathEnvironmentVariable(String path)
|
void |
sendCommandToShell(String input,
Shell shell,
Object commandObject)
overridden so that for universal we don't need to do in modal thread |
protected void |
updateCommandHistory(String executedCmd)
Maintain list of executed commands
- list is in order of most recent to least recent
- no duplicates |
Methods inherited from class com.ibm.etools.systems.subsystems.impl.RemoteCmdSubSystemImpl |
addEnvironmentVariable, addEnvironmentVariable, cancelAllShells, checkForCancel, communicationsStateChange, getCandidateCommands, getChildren, getCommandSubSystem, getEnvironmentVariable, getEnvironmentVariableList, getEnvironmentVariableValue, getEnvVars, getFileSubSystem, getInvalidEnvironmentVariableNameCharacters, getObjectWithAbsoluteName, getParentRemoteCmdSubSystemFactory, getShellEncoding, hasChildren, internalRemoveShell, internalResolveFilterString, isPassiveCommunicationsListener, isWindows, removeEnvironmentVariable, removeEnvironmentVariable, restoreShellState, runCommand, runShell, saveShellState, setEnvironmentVariableList, setShellEncoding |
Methods inherited from class com.ibm.etools.systems.subsystems.impl.SubSystemImpl |
addResolvedFilterStringObjects, basicSetFilterPoolReferenceManager, basicSetRemoteServerLauncher, cancelShell, checkIsConnected, clearLocalUserId, connect, connect, connect, deletingConnection, disconnect, disconnect, displayAsyncMsg, doesFilterListContentsOf, doesFilterMatch, doesFilterStringListContentsOf, doesFilterStringMatch, doesFilterTypeMatch, filterEventFilterCreated, filterEventFilterPoolReferenceCreated, filterEventFilterPoolReferenceDeleted, filterEventFilterPoolReferenceRenamed, filterEventFilterPoolReferenceReset, filterEventFilterPoolReferencesRePositioned, filterEventFilterPoolReferencesReset, filterEventFilterStringCreated, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, forceUserIdToUpperCase, getActiveWorkbenchShell, getActiveWorkbenchWindow, getAdapter, getAdditionalAttributes, getCacheManager, getConnectionOwnedFilterPoolName, getConnectionPrivateFilterPool, getFactoryId, getFilterPoolReferenceManager, getFilterReferenceWithAbsoluteName, getFirstParentFilterString, getHostName, getIBMAttribute, getIbmAttributes, getLocalUserId, getLocalUserId, getName, getParentSubSystemFactory, getPort, getPortAsInt, getPreferencesKey, getPreferencesKey, getPreferencesManager, getPrimarySubSystem, getProperties, getProperty, getPropertyPage, getQueryingMessage, getQueryingMessage, getRemoteServerLauncher, getResolvingMessage, getRunnableContext, getRunningMessage, getSaveFileName, getSettingMessage, getSettingMessage, getShell, getSystem, getSystemConnection, getSystemConnectionName, getSystemFilterPoolReferenceManager, getSystemProfile, getSystemProfileName, getSystemType, getTargetForFilter, getUDActionSubsystem, getUniqueOwningSystemFilterPool, getUserId, getUserIdGen, getVendorAttribute, getVendorAttributes, internalConnect, internalGetProperties, internalGetProperty, internalResolveFilterString, internalResolveFilterStrings, internalRunCommand, internalSetProperties, internalSetProperty, isConnected, isConnectionError, isHidden, isOffline, isSetAdditionalAttributes, isSetIbmAttributes, isSetVendorAttributes, isUseSSL, removeShell, renamingConnection, renamingProfile, resolveFilterString, resolveFilterString, resolveFilterString, resolveFilterString, resolveFilterStrings, resolveFilterStrings, run, runCommand, selectCommandSubSystem, setAdditionalAttributes, setConnectionError, setFactoryId, setFilterPoolReferenceManager, setHidden, setIBMAttribute, setIbmAttributes, setName, setParentConnection, setParentSubSystemFactory, setPort, setProperties, setProperty, setRemoteServerLauncher, setSaveFileName, setUserId, setUserIdGen, setUseSSL, setVendorAttribute, setVendorAttributes, showConnectCancelledMessage, showConnectErrorMessage, showDisconnectCancelledMessage, showDisconnectErrorMessage, showOperationCancelledMessage, showOperationErrorMessage, showOperationMessage, sortResolvedFilterStringObjects, supportsCaching, toString, unsetAdditionalAttributes, unsetIbmAttributes, unsetVendorAttributes |
Methods inherited from interface com.ibm.etools.systems.subsystems.RemoteCmdSubSystem |
addEnvironmentVariable, addEnvironmentVariable, cancelShell, getCandidateCommands, getEnvironmentVariable, getEnvironmentVariableList, getEnvironmentVariableValue, getEnvVars, getInvalidEnvironmentVariableNameCharacters, getParentRemoteCmdSubSystemFactory, removeEnvironmentVariable, removeEnvironmentVariable, removeShell, restoreShellState, runCommand, runShell, setEnvironmentVariableList |
Methods inherited from interface com.ibm.etools.systems.subsystems.SubSystem |
checkIsConnected, clearLocalUserId, connect, connect, connect, deletingConnection, disconnect, disconnect, doesFilterListContentsOf, doesFilterMatch, doesFilterStringListContentsOf, doesFilterStringMatch, forceUserIdToUpperCase, getAdditionalAttributes, getCacheManager, getChildren, getCommandSubSystem, getFactoryId, getFilterPoolReferenceManager, getIbmAttributes, getLocalUserId, getName, getParentSubSystemFactory, getPort, getPortAsInt, getPrimarySubSystem, getProperties, getProperty, getPropertyPage, getRemoteServerLauncher, getSaveFileName, getSystem, getSystemConnection, getSystemConnectionName, getSystemFilterPoolReferenceManager, getSystemProfile, getSystemProfileName, getTargetForFilter, getUDActionSubsystem, getUserId, getVendorAttribute, getVendorAttributes, hasChildren, isConnected, isConnectionError, isHidden, isOffline, isSetAdditionalAttributes, isSetIbmAttributes, isSetVendorAttributes, isUseSSL, renamingConnection, renamingProfile, resolveFilterString, resolveFilterString, resolveFilterString, resolveFilterString, resolveFilterStrings, resolveFilterStrings, setAdditionalAttributes, setConnectionError, setFactoryId, setFilterPoolReferenceManager, setHidden, setIbmAttributes, setName, setParentConnection, setParentSubSystemFactory, setPort, setProperties, setProperty, setRemoteServerLauncher, setSaveFileName, setUserId, setUseSSL, setVendorAttribute, setVendorAttributes, supportsCaching, unsetAdditionalAttributes, unsetIbmAttributes, unsetVendorAttributes |
copyright
public static final String copyright
- See Also:
- Constant Field Values
LocalCmdSubSystemImpl
public LocalCmdSubSystemImpl()
- Constructor.
getSystemManager
public AbstractSystemManager getSystemManager()
- Return a singleton instance of an AbstractSystemManager subclass that manages
a pool of ISystem objects, one per system connection. By default, getSystem()
calls this, unless you override getSystem().
- Specified by:
getSystemManager
in interface SubSystem
- Overrides:
getSystemManager
in class SubSystemImpl
- Returns:
- LocalSystemManager.getTheLocalSystemManager()
getDefaultShell
public IRemoteCommandShell getDefaultShell(Shell shell)
throws Exception
- Get the default running command shell for this command subsystem. If no such shell exists or is running, a new one is launched.
- Specified by:
getDefaultShell
in interface RemoteCmdSubSystem
- Overrides:
getDefaultShell
in class RemoteCmdSubSystemImpl
- Returns:
- the default running command shell
- Throws:
Exception
getExecutedCommands
public String[] getExecutedCommands()
- Provide list of executed commands on subsystem.
- Specified by:
getExecutedCommands
in interface RemoteCmdSubSystem
- Overrides:
getExecutedCommands
in class SubSystemImpl
updateCommandHistory
protected void updateCommandHistory(String executedCmd)
- Maintain list of executed commands
- list is in order of most recent to least recent
- no duplicates
getShells
public IRemoteCommandShell[] getShells()
- Get all command shells and transient commands that have been run or are running for this command subsystem.
- Specified by:
getShells
in interface RemoteCmdSubSystem
- Overrides:
getShells
in class RemoteCmdSubSystemImpl
- Returns:
- the list of running command shells and commands
canRunShell
public boolean canRunShell()
- Determine whether the command subsystem can run a shell
- Specified by:
canRunShell
in interface RemoteCmdSubSystem
- Overrides:
canRunShell
in class RemoteCmdSubSystemImpl
- Returns:
- whether a shell can be run or not
canRunCommand
public boolean canRunCommand()
- Determine whether the command subsystem can run a command
- Specified by:
canRunCommand
in interface RemoteCmdSubSystem
- Overrides:
canRunCommand
in class RemoteCmdSubSystemImpl
- Returns:
- whether a command can be run or not
internalDisconnect
protected void internalDisconnect(IProgressMonitor monitor,
String hostName,
int port)
throws InvocationTargetException,
InterruptedException
- Description copied from class:
SubSystemImpl
- Actually disconnect from the remote host. This is called by the run(IProgressMonitor monitor) method.
You DO NOT OVERRIDE THIS typically. Rather, this calls connect(IProgressMonitor) in your
ISystem class that is returned from getSystem(). That is where your code to disconnect should go!
Your connect method in your ISystem class must follow these IRunnableWithProgress rules:
- if the user cancels (monitor.isCanceled()), throw new InterruptedException()
- if the host is unknown, throw new java.lang.reflect.InvocationTargetException(new java.net.UnknownHostException));
- if something else bad happens, throw new java.lang.reflect.InvocationTargetException(exc);
- well, actually you can throw anything and we'll wrap it here in an InvocationTargetException
- do not worry about calling monitor.done() ... caller will do that!
- Overrides:
internalDisconnect
in class SubSystemImpl
- Throws:
InvocationTargetException
InterruptedException
internalRunCommand
protected Object[] internalRunCommand(IProgressMonitor monitor,
String command,
Object context)
throws InvocationTargetException,
InterruptedException
- Description copied from class:
SubSystemImpl
- Actually run a remote command. This is called by the
run(IProgressMonitor monitor) method, which in turn is called by runCommand(...).
As per IRunnableWithProgress rules:
- if the user cancels (monitor.isCanceled()), throw new InterruptedException()
- if something else bad happens, throw new java.lang.reflect.InvocationTargetException(exc);
- do not worry about calling monitor.done() ... caller will do that!
YOU MUST OVERRIDE THIS IF YOU SUPPORT COMMANDS!
- Overrides:
internalRunCommand
in class SubSystemImpl
- Throws:
InvocationTargetException
InterruptedException
internalRunShell
protected IRemoteCommandShell internalRunShell(IProgressMonitor monitor,
Object context)
throws InvocationTargetException,
InterruptedException
- Overrides:
internalRunShell
in class SubSystemImpl
- Throws:
InvocationTargetException
InterruptedException
internalCancelShell
protected void internalCancelShell(IProgressMonitor monitor,
Object command)
throws InvocationTargetException,
InterruptedException
- Overrides:
internalCancelShell
in class SubSystemImpl
- Throws:
InvocationTargetException
InterruptedException
internalSendCommandToShell
protected void internalSendCommandToShell(IProgressMonitor monitor,
String cmd,
Object command)
throws InvocationTargetException,
InterruptedException
- Overrides:
internalSendCommandToShell
in class SubSystemImpl
- Throws:
InvocationTargetException
InterruptedException
getHostEnvironmentVariables
public List getHostEnvironmentVariables()
- Description copied from class:
RemoteCmdSubSystemImpl
- Override this to return a list of environment variables
for the host system
- Overrides:
getHostEnvironmentVariables
in class RemoteCmdSubSystemImpl
- Returns:
- the list of environment variables in the form NAME=VALUE
parsePathEnvironmentVariable
protected List parsePathEnvironmentVariable(String path)
- Overrides:
parsePathEnvironmentVariable
in class RemoteCmdSubSystemImpl
getPathEnvironment
public List getPathEnvironment(String var)
getPathEnvironment
public List getPathEnvironment()
- Description copied from class:
RemoteCmdSubSystemImpl
- Override this to provide an appropriate path list for the
command subsystem.
- Overrides:
getPathEnvironment
in class RemoteCmdSubSystemImpl
eStaticClass
protected EClass eStaticClass()
-
- Overrides:
eStaticClass
in class RemoteCmdSubSystemImpl
eInverseAdd
public NotificationChain eInverseAdd(InternalEObject otherEnd,
int featureID,
Class baseClass,
NotificationChain msgs)
-
- Overrides:
eInverseAdd
in class RemoteCmdSubSystemImpl
eInverseRemove
public NotificationChain eInverseRemove(InternalEObject otherEnd,
int featureID,
Class baseClass,
NotificationChain msgs)
-
- Overrides:
eInverseRemove
in class RemoteCmdSubSystemImpl
eGet
public Object eGet(EStructuralFeature eFeature,
boolean resolve)
-
- Overrides:
eGet
in class RemoteCmdSubSystemImpl
eSet
public void eSet(EStructuralFeature eFeature,
Object newValue)
-
- Overrides:
eSet
in class RemoteCmdSubSystemImpl
eUnset
public void eUnset(EStructuralFeature eFeature)
-
- Overrides:
eUnset
in class RemoteCmdSubSystemImpl
eIsSet
public boolean eIsSet(EStructuralFeature eFeature)
-
- Overrides:
eIsSet
in class RemoteCmdSubSystemImpl
sendCommandToShell
public void sendCommandToShell(String input,
Shell shell,
Object commandObject)
throws Exception
- overridden so that for universal we don't need to do in modal thread
- Specified by:
sendCommandToShell
in interface RemoteCmdSubSystem
- Overrides:
sendCommandToShell
in class SubSystemImpl
- Throws:
Exception
Copyright © 2005 IBM Corp. All Rights Reserved.
Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.