mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-04 07:35:24 +02:00
[175142] checks during persistence and registration of the service
This commit is contained in:
parent
026349d699
commit
ae9927f462
3 changed files with 47 additions and 7 deletions
|
@ -33,6 +33,7 @@ import org.eclipse.rse.core.model.IRSEModelObject;
|
|||
import org.eclipse.rse.core.model.ISystemProfile;
|
||||
import org.eclipse.rse.core.model.ISystemRegistry;
|
||||
import org.eclipse.rse.core.subsystems.IConnectorService;
|
||||
import org.eclipse.rse.core.subsystems.IDelegatingConnectorService;
|
||||
import org.eclipse.rse.core.subsystems.IServerLauncherProperties;
|
||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||
import org.eclipse.rse.persistence.dom.IRSEDOMConstants;
|
||||
|
@ -295,7 +296,10 @@ public class RSEDOMExporter implements IRSEDOMExporter {
|
|||
IConnectorService[] connectorServices = host.getConnectorServices();
|
||||
for (int i = 0; i < connectorServices.length; i++) {
|
||||
IConnectorService service = connectorServices[i];
|
||||
createNode(node, service, clean);
|
||||
if (!(service instanceof IDelegatingConnectorService)) // don't persist delegated ones
|
||||
{
|
||||
createNode(node, service, clean);
|
||||
}
|
||||
}
|
||||
|
||||
createPropertySetNodes(node, host, clean);
|
||||
|
|
|
@ -17,12 +17,14 @@ import java.io.InputStream;
|
|||
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.ui.internal.ShellPool;
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
import org.eclipse.rse.core.model.IHost;
|
||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||
import org.eclipse.rse.services.shells.IShellService;
|
||||
import org.eclipse.rse.subsystems.processes.servicesubsystem.IProcessServiceSubSystem;
|
||||
import org.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem.IShellServiceSubSystem;
|
||||
|
||||
/**
|
||||
|
@ -182,6 +184,24 @@ public class Activator extends AbstractUIPlugin {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the first IProcessServiceSubSystem service associated with the host.
|
||||
*
|
||||
* @param host the connection
|
||||
* @return shell service subsystem, or <code>null</code> if not found.
|
||||
*/
|
||||
public static IProcessServiceSubSystem getProcessServiceSubSystem(IHost host) {
|
||||
if (host == null)
|
||||
return null;
|
||||
ISubSystem[] subSystems = host.getSubSystems();
|
||||
for (int i = 0; subSystems != null && i < subSystems.length; i++) {
|
||||
if (subSystems[i] instanceof IProcessServiceSubSystem) {
|
||||
return (IProcessServiceSubSystem)subSystems[i];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* append the error message into a string from reading the error Stream.
|
||||
|
|
|
@ -16,26 +16,42 @@ package org.eclipse.rse.subsystems.processes.shell.linux;
|
|||
import org.eclipse.rse.core.model.IHost;
|
||||
import org.eclipse.rse.core.subsystems.AbstractDelegatingConnectorService;
|
||||
import org.eclipse.rse.core.subsystems.IConnectorService;
|
||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||
import org.eclipse.rse.internal.subsystems.processes.shell.linux.Activator;
|
||||
import org.eclipse.rse.subsystems.processes.servicesubsystem.IProcessServiceSubSystem;
|
||||
import org.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem.IShellServiceSubSystem;
|
||||
|
||||
public class DelegatingShellProcessConnectorService extends AbstractDelegatingConnectorService
|
||||
{
|
||||
|
||||
public DelegatingShellProcessConnectorService(IHost host) {
|
||||
private IConnectorService _realService;
|
||||
private ISubSystem _subSystem;
|
||||
public DelegatingShellProcessConnectorService(IHost host)
|
||||
{
|
||||
super(host);
|
||||
}
|
||||
|
||||
public IConnectorService getRealConnectorService()
|
||||
{
|
||||
IShellServiceSubSystem ss = Activator.getShellServiceSubSystem(getHost());
|
||||
if (ss != null)
|
||||
if (_realService != null)
|
||||
{
|
||||
return ss.getConnectorService();
|
||||
return _realService;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
IShellServiceSubSystem ss = Activator.getShellServiceSubSystem(getHost());
|
||||
if (ss != null)
|
||||
{
|
||||
_realService = ss.getConnectorService();
|
||||
|
||||
// register the process subsystem
|
||||
IProcessServiceSubSystem ps = Activator.getProcessServiceSubSystem(getHost());
|
||||
_realService.registerSubSystem(ps);
|
||||
return _realService;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue