Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

RSE
Release 3.0

org.eclipse.rse.subsystems.processes.core.subsystem.impl
Class RemoteProcessSubSystemImpl


java.lang.Object
  extended by 

org.eclipse.rse.core.model.RSEPersistableObject
      extended by 

org.eclipse.rse.core.model.PropertySetContainer
          extended by 

org.eclipse.rse.core.model.RSEModelObject
              extended by 

org.eclipse.rse.core.subsystems.SubSystem
                  extended by 
org.eclipse.rse.subsystems.processes.core.subsystem.impl.RemoteProcessSubSystemImpl
All Implemented Interfaces:
IAdaptable, ISchedulingRule, ISystemFilterPoolReferenceManagerProvider, IPropertySetContainer, IRSEModelObject, IRSEPersistableContainer, ICommunicationsListener, IRemoteObjectResolver, ISubSystem, IRemoteProcessSubSystem
Direct Known Subclasses:
ProcessServiceSubSystem

public abstract class RemoteProcessSubSystemImpl
extends SubSystem
implements IRemoteProcessSubSystem, ICommunicationsListener

Default implementation of the IRemoteProcessSubSystem interface.

Some of the methods are simply convenience methods - these are implemented here, whereas the real work takes place in the ProcessServiceSubSystem.


Nested Class Summary
 
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
 
Field Summary
 
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
RemoteProcessSubSystemImpl ( IHost host, IConnectorService connectorService)
           
 
Method Summary
 void communicationsStateChange ( CommunicationsEvent e)
          This method is invoked whenever the communications state is invoked immediately before and after the state of the communications changes.
  Object getObjectWithAbsoluteName ( String key, IProgressMonitor monitor)
          Return the remote object that corresponds to the specified unique ID.
  IRemoteProcess getParentProcess ( IRemoteProcess process)
          Given a process, return its parent process object.
  IRemoteProcessSubSystemConfiguration getParentRemoteProcessSubSystemConfiguration ()
          Return parent subsystem factory, cast to a RemoteProcessSubSystemConfiguration
 void initializeSubSystem ( IProgressMonitor monitor)
          Initialize this subsystem instance after the corresponding IConnectorService connect method finishes.
protected   Object[] internalResolveFilterString ( String filterString, IProgressMonitor monitor)
          Resolve an absolute filter string.
 boolean isCaseSensitive ()
          Return true if names are case-sensitive.
 boolean isPassiveCommunicationsListener ()
          This method determines if the communications listener is a passive or active listener.
  IRemoteProcess[] listRoots ( IRemoteProcessContext context, IProgressMonitor monitor)
          At this point there is only one root process, the 'init' process with pid 1
 void uninitializeSubSystem ( IProgressMonitor monitor)
          Uninitialize this subsystem just after disconnect.
 
Methods inherited from class org.eclipse.rse.core.subsystems. SubSystem
addResolvedFilterStringObjects, canSwitchTo, 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, getChildren, 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, getServiceType, getSettingMessage, getSettingMessage, getShell, getSubSystemConfiguration, getSystemFilterPoolReferenceManager, getSystemProfile, getSystemProfileName, getTargetForFilter, getTargetsForFilter, getUniqueOwningSystemFilterPool, getUserId, getVendorAttribute, hasChildren, implicitConnect, internalDisconnect, internalGetProperties, internalGetProperty, internalResolveFilterString, internalResolveFilterStrings, internalSetProperties, internalSetProperty, internalSwitchSubSystemConfiguration, 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, 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.processes.core.subsystem. IRemoteProcessSubSystem
getRemoteProcessObject, getSignalTypes, kill, listAllProcesses, listChildProcesses, listChildProcesses
 
Methods inherited from interface org.eclipse.rse.core.subsystems. ISubSystem
canSwitchTo, checkIsConnected, clearLocalUserId, connect, connect, deletingConnection, disconnect, disconnect, doesFilterListContentsOf, doesFilterMatch, doesFilterStringListContentsOf, doesFilterStringMatch, forceUserIdToUpperCase, getCacheManager, getChildren, getConfigurationId, getConnectorService, getFilterPoolReferenceManager, getHost, getHostAliasName, getLocalUserId, getName, getPrimarySubSystem, getProperties, getProperty, getServiceType, 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
 
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
 

Constructor Detail

RemoteProcessSubSystemImpl

public RemoteProcessSubSystemImpl(
IHost host,
                                  
IConnectorService connectorService)
Method Detail

getParentRemoteProcessSubSystemConfiguration

public 
IRemoteProcessSubSystemConfiguration getParentRemoteProcessSubSystemConfiguration()
Description copied from interface: IRemoteProcessSubSystem
Return parent subsystem factory, cast to a RemoteProcessSubSystemConfiguration

Specified by:
getParentRemoteProcessSubSystemConfiguration in interface IRemoteProcessSubSystem

isCaseSensitive

public boolean isCaseSensitive()
Description copied from interface: IRemoteProcessSubSystem
Return true if names are case-sensitive. Used when doing name or type filtering

Specified by:
isCaseSensitive in interface IRemoteProcessSubSystem

communicationsStateChange

public void communicationsStateChange(
CommunicationsEvent e)
Description copied from interface: ICommunicationsListener
This method is invoked whenever the communications state is invoked immediately before and after the state of the communications changes. The state field in CommunicationsEvent determines which state change is about to or has occurred.

Specified by:
communicationsStateChange in interface ICommunicationsListener

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 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.
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.

getParentProcess

public 
IRemoteProcess getParentProcess(
IRemoteProcess process)
Description copied from interface: IRemoteProcessSubSystem
Given a process, return its parent process object.

Specified by:
getParentProcess in interface IRemoteProcessSubSystem
Parameters:
process - the process to return parent of.

internalResolveFilterString

protected 
Object[] internalResolveFilterString(
String filterString,
                                               
IProgressMonitor monitor)
                                        throws 
InvocationTargetException,
                                               
InterruptedException
Description copied from class: SubSystem
Resolve an absolute filter string. This is only applicable if the subsystem factory reports true for SubSystemConfiguration.supportsFilters(), which is the default. Otherwise, SubSystem.getChildren() is called when the subsystem itself is expanded.

When a user expands a filter this method is invoked for each filter string and the results are concatenated and displayed to the user. You can affect the post-concatenated result by overriding SubSystem.sortResolvedFilterStringObjects(Object[]) if you desire to sort the result, say, or pick our redundancies.

The resulting objects are displayed in the tree in the Remote System view. There are two requirements on the returned objects:

  1. They must implement IAdaptable.
  2. Their must be an RSE remote-adapter registered for the object's class or interface type. Further, if this subsystem is visible in the RSE, which is the default, then there must also be an RSE GUI-adapter registered with the platform. The base class implementation of this interface is AbstractSystemViewAdapter.

A good place to start with your remote-resource classes to subclasss AbstractResource, as it already implements IAdaptable, and maintains a reference to this owning subsystem, which helps when implementing the remote-adapter.

Be sure to register your adapter factory in your plugin's startup method.

Actually resolve an absolute filter string. This is called by the run(IProgressMonitor monitor) method, which in turn is called by resolveFilterString.

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 FILTERS!

Overrides:
internalResolveFilterString in class SubSystem
Throws:
InvocationTargetException
InterruptedException

listRoots

public 
IRemoteProcess[] listRoots(
IRemoteProcessContext context,
                                  
IProgressMonitor monitor)
At this point there is only one root process, the 'init' process with pid 1

Specified by:
listRoots in interface IRemoteProcessSubSystem
Parameters:
context - A context object that will be associated with each returned process
monitor - the progress monitor

isPassiveCommunicationsListener

public boolean isPassiveCommunicationsListener()
Description copied from interface: ICommunicationsListener
This method determines if the communications listener is a passive or active listener. Typically a passive listener registers with the communications system and responds to events as they occur. An active listener typically registers with the communications system only for the duration of the task (i.e. user editing a file, or outstanding communications request.) The user will be prompted on a disconnect if there are any active communication listeners registered.

Specified by:
isPassiveCommunicationsListener in interface ICommunicationsListener
Returns:
false if the communications listener is an active listener, true if the communications listener is a passive listener.

getObjectWithAbsoluteName

public 
Object getObjectWithAbsoluteName(
String key,
                                        
IProgressMonitor monitor)
                                 throws 
Exception
Description copied from class: SubSystem
Return the remote object that corresponds to the specified unique ID.

Since the abstract subsystem implementation does not know anything about the specific kinds of resources managed by concrete implementations, this method can only resolve filter references.

subsystem implementations must override this method in order to resolve IDs for the remote objects they manage, to support drag and drop, clipboard copy and other remote object resolving schemes. Extenders that want to support filters should call super.getObjectWithAbsoluteName(key) when they do not find a reference for the key themselves.

Specified by:
getObjectWithAbsoluteName in interface IRemoteObjectResolver
Overrides:
getObjectWithAbsoluteName in class SubSystem
Parameters:
key - the unique id of the remote object. Must not be null.
monitor - the progress monitor
Returns:
the remote object instance, or null if no object is found with the given id.
Throws:
Exception - in case an error occurs contacting the remote system while retrieving the requested remote object. Extenders are encouraged to throw SystemMessageException in order to support good user feedback in case of errors. Since exceptions should only occur while retrieving new remote objects during startup, clients are typically allowed to ignore these exceptions and treat them as if the remote object were simply not there.
See Also:
getObjectWithAbsoluteName(String, IProgressMonitor)

RSE
Release 3.0

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

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire