mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-15 21:15:23 +02:00
[226787] [services] Dstore processes subsystem is empty after switching from shell processes
This commit is contained in:
parent
eae3f9d29b
commit
4d6b86fe3b
1 changed files with 30 additions and 4 deletions
|
@ -44,6 +44,7 @@
|
||||||
* David McKnight (IBM) - [237970] Subsystem.connect( ) fails for substituting host name when isOffline( ) is true
|
* 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
|
* 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
|
* 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;
|
package org.eclipse.rse.core.subsystems;
|
||||||
|
@ -3289,10 +3290,27 @@ implements IAdaptable, ISubSystem, ISystemFilterPoolReferenceManagerProvider
|
||||||
* @param newConfig
|
* @param newConfig
|
||||||
*/
|
*/
|
||||||
private void doSwitchServiceConfiguration(ISubSystemConfiguration newConfig) {
|
private void doSwitchServiceConfiguration(ISubSystemConfiguration newConfig) {
|
||||||
try {
|
|
||||||
disconnect();
|
// only disconnect the connector service if there are no only services that use it
|
||||||
} catch (Exception e) {
|
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();
|
IHost host = getHost();
|
||||||
// remove the old references and store them for later use
|
// remove the old references and store them for later use
|
||||||
ISubSystemConfiguration oldConfig = getSubSystemConfiguration();
|
ISubSystemConfiguration oldConfig = getSubSystemConfiguration();
|
||||||
|
@ -3339,7 +3357,8 @@ implements IAdaptable, ISubSystem, ISystemFilterPoolReferenceManagerProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
// switch the connector service
|
// switch the connector service
|
||||||
IConnectorService oldConnectorService = getConnectorService();
|
|
||||||
|
|
||||||
oldConnectorService.deregisterSubSystem(this);
|
oldConnectorService.deregisterSubSystem(this);
|
||||||
IConnectorService newConnectorService = newConfig.getConnectorService(host);
|
IConnectorService newConnectorService = newConfig.getConnectorService(host);
|
||||||
setConnectorService(newConnectorService);
|
setConnectorService(newConnectorService);
|
||||||
|
@ -3349,6 +3368,13 @@ implements IAdaptable, ISubSystem, ISystemFilterPoolReferenceManagerProvider
|
||||||
// call the subsystem specfic switching support
|
// call the subsystem specfic switching support
|
||||||
internalSwitchSubSystemConfiguration(newConfig);
|
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
|
// commit the subsystem
|
||||||
setDirty(true);
|
setDirty(true);
|
||||||
commit();
|
commit();
|
||||||
|
|
Loading…
Add table
Reference in a new issue