Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 113308 Details for
Bug 227569
[rseterminal][api] Provide a "generic" Terminal subsystem in order to implement a Telnet Terminal
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
first draft
org.eclipse.rse.terminals-genericTerminalSubsystem.diff (text/plain), 10.69 KB, created by
Anna Dushistova
on 2008-09-23 18:39:54 EDT
(
hide
)
Description:
first draft
Filename:
MIME Type:
Creator:
Anna Dushistova
Created:
2008-09-23 18:39:54 EDT
Size:
10.69 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rse.subsystems.terminals.core >Index: plugin.properties >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.subsystems.terminals.core/plugin.properties,v >retrieving revision 1.1 >diff -u -r1.1 plugin.properties >--- plugin.properties 16 Apr 2008 20:56:40 -0000 1.1 >+++ plugin.properties 10 Sep 2008 14:24:18 -0000 >@@ -14,3 +14,6 @@ > > pluginName = RSE Terminals Core (Incubation) > providerName = Eclipse.org >+ >+TerminalSubsystemName = Terminals >+TerminalSubsystemDescription = Work with terminals and commands on remote systems. >Index: src/org/eclipse/rse/subsystems/terminals/core/TerminalServiceSubSystemConfiguration.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.subsystems.terminals.core/src/org/eclipse/rse/subsystems/terminals/core/TerminalServiceSubSystemConfiguration.java,v >retrieving revision 1.1 >diff -u -r1.1 TerminalServiceSubSystemConfiguration.java >--- src/org/eclipse/rse/subsystems/terminals/core/TerminalServiceSubSystemConfiguration.java 16 Apr 2008 20:56:41 -0000 1.1 >+++ src/org/eclipse/rse/subsystems/terminals/core/TerminalServiceSubSystemConfiguration.java 10 Sep 2008 14:24:18 -0000 >@@ -51,4 +51,9 @@ > return ITerminalService.class; > } > >+ public boolean isFactoryFor(Class subSystemType) { >+ boolean isFor = TerminalServiceSubSystem.class.equals(subSystemType); >+ return isFor; >+ } >+ > } >Index: src/org/eclipse/rse/internal/subsystems/terminals/core/TerminalSubSystemConfigurationImpl.java >=================================================================== >RCS file: src/org/eclipse/rse/internal/subsystems/terminals/core/TerminalSubSystemConfigurationImpl.java >diff -N src/org/eclipse/rse/internal/subsystems/terminals/core/TerminalSubSystemConfigurationImpl.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/rse/internal/subsystems/terminals/core/TerminalSubSystemConfigurationImpl.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,62 @@ >+/******************************************************************************* >+ * Copyright (c) 2008 MontaVista Software, Inc. >+ * All rights reserved. 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 available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Yu-Fen Kuo (MontaVista)- initial API and implementation >+ *******************************************************************************/ >+ >+package org.eclipse.rse.internal.subsystems.terminals.core; >+ >+import org.eclipse.rse.core.model.IHost; >+import org.eclipse.rse.core.subsystems.IConnectorService; >+import org.eclipse.rse.core.subsystems.ISubSystem; >+import org.eclipse.rse.internal.services.terminals.ITerminalService; >+import org.eclipse.rse.subsystems.terminals.core.TerminalServiceSubSystem; >+import org.eclipse.rse.subsystems.terminals.core.TerminalServiceSubSystemConfiguration; >+ >+public class TerminalSubSystemConfigurationImpl extends >+ TerminalServiceSubSystemConfiguration { >+ >+ /** >+ * Instantiate and return an instance of OUR subsystem. Do not populate it >+ * yet though! >+ * >+ * @see org.eclipse.rse.core.subsystems.SubSystemConfiguration#createSubSystemInternal(IHost) >+ */ >+ public ISubSystem createSubSystemInternal(IHost host) { >+ IConnectorService connectorService = getConnectorService(host); >+ ISubSystem subsys = new TerminalServiceSubSystem(host, >+ connectorService, getTerminalService(host)); >+ return subsys; >+ } >+ >+ public ITerminalService createTerminalService(IHost host) { >+ ISubSystem ss = TerminalSubSystemHelper.getSuitableSubSystem(host); >+ if (ss != null) { >+ return (ITerminalService) (ss.getSubSystemConfiguration() >+ .getService(host)).getAdapter(ITerminalService.class); >+ } else { >+ return null; >+ } >+ } >+ >+ public void setConnectorService(IHost host, >+ IConnectorService connectorService) { >+// SshConnectorServiceManager.getInstance().setConnectorService(host, >+// ISshService.class, connectorService); >+// Nothing to do here since we just re-use the existing suitable subsystem >+ } >+ >+ public IConnectorService getConnectorService(IHost host) { >+ ISubSystem ss = TerminalSubSystemHelper.getSuitableSubSystem(host); >+ if (ss != null) { >+ return ss.getConnectorService(); >+ } else { >+ return new DelegatingTerminalConnectorService(host); >+ } >+ } >+} >Index: src/org/eclipse/rse/internal/subsystems/terminals/core/DelegatingTerminalConnectorService.java >=================================================================== >RCS file: src/org/eclipse/rse/internal/subsystems/terminals/core/DelegatingTerminalConnectorService.java >diff -N src/org/eclipse/rse/internal/subsystems/terminals/core/DelegatingTerminalConnectorService.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/rse/internal/subsystems/terminals/core/DelegatingTerminalConnectorService.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,66 @@ >+/******************************************************************************** >+ * Copyright (c) 2007, 2008 IBM Corporation and others. All rights reserved. >+ * 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 >+ * available at http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Initial Contributors: >+ * The following IBM employees contributed to the Remote System Explorer >+ * component that contains this file: David McKnight. >+ * >+ * Contributors: >+ * Anna Dushistova (MontaVista) - [239159] The shell process subsystem not working without the shells subsystem present for the systemType >+ ********************************************************************************/ >+package org.eclipse.rse.internal.subsystems.terminals.core; >+ >+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.subsystems.terminals.core.ITerminalServiceSubSystem; >+ >+/** >+ * This class delegates the connector service requests for the terminal >+ * subsystem to the connector service of any subsystem that has service which can be adopted to ITerminalService. >+ */ >+public class DelegatingTerminalConnectorService extends AbstractDelegatingConnectorService >+{ >+ private IConnectorService _realService; >+ >+ /** >+ * @param host the linux host that is the target for this connector service. >+ */ >+ public DelegatingTerminalConnectorService(IHost host) >+ { >+ super(host); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.rse.core.subsystems.AbstractDelegatingConnectorService#getRealConnectorService() >+ */ >+ public IConnectorService getRealConnectorService() >+ { >+ if (_realService != null) >+ { >+ return _realService; >+ } >+ else >+ { >+ ISubSystem ss = TerminalSubSystemHelper.getSuitableSubSystem(getHost()); >+ if (ss != null) >+ { >+ _realService = ss.getConnectorService(); >+ >+ // register the process subsystem >+ ITerminalServiceSubSystem ts = TerminalSubSystemHelper.getTerminalServiceSubSystem(getHost()); >+ _realService.registerSubSystem(ts); >+ return _realService; >+ } >+ else >+ { >+ return null; >+ } >+ } >+ } >+ >+} >Index: plugin.xml >=================================================================== >RCS file: plugin.xml >diff -N plugin.xml >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ plugin.xml 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,30 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<!-- >+Copyright (c) 2008 MontaVista Software, Inc. >+All rights reserved. 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 available at >+http://www.eclipse.org/legal/epl-v10.html >+ >+Contributors: >+Yu-Fen Kuo (MontaVista)- initial API and implementation >+--> >+<?eclipse version="3.1"?> >+<plugin> >+ <extension >+ point="org.eclipse.rse.core.subsystemConfigurations"> >+ <configuration >+ category="terminals" >+ class="org.eclipse.rse.internal.subsystems.terminals.core.TerminalSubSystemConfigurationImpl" >+ description="%TerminalSubsystemDescription" >+ icon="icons/full/obj16/terminalcommands_obj.gif" >+ iconlive="icons/full/obj16/terminalcommandslive_obj.gif" >+ id="terminals" >+ name="%TerminalSubsystemName" >+ priority="300" >+ systemTypeIds="org.eclipse.rse.systemtype.linux;org.eclipse.rse.systemtype.unix;org.eclipse.rse.systemtype.aix;org.eclipse.rse.systemtype.ssh" >+ vendor="%providerName"> >+ </configuration> >+ </extension> >+ >+</plugin> >Index: src/org/eclipse/rse/internal/subsystems/terminals/core/TerminalSubSystemHelper.java >=================================================================== >RCS file: src/org/eclipse/rse/internal/subsystems/terminals/core/TerminalSubSystemHelper.java >diff -N src/org/eclipse/rse/internal/subsystems/terminals/core/TerminalSubSystemHelper.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/rse/internal/subsystems/terminals/core/TerminalSubSystemHelper.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,50 @@ >+package org.eclipse.rse.internal.subsystems.terminals.core; >+ >+import org.eclipse.rse.core.model.IHost; >+import org.eclipse.rse.core.subsystems.ISubSystem; >+import org.eclipse.rse.internal.services.terminals.ITerminalService; >+import org.eclipse.rse.services.IService; >+import org.eclipse.rse.subsystems.terminals.core.ITerminalServiceSubSystem; >+ >+public class TerminalSubSystemHelper { >+ /** >+ * Find the first ITerminalServiceSubSystem service associated with the >+ * host. >+ * >+ * @param host >+ * the connection >+ * @return shell service subsystem, or <code>null</code> if not found. >+ */ >+ public static ISubSystem getSuitableSubSystem(IHost host) { >+ if (host == null) >+ return null; >+ ISubSystem[] subSystems = host.getSubSystems(); >+ ITerminalService ssvc = null; >+ for (int i = 0; subSystems != null && i < subSystems.length; i++) { >+ IService svc = subSystems[i].getSubSystemConfiguration() >+ .getService(host); >+ if (svc != null) { >+ ssvc = (ITerminalService) svc >+ .getAdapter(ITerminalService.class); >+ if (ssvc != null) { >+ return subSystems[i]; >+ } >+ } >+ } >+ return null; >+ } >+ >+ public static ITerminalServiceSubSystem getTerminalServiceSubSystem( >+ 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 ITerminalServiceSubSystem) { >+ return (ITerminalServiceSubSystem) subSystems[i]; >+ } >+ } >+ return null; >+ } >+ >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 227569
: 113308 |
113526