1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-03 14:25:37 +02:00

[150388] default implementations of initializeSubSystem and uninitializeSubSystem have been provided.

This commit is contained in:
David Dykstal 2006-12-14 03:58:09 +00:00
parent ee97e0f348
commit f3a88b6106
2 changed files with 35 additions and 34 deletions

View file

@ -33,10 +33,10 @@ import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
/**
* Interface implemented by SubSystem objects. While connections contain information to identify a
* particular remote system, it is the subsystem objects within a connection that contain information
* unique to a particular tool, for that remote system, such as the port the tool uses and the
* user ID for making the connection. There are a set of default properties, but these can be
* extended by subsystem providers, by extending {@link SubSystem}.
* particular remote system, it is the subsystem objects within a connection that contain information
* unique to a particular tool, for that remote system, such as the port the tool uses and the
* user ID for making the connection. There are a set of default properties, but these can be
* extended by subsystem providers, by extending SubSystem.
* <p>
*/
public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, IRemoteObjectResolver, ISchedulingRule, IRSEModelObject, IRSEPersistableContainer
@ -74,12 +74,14 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I
public IHost getHost();
/**
* Called on each subsystem associated with a particular IConnectorService after it connects
* Called on each subsystem associated with a particular {@link IConnectorService} after it connects.
* @param monitor A progress monitor supporting progress reporting and cancellation.
*/
public void initializeSubSystem(IProgressMonitor monitor);
/**
* Called on each subsystem associated with a particular IConnectorService after it disconnects
* Called on each subsystem associated with a particular {@link IConnectorService} after it disconnects
* @param monitor A progress monitor supporting progress reporting and cancellation.
*/
public void uninitializeSubSystem(IProgressMonitor monitor);
@ -187,10 +189,9 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I
* To set the local user Id, simply call setUserId(String id). To clear it, call
* {@link #clearLocalUserId()}.
* <p>
* @see org.eclipse.rse.model.IHost#getDefaultUserId()
* @see IHost#getDefaultUserId()
* @see #clearLocalUserId()
* @see #getUserId()
* @see #setUserId(String)
*/
public String getLocalUserId();
/**
@ -198,10 +199,9 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I
* return the parent connection's default user Id. Sets the user Id attribute for this
* subsystem to null.
* <p>
* @see org.eclipse.rse.model.IHost#getDefaultUserId()
* @see IHost#getDefaultUserId()
* @see #getUserId()
* @see #getLocalUserId()
* @see #setUserId(String)
*/
public void clearLocalUserId();
/**
@ -277,8 +277,7 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I
* user preferences, so that such things are not shared among the team on a synchronize operation.
* This is transparent to callers of this method however, as this method resolves from the preferences.
*
* @see org.eclipse.rse.model.IHost#getDefaultUserId()
* @see #setUserId(String)
* @see IHost#getDefaultUserId()
* @see #getLocalUserId()
* @see #clearLocalUserId()
* @return The value of the UserId attribute
@ -478,11 +477,11 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I
* Resolve multiple absolute filter strings. This is only applicable if the subsystem
* factory reports true for supportsFilters().
* <p>
* This is the same as {@link #resolveFilterString(String,Shell)} but takes an array of
* filter strings versus a single filter string.
* This is the same as {@link #resolveFilterString(String)} but takes an array of
* filter strings versus a single filter string.
*
* @param filterStrings array of filter patterns for objects to return.
* @return Array of objects that are the result of resolving all the filter strings
* @return Array of objects that are the result of resolving all the filter strings
*/
public Object[] resolveFilterStrings(String[] filterStrings)
throws Exception;
@ -559,11 +558,11 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I
/**
* Set multiple remote properties. Subsystems interpret as they wish. Eg, this might be to set
* a number of remote environment variables. This is only applicable if the subsystem factory reports
* true for supportsProperties().
* a number of remote environment variables. This is only applicable if the subsystem factory reports
* true for supportsProperties().
* @param subject Identifies which object to get the properties of
* @param key Identifies property to set
* @param value Values to set properties to. One to one mapping to keys by index number
* @param keys Identifies the properties to set
* @param values Values to set properties to. One to one mapping to keys by index number
* @return Object interpretable by subsystem. Might be a Boolean, or the might be new values for confirmation.
*/
public Object setProperties(Object subject, String[] keys, String[] values)
@ -574,8 +573,8 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I
* a remote environment variable. This is only applicable if the subsystem factory reports
* true for supportsProperties().
* @param subject Identifies which object to get the properties of
* @param key Identifies property to get value of
* @return Object The values of the requested keys.
* @param keys Identifies properties to get value of
* @return The values of the requested keys.
*/
public String[] getProperties(Object subject, String[] keys)
throws Exception;
@ -628,7 +627,7 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I
* Returns the parent object associated with a filter reference. It's up to the
* subsystem implementation to decide what "parent object" means for a filter reference.
* @param filterRef the filter reference to determine a target object from.
* @return
* @return An object representing the parent
*/
Object getTargetForFilter(ISystemFilterReference filterRef);

View file

@ -2003,7 +2003,6 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
{
try
{
//dwd this.shell = shell; //FIXME remove this
ResolveAbsoluteJob job = new ResolveAbsoluteJob(filterString);
IStatus status = scheduleJob(job, null, shell != null);
@ -2067,7 +2066,6 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
{
try
{
//dwd this.shell = shell; //FIXME remove this
ResolveAbsolutesJob job = new ResolveAbsolutesJob(filterStrings[0], filterStrings);
IStatus status = scheduleJob(job, null, true);
@ -2322,7 +2320,6 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
{
try
{
//dwd this.shell = shell; //FIXME remove this
ResolveRelativeJob job = new ResolveRelativeJob(filterString, parent);
@ -2379,7 +2376,6 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
{
try
{
//dwd this.shell = shell; //FIXME remove this
SetPropertyJob job = new SetPropertyJob(subject, key, value);
IStatus status = scheduleJob(job, null, true);
@ -2417,7 +2413,6 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
{
try
{
//dwd this.shell = shell; //FIXME remove this
GetPropertyJob job = new GetPropertyJob(subject, key);
scheduleJob(job, null, true);
@ -2457,7 +2452,6 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
{
try
{
//dwd this.shell = shell; //FIXME remove this
SetPropertiesJob job = new SetPropertiesJob(subject, keys, values);
IStatus status = scheduleJob(job, null, true);
@ -2478,12 +2472,23 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
}
/**
* This gets called after the corresponding {@link IConnectorService} connect method finishes.
* Initialize this subsystem instance after the corresponding {@link IConnectorService} connect method finishes.
* This method should be overridden if any initialization for the subsystem needs
* to occur at this time
* <p> The default implementation currently does nothing, but overriding methods should call super.
* @param monitor a monitor that can be used to show progress or provide cancellation.
*/
public abstract void initializeSubSystem(IProgressMonitor monitor);
public void initializeSubSystem(IProgressMonitor monitor) {
}
/**
* Uninitialize this subsystem just after disconnect.
* The default implementation currently does nothing.
* Overriding methods should call super.
* @param monitor a progress monitor that can be used to show uninitialization progress can provide cancellation.
*/
public void uninitializeSubSystem(IProgressMonitor monitor) {
}
/**
* Attempt to connect to the remote system when a Shell is not available.
@ -2536,7 +2541,6 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
msg.makeSubstitution(hostName);
throw new SystemMessageException(msg);
}
//dwd this.shell = shell; //FIXME remove this
// yantzi: artemis 6.0, offline support
if (isOffline()) {
SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_OFFLINE_CANT_CONNECT);
@ -2638,7 +2642,6 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
public void disconnect(boolean collapseTree) throws Exception
{
_disconnecting = true;
//dwd this.shell = shell; //FIXME remove this
if (!isConnected() || !supportsConnecting)
{
// disconnected but may not have notified viewers (i.e. network problem)
@ -2680,7 +2683,6 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
public String[] getProperties(Object subject, String[] keys)
throws Exception
{
//dwd this.shell = shell; //FIXME remove this
boolean ok = true;
if (!isConnected())