mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-15 04:55:22 +02:00
[259414] refactored ssh shells subsystem to use the generic Terminal->IHostShell converter.
This commit is contained in:
parent
51f51acfb9
commit
b27996fd6a
2 changed files with 8 additions and 2 deletions
|
@ -14,6 +14,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Martin Oberhuber (Wind River) - Adapted from LocalServiceCommandShell
|
* Martin Oberhuber (Wind River) - Adapted from LocalServiceCommandShell
|
||||||
* Martin Oberhuber (Wind River) - [225510][api] Fix OutputRefreshJob API leakage
|
* Martin Oberhuber (Wind River) - [225510][api] Fix OutputRefreshJob API leakage
|
||||||
|
* Anna Dushistova (MontaVista) - [259414][api] refactor the "SSH Shell" to use the generic Terminal->IHostShell converter
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.subsystems.shells.ssh;
|
package org.eclipse.rse.internal.subsystems.shells.ssh;
|
||||||
|
@ -26,6 +27,7 @@ import org.eclipse.core.runtime.NullProgressMonitor;
|
||||||
import org.eclipse.core.runtime.Path;
|
import org.eclipse.core.runtime.Path;
|
||||||
|
|
||||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||||
|
import org.eclipse.rse.internal.services.shells.TerminalServiceHostShell;
|
||||||
import org.eclipse.rse.internal.services.ssh.shell.SshHostShell;
|
import org.eclipse.rse.internal.services.ssh.shell.SshHostShell;
|
||||||
import org.eclipse.rse.services.shells.IHostOutput;
|
import org.eclipse.rse.services.shells.IHostOutput;
|
||||||
import org.eclipse.rse.services.shells.IHostShell;
|
import org.eclipse.rse.services.shells.IHostShell;
|
||||||
|
@ -181,6 +183,9 @@ public class SshServiceCommandShell extends ServiceCommandShell
|
||||||
*/
|
*/
|
||||||
protected String getPromptCommand() {
|
protected String getPromptCommand() {
|
||||||
IHostShell shell = getHostShell();
|
IHostShell shell = getHostShell();
|
||||||
|
if (shell instanceof TerminalServiceHostShell) {
|
||||||
|
return ((TerminalServiceHostShell)shell).getPromptCommand();
|
||||||
|
}
|
||||||
//Assert shell instanceof SshHostShell;
|
//Assert shell instanceof SshHostShell;
|
||||||
if (shell instanceof SshHostShell) {
|
if (shell instanceof SshHostShell) {
|
||||||
return ((SshHostShell)shell).getPromptCommand();
|
return ((SshHostShell)shell).getPromptCommand();
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Martin Oberhuber (Wind River) - Adapted template for ssh service.
|
* Martin Oberhuber (Wind River) - Adapted template for ssh service.
|
||||||
|
* Anna Dushistova (MontaVista) - [259414][api] refactor the "SSH Shell" to use the generic Terminal->IHostShell converter
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.subsystems.shells.ssh;
|
package org.eclipse.rse.subsystems.shells.ssh;
|
||||||
|
@ -23,7 +24,7 @@ import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||||
import org.eclipse.rse.internal.connectorservice.ssh.SshConnectorService;
|
import org.eclipse.rse.internal.connectorservice.ssh.SshConnectorService;
|
||||||
import org.eclipse.rse.internal.connectorservice.ssh.SshConnectorServiceManager;
|
import org.eclipse.rse.internal.connectorservice.ssh.SshConnectorServiceManager;
|
||||||
import org.eclipse.rse.internal.services.ssh.ISshService;
|
import org.eclipse.rse.internal.services.ssh.ISshService;
|
||||||
import org.eclipse.rse.internal.services.ssh.shell.SshShellService;
|
import org.eclipse.rse.internal.services.ssh.terminal.SshTerminalService;
|
||||||
import org.eclipse.rse.internal.subsystems.shells.ssh.SshServiceCommandShell;
|
import org.eclipse.rse.internal.subsystems.shells.ssh.SshServiceCommandShell;
|
||||||
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;
|
||||||
|
@ -61,7 +62,7 @@ public class SshShellSubSystemConfiguration extends
|
||||||
|
|
||||||
public IShellService createShellService(IHost host) {
|
public IShellService createShellService(IHost host) {
|
||||||
SshConnectorService cserv = (SshConnectorService)getConnectorService(host);
|
SshConnectorService cserv = (SshConnectorService)getConnectorService(host);
|
||||||
return new SshShellService(cserv);
|
return (IShellService) (new SshTerminalService(cserv)).getAdapter(IShellService.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IConnectorService getConnectorService(IHost host) {
|
public IConnectorService getConnectorService(IHost host) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue