1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-05 23:35:48 +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 * 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 * 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 * 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 * 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}. * extended by subsystem providers, by extending SubSystem.
* <p> * <p>
*/ */
public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, IRemoteObjectResolver, ISchedulingRule, IRSEModelObject, IRSEPersistableContainer public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, IRemoteObjectResolver, ISchedulingRule, IRSEModelObject, IRSEPersistableContainer
@ -74,12 +74,14 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I
public IHost getHost(); 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); 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); 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 * To set the local user Id, simply call setUserId(String id). To clear it, call
* {@link #clearLocalUserId()}. * {@link #clearLocalUserId()}.
* <p> * <p>
* @see org.eclipse.rse.model.IHost#getDefaultUserId() * @see IHost#getDefaultUserId()
* @see #clearLocalUserId() * @see #clearLocalUserId()
* @see #getUserId() * @see #getUserId()
* @see #setUserId(String)
*/ */
public String getLocalUserId(); 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 * return the parent connection's default user Id. Sets the user Id attribute for this
* subsystem to null. * subsystem to null.
* <p> * <p>
* @see org.eclipse.rse.model.IHost#getDefaultUserId() * @see IHost#getDefaultUserId()
* @see #getUserId() * @see #getUserId()
* @see #getLocalUserId() * @see #getLocalUserId()
* @see #setUserId(String)
*/ */
public void clearLocalUserId(); 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. * 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. * This is transparent to callers of this method however, as this method resolves from the preferences.
* *
* @see org.eclipse.rse.model.IHost#getDefaultUserId() * @see IHost#getDefaultUserId()
* @see #setUserId(String)
* @see #getLocalUserId() * @see #getLocalUserId()
* @see #clearLocalUserId() * @see #clearLocalUserId()
* @return The value of the UserId attribute * @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 * Resolve multiple absolute filter strings. This is only applicable if the subsystem
* factory reports true for supportsFilters(). * factory reports true for supportsFilters().
* <p> * <p>
* This is the same as {@link #resolveFilterString(String,Shell)} but takes an array of * This is the same as {@link #resolveFilterString(String)} but takes an array of
* filter strings versus a single filter string. * filter strings versus a single filter string.
* *
* @param filterStrings array of filter patterns for objects to return. * @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) public Object[] resolveFilterStrings(String[] filterStrings)
throws Exception; 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 * 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 * a number of remote environment variables. This is only applicable if the subsystem factory reports
* true for supportsProperties(). * true for supportsProperties().
* @param subject Identifies which object to get the properties of * @param subject Identifies which object to get the properties of
* @param key Identifies property to set * @param keys Identifies the properties to set
* @param value Values to set properties to. One to one mapping to keys by index number * @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. * @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) 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 * a remote environment variable. This is only applicable if the subsystem factory reports
* true for supportsProperties(). * true for supportsProperties().
* @param subject Identifies which object to get the properties of * @param subject Identifies which object to get the properties of
* @param key Identifies property to get value of * @param keys Identifies properties to get value of
* @return Object The values of the requested keys. * @return The values of the requested keys.
*/ */
public String[] getProperties(Object subject, String[] keys) public String[] getProperties(Object subject, String[] keys)
throws Exception; 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 * 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. * subsystem implementation to decide what "parent object" means for a filter reference.
* @param filterRef the filter reference to determine a target object from. * @param filterRef the filter reference to determine a target object from.
* @return * @return An object representing the parent
*/ */
Object getTargetForFilter(ISystemFilterReference filterRef); Object getTargetForFilter(ISystemFilterReference filterRef);

View file

@ -2003,7 +2003,6 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
{ {
try try
{ {
//dwd this.shell = shell; //FIXME remove this
ResolveAbsoluteJob job = new ResolveAbsoluteJob(filterString); ResolveAbsoluteJob job = new ResolveAbsoluteJob(filterString);
IStatus status = scheduleJob(job, null, shell != null); IStatus status = scheduleJob(job, null, shell != null);
@ -2067,7 +2066,6 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
{ {
try try
{ {
//dwd this.shell = shell; //FIXME remove this
ResolveAbsolutesJob job = new ResolveAbsolutesJob(filterStrings[0], filterStrings); ResolveAbsolutesJob job = new ResolveAbsolutesJob(filterStrings[0], filterStrings);
IStatus status = scheduleJob(job, null, true); IStatus status = scheduleJob(job, null, true);
@ -2322,7 +2320,6 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
{ {
try try
{ {
//dwd this.shell = shell; //FIXME remove this
ResolveRelativeJob job = new ResolveRelativeJob(filterString, parent); ResolveRelativeJob job = new ResolveRelativeJob(filterString, parent);
@ -2379,7 +2376,6 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
{ {
try try
{ {
//dwd this.shell = shell; //FIXME remove this
SetPropertyJob job = new SetPropertyJob(subject, key, value); SetPropertyJob job = new SetPropertyJob(subject, key, value);
IStatus status = scheduleJob(job, null, true); IStatus status = scheduleJob(job, null, true);
@ -2417,7 +2413,6 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
{ {
try try
{ {
//dwd this.shell = shell; //FIXME remove this
GetPropertyJob job = new GetPropertyJob(subject, key); GetPropertyJob job = new GetPropertyJob(subject, key);
scheduleJob(job, null, true); scheduleJob(job, null, true);
@ -2457,7 +2452,6 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
{ {
try try
{ {
//dwd this.shell = shell; //FIXME remove this
SetPropertiesJob job = new SetPropertiesJob(subject, keys, values); SetPropertiesJob job = new SetPropertiesJob(subject, keys, values);
IStatus status = scheduleJob(job, null, true); 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 * This method should be overridden if any initialization for the subsystem needs
* to occur at this time * 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. * 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); msg.makeSubstitution(hostName);
throw new SystemMessageException(msg); throw new SystemMessageException(msg);
} }
//dwd this.shell = shell; //FIXME remove this
// yantzi: artemis 6.0, offline support // yantzi: artemis 6.0, offline support
if (isOffline()) { if (isOffline()) {
SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_OFFLINE_CANT_CONNECT); 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 public void disconnect(boolean collapseTree) throws Exception
{ {
_disconnecting = true; _disconnecting = true;
//dwd this.shell = shell; //FIXME remove this
if (!isConnected() || !supportsConnecting) if (!isConnected() || !supportsConnecting)
{ {
// disconnected but may not have notified viewers (i.e. network problem) // 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) public String[] getProperties(Object subject, String[] keys)
throws Exception throws Exception
{ {
//dwd this.shell = shell; //FIXME remove this
boolean ok = true; boolean ok = true;
if (!isConnected()) if (!isConnected())