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

[226787] [services] Dstore processes subsystem is empty after switching from shell processes

This commit is contained in:
David McKnight 2008-10-29 20:59:13 +00:00
parent eae3f9d29b
commit 4d6b86fe3b

View file

@ -44,6 +44,7 @@
* David McKnight (IBM) - [237970] Subsystem.connect( ) fails for substituting host name when isOffline( ) is true
* David McKnight (IBM) - [244270] Explicit check for isOffline and just returning block implementing a cache for Work Offline
* Don Yantzi (IBM) - [244807] Delay connecting if resolving filters while restoring from cache
* David McKnight (IBM) - [226787] [services] Dstore processes subsystem is empty after switching from shell processes
********************************************************************************/
package org.eclipse.rse.core.subsystems;
@ -3289,10 +3290,27 @@ implements IAdaptable, ISubSystem, ISystemFilterPoolReferenceManagerProvider
* @param newConfig
*/
private void doSwitchServiceConfiguration(ISubSystemConfiguration newConfig) {
try {
disconnect();
} catch (Exception e) {
// only disconnect the connector service if there are no only services that use it
IConnectorService oldConnectorService = getConnectorService();
if (oldConnectorService.isConnected()){
ISubSystem[] associatedSubSystems = oldConnectorService.getSubSystems();
if (associatedSubSystems != null && associatedSubSystems.length > 1){
// at least one other subsystem still using this connector service so don't disconnect
// instead uninitialize this subsystem
uninitializeSubSystem(new NullProgressMonitor());
}
else {
// no more associated subsystems
try {
disconnect();
} catch (Exception e) {
}
}
}
IHost host = getHost();
// remove the old references and store them for later use
ISubSystemConfiguration oldConfig = getSubSystemConfiguration();
@ -3339,7 +3357,8 @@ implements IAdaptable, ISubSystem, ISystemFilterPoolReferenceManagerProvider
}
// switch the connector service
IConnectorService oldConnectorService = getConnectorService();
oldConnectorService.deregisterSubSystem(this);
IConnectorService newConnectorService = newConfig.getConnectorService(host);
setConnectorService(newConnectorService);
@ -3348,6 +3367,13 @@ implements IAdaptable, ISubSystem, ISystemFilterPoolReferenceManagerProvider
// call the subsystem specfic switching support
internalSwitchSubSystemConfiguration(newConfig);
if (newConnectorService.isConnected()){
// make sure that the new service is initialized properly
// since we're already connected and normally it's done as part of connect
initializeSubSystem(new NullProgressMonitor());
}
// commit the subsystem
setDirty(true);