mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-14 04:25:21 +02:00
[239159] Replaced IShellSubSystem with ISubSystem that provides an IService that is adaptable to an IShellService
This commit is contained in:
parent
22ab47928b
commit
f662be4160
5 changed files with 27 additions and 22 deletions
|
@ -1,4 +1,4 @@
|
||||||
Manifest-Version: 1.0
|
Manifest-Version: 1.1.1.qualifier
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: %pluginName
|
Bundle-Name: %pluginName
|
||||||
Bundle-SymbolicName: org.eclipse.rse.subsystems.processes.shell.linux;singleton:=true
|
Bundle-SymbolicName: org.eclipse.rse.subsystems.processes.shell.linux;singleton:=true
|
||||||
|
@ -10,8 +10,7 @@ Require-Bundle: org.eclipse.ui,
|
||||||
org.eclipse.rse.ui;bundle-version="[3.0.0,4.0.0)",
|
org.eclipse.rse.ui;bundle-version="[3.0.0,4.0.0)",
|
||||||
org.eclipse.rse.services;bundle-version="[3.0.0,4.0.0)",
|
org.eclipse.rse.services;bundle-version="[3.0.0,4.0.0)",
|
||||||
org.eclipse.rse.core;bundle-version="[3.0.0,4.0.0)",
|
org.eclipse.rse.core;bundle-version="[3.0.0,4.0.0)",
|
||||||
org.eclipse.rse.subsystems.processes.core;bundle-version="[3.0.0,4.0.0)",
|
org.eclipse.rse.subsystems.processes.core;bundle-version="[3.0.0,4.0.0)"
|
||||||
org.eclipse.rse.subsystems.shells.core;bundle-version="[3.0.0,4.0.0)"
|
|
||||||
Bundle-ActivationPolicy: lazy
|
Bundle-ActivationPolicy: lazy
|
||||||
Eclipse-LazyStart: true
|
Eclipse-LazyStart: true
|
||||||
Bundle-Vendor: %providerName
|
Bundle-Vendor: %providerName
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2006, 2007 MontaVista Software, Inc. and others.
|
* Copyright (c) 2006, 2008 MontaVista Software, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Yu-Fen Kuo (MontaVista) - initial API and implementation
|
* Yu-Fen Kuo (MontaVista) - initial API and implementation
|
||||||
* Martin Oberhuber (Wind River) - [refactor] "shell" instead of "ssh" everywhere
|
* Martin Oberhuber (Wind River) - [refactor] "shell" instead of "ssh" everywhere
|
||||||
|
* Anna Dushistova (MontaVista) - [239159] The shell process subsystem not working without the shells subsystem present for the systemType
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.subsystems.processes.shell.linux;
|
package org.eclipse.rse.internal.subsystems.processes.shell.linux;
|
||||||
|
@ -22,9 +23,9 @@ import org.osgi.framework.BundleContext;
|
||||||
|
|
||||||
import org.eclipse.rse.core.model.IHost;
|
import org.eclipse.rse.core.model.IHost;
|
||||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||||
|
import org.eclipse.rse.services.IService;
|
||||||
import org.eclipse.rse.services.shells.IShellService;
|
import org.eclipse.rse.services.shells.IShellService;
|
||||||
import org.eclipse.rse.subsystems.processes.servicesubsystem.IProcessServiceSubSystem;
|
import org.eclipse.rse.subsystems.processes.servicesubsystem.IProcessServiceSubSystem;
|
||||||
import org.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem.IShellServiceSubSystem;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The activator class controls the plug-in life cycle
|
* The activator class controls the plug-in life cycle
|
||||||
|
@ -159,9 +160,9 @@ public class Activator extends AbstractUIPlugin {
|
||||||
* @return shell service object, or <code>null</code> if not found.
|
* @return shell service object, or <code>null</code> if not found.
|
||||||
*/
|
*/
|
||||||
public static IShellService getShellService(IHost host) {
|
public static IShellService getShellService(IHost host) {
|
||||||
IShellServiceSubSystem ss = getShellServiceSubSystem(host);
|
ISubSystem ss = getSuitableSubSystem(host);
|
||||||
if (ss!=null) {
|
if (ss!=null) {
|
||||||
return ss.getShellService();
|
return (IShellService)ss.getSubSystemConfiguration().getService(host).getAdapter(IShellService.class);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -172,14 +173,19 @@ public class Activator extends AbstractUIPlugin {
|
||||||
* @param host the connection
|
* @param host the connection
|
||||||
* @return shell service subsystem, or <code>null</code> if not found.
|
* @return shell service subsystem, or <code>null</code> if not found.
|
||||||
*/
|
*/
|
||||||
public static IShellServiceSubSystem getShellServiceSubSystem(IHost host) {
|
public static ISubSystem getSuitableSubSystem(IHost host) {
|
||||||
if (host == null)
|
if (host == null)
|
||||||
return null;
|
return null;
|
||||||
ISubSystem[] subSystems = host.getSubSystems();
|
ISubSystem[] subSystems = host.getSubSystems();
|
||||||
|
IShellService ssvc = null;
|
||||||
for (int i = 0; subSystems != null && i < subSystems.length; i++) {
|
for (int i = 0; subSystems != null && i < subSystems.length; i++) {
|
||||||
if (subSystems[i] instanceof IShellServiceSubSystem) {
|
IService svc = subSystems[i].getSubSystemConfiguration().getService(host);
|
||||||
return (IShellServiceSubSystem)subSystems[i];
|
if (svc!=null) {
|
||||||
}
|
ssvc = (IShellService)svc.getAdapter(IShellService.class);
|
||||||
|
if (ssvc != null) {
|
||||||
|
return subSystems[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Copyright (c) 2007 IBM Corporation. All rights reserved.
|
* Copyright (c) 2007, 2008 IBM Corporation and others. All rights reserved.
|
||||||
* This program and the accompanying materials are made available under the terms
|
* This program and the accompanying materials are made available under the terms
|
||||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
@ -9,16 +9,15 @@
|
||||||
* component that contains this file: David McKnight.
|
* component that contains this file: David McKnight.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* {Name} (company) - description of contribution.
|
* Anna Dushistova (MontaVista) - [239159] The shell process subsystem not working without the shells subsystem present for the systemType
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
package org.eclipse.rse.internal.subsystems.processes.shell.linux;
|
package org.eclipse.rse.internal.subsystems.processes.shell.linux;
|
||||||
|
|
||||||
import org.eclipse.rse.core.model.IHost;
|
import org.eclipse.rse.core.model.IHost;
|
||||||
import org.eclipse.rse.core.subsystems.AbstractDelegatingConnectorService;
|
import org.eclipse.rse.core.subsystems.AbstractDelegatingConnectorService;
|
||||||
import org.eclipse.rse.core.subsystems.IConnectorService;
|
import org.eclipse.rse.core.subsystems.IConnectorService;
|
||||||
|
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||||
import org.eclipse.rse.subsystems.processes.servicesubsystem.IProcessServiceSubSystem;
|
import org.eclipse.rse.subsystems.processes.servicesubsystem.IProcessServiceSubSystem;
|
||||||
import org.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem.IShellServiceSubSystem;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class delegates the connector service requests for the linux process
|
* This class delegates the connector service requests for the linux process
|
||||||
|
@ -47,7 +46,7 @@ public class DelegatingShellProcessConnectorService extends AbstractDelegatingCo
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
IShellServiceSubSystem ss = Activator.getShellServiceSubSystem(getHost());
|
ISubSystem ss = Activator.getSuitableSubSystem(getHost());
|
||||||
if (ss != null)
|
if (ss != null)
|
||||||
{
|
{
|
||||||
_realService = ss.getConnectorService();
|
_realService = ss.getConnectorService();
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
* David McKnight (IBM) - [175308] Need to use a job to wait for shell to exit
|
* David McKnight (IBM) - [175308] Need to use a job to wait for shell to exit
|
||||||
* Martin Oberhuber (Wind River) - [226262] Make IService IAdaptable and add Javadoc
|
* Martin Oberhuber (Wind River) - [226262] Make IService IAdaptable and add Javadoc
|
||||||
* Martin Oberhuber (Wind River) - [226301][api] IShellService should throw SystemMessageException on error
|
* Martin Oberhuber (Wind River) - [226301][api] IShellService should throw SystemMessageException on error
|
||||||
|
* Anna Dushistova (MontaVista) - [239159] The shell process subsystem not working without the shells subsystem present for the systemType
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.subsystems.processes.shell.linux;
|
package org.eclipse.rse.internal.subsystems.processes.shell.linux;
|
||||||
|
@ -26,6 +27,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||||
|
|
||||||
import org.eclipse.rse.core.model.IHost;
|
import org.eclipse.rse.core.model.IHost;
|
||||||
|
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||||
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
|
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
|
||||||
import org.eclipse.rse.services.clientserver.processes.IHostProcess;
|
import org.eclipse.rse.services.clientserver.processes.IHostProcess;
|
||||||
import org.eclipse.rse.services.clientserver.processes.IHostProcessFilter;
|
import org.eclipse.rse.services.clientserver.processes.IHostProcessFilter;
|
||||||
|
@ -34,7 +36,6 @@ import org.eclipse.rse.services.processes.AbstractProcessService;
|
||||||
import org.eclipse.rse.services.shells.HostShellProcessAdapter;
|
import org.eclipse.rse.services.shells.HostShellProcessAdapter;
|
||||||
import org.eclipse.rse.services.shells.IHostShell;
|
import org.eclipse.rse.services.shells.IHostShell;
|
||||||
import org.eclipse.rse.services.shells.IShellService;
|
import org.eclipse.rse.services.shells.IShellService;
|
||||||
import org.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem.IShellServiceSubSystem;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* class to fetch remote linux target's process info
|
* class to fetch remote linux target's process info
|
||||||
|
@ -106,7 +107,7 @@ public class LinuxShellProcessService extends AbstractProcessService {
|
||||||
final IProgressMonitor monitor) throws SystemMessageException {
|
final IProgressMonitor monitor) throws SystemMessageException {
|
||||||
// this is to workaround RSE bug 147531
|
// this is to workaround RSE bug 147531
|
||||||
if (filter.getUsername().equals("${user.id}") && host != null) { //$NON-NLS-1$
|
if (filter.getUsername().equals("${user.id}") && host != null) { //$NON-NLS-1$
|
||||||
IShellServiceSubSystem ss = Activator.getShellServiceSubSystem(host);
|
ISubSystem ss = Activator.getSuitableSubSystem(host);
|
||||||
if (ss!=null) {
|
if (ss!=null) {
|
||||||
// change filter username so the filter will filter out the right
|
// change filter username so the filter will filter out the right
|
||||||
// process for my processes
|
// process for my processes
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved.
|
* Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved.
|
||||||
* This program and the accompanying materials are made available under the terms
|
* This program and the accompanying materials are made available under the terms
|
||||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
@ -14,6 +14,7 @@
|
||||||
* Yu-Fen Kuo (MontaVista) - adapted from RSE ProcessServiceSubSystemConfiguration
|
* Yu-Fen Kuo (MontaVista) - adapted from RSE ProcessServiceSubSystemConfiguration
|
||||||
* Martin Oberhuber (Wind River) - [refactor] "shell" instead of "ssh" everywhere
|
* Martin Oberhuber (Wind River) - [refactor] "shell" instead of "ssh" everywhere
|
||||||
* Martin Oberhuber (Wind River) - [186523] Move subsystemConfigurations from UI to core
|
* Martin Oberhuber (Wind River) - [186523] Move subsystemConfigurations from UI to core
|
||||||
|
* Anna Dushistova (MontaVista) - [239159] The shell process subsystem not working without the shells subsystem present for the systemType
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.subsystems.processes.shell.linux;
|
package org.eclipse.rse.subsystems.processes.shell.linux;
|
||||||
|
@ -30,7 +31,6 @@ import org.eclipse.rse.services.shells.IShellService;
|
||||||
import org.eclipse.rse.subsystems.processes.core.subsystem.IHostProcessToRemoteProcessAdapter;
|
import org.eclipse.rse.subsystems.processes.core.subsystem.IHostProcessToRemoteProcessAdapter;
|
||||||
import org.eclipse.rse.subsystems.processes.servicesubsystem.ProcessServiceSubSystem;
|
import org.eclipse.rse.subsystems.processes.servicesubsystem.ProcessServiceSubSystem;
|
||||||
import org.eclipse.rse.subsystems.processes.servicesubsystem.ProcessServiceSubSystemConfiguration;
|
import org.eclipse.rse.subsystems.processes.servicesubsystem.ProcessServiceSubSystemConfiguration;
|
||||||
import org.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem.IShellServiceSubSystem;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is used by org.eclipse.rse.core.subsystemConfigurations extension
|
* This class is used by org.eclipse.rse.core.subsystemConfigurations extension
|
||||||
|
@ -58,7 +58,7 @@ public class ShellProcessSubSystemConfiguration extends
|
||||||
|
|
||||||
public IConnectorService getConnectorService(IHost host)
|
public IConnectorService getConnectorService(IHost host)
|
||||||
{
|
{
|
||||||
IShellServiceSubSystem ss = Activator.getShellServiceSubSystem(host);
|
ISubSystem ss = Activator.getSuitableSubSystem(host);
|
||||||
if (ss!=null)
|
if (ss!=null)
|
||||||
{
|
{
|
||||||
return ss.getConnectorService();
|
return ss.getConnectorService();
|
||||||
|
|
Loading…
Add table
Reference in a new issue