diff options
author | Uwe Stieber | 2014-06-10 10:11:55 +0000 |
---|---|---|
committer | Uwe Stieber | 2014-06-10 10:13:08 +0000 |
commit | 5b833eede8cc6764cf68164c0f18d469771dbd70 (patch) | |
tree | 9e24a8869071e47285a3c8f071ae1731f065f9ff | |
parent | 358190072abe0bee7ec391fb586ecbb9cc0c384f (diff) | |
download | org.eclipse.tcf-5b833eede8cc6764cf68164c0f18d469771dbd70.tar.gz org.eclipse.tcf-5b833eede8cc6764cf68164c0f18d469771dbd70.tar.xz org.eclipse.tcf-5b833eede8cc6764cf68164c0f18d469771dbd70.zip |
Target Explorer: Remove deprecated proxy support
23 files changed, 16 insertions, 316 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml index 493d638fe..cb8fdbb82 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml @@ -48,7 +48,7 @@ class="org.eclipse.tcf.te.tcf.locator.internal.PeerModelPropertyTester" id="org.eclipse.tcf.te.tcf.locator.LocatorModelPropertyTester" namespace="org.eclipse.tcf.te.tcf.locator" - properties="name,nameRegex,osName,osNameRegex,hasLocalService,hasRemoteService,hasOfflineService,hasAttribute,isAttribute,isRedirected,isProxy,isValid,isValueAdd,isOfType,isRemotePeer" + properties="name,nameRegex,osName,osNameRegex,hasLocalService,hasRemoteService,hasOfflineService,hasAttribute,isAttribute,isProxy,isValid,isValueAdd,isOfType,isRemotePeer" type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode"> </propertyTester> @@ -56,7 +56,7 @@ class="org.eclipse.tcf.te.tcf.locator.internal.PeerModelPropertyTester" id="org.eclipse.tcf.te.tcf.locator.LocatorModelPropertyTester2" namespace="org.eclipse.tcf.te.tcf.locator" - properties="name,nameRegex,osName,osNameRegex,hasLocalService,hasRemoteService,hasOfflineService,hasAttribute,isAttribute,isRedirected,isProxy,isValueAdd,isOfType,isRemotePeer" + properties="name,nameRegex,osName,osNameRegex,hasLocalService,hasRemoteService,hasOfflineService,hasAttribute,isAttribute,isProxy,isValueAdd,isOfType,isRemotePeer" type="org.eclipse.tcf.protocol.IPeer"> </propertyTester> diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerNodeProperties.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerNodeProperties.java index 8496cb1c4..ff1484fa4 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerNodeProperties.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerNodeProperties.java @@ -39,11 +39,6 @@ public interface IPeerNodeProperties { public static final String PROP_REMOTE_SERVICES = "services.remote"; //$NON-NLS-1$ /** - * Property: The redirection proxy peer id. - */ - public static final String PROP_REDIRECT_PROXY = "redirect.proxy"; //$NON-NLS-1$ - - /** * Property: Peer ID of selected real target. */ public static final String PROP_PEER_ID = "PeerId"; //$NON-NLS-1$ diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerRedirector.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerRedirector.java deleted file mode 100644 index b32d03b02..000000000 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerRedirector.java +++ /dev/null @@ -1,25 +0,0 @@ -/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems, Inc. 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
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.tcf.locator.interfaces.nodes;
-
-import org.eclipse.tcf.protocol.IPeer;
-
-/**
- * Interface to be implemented by peer redirectors.
- */
-public interface IPeerRedirector extends IPeer {
-
- /**
- * Returns the parent peer.
- *
- * @return The parent peer.
- */
- public IPeer getParent();
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/PeerModelPropertyTester.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/PeerModelPropertyTester.java index d80615b2b..8947b8376 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/PeerModelPropertyTester.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/PeerModelPropertyTester.java @@ -22,7 +22,6 @@ import org.eclipse.tcf.protocol.IPeer; import org.eclipse.tcf.protocol.Protocol; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties; -import org.eclipse.tcf.te.tcf.locator.nodes.PeerRedirector; /** * Locator model property tester. @@ -96,13 +95,6 @@ public class PeerModelPropertyTester extends PropertyTester { } } - if ("isRedirected".equals(property)) { //$NON-NLS-1$ - boolean isRedirected = peer instanceof PeerRedirector; - if (expectedValue instanceof Boolean) { - return ((Boolean) expectedValue).booleanValue() == isRedirected; - } - } - if ("isProxy".equals(property)) { //$NON-NLS-1$ boolean isProxy = peer.getAttributes().containsKey("Proxy"); //$NON-NLS-1$ if (expectedValue instanceof Boolean) { diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/PeerRedirector.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/PeerRedirector.java deleted file mode 100644 index 66153e8c5..000000000 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/PeerRedirector.java +++ /dev/null @@ -1,79 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011, 2012 Wind River Systems, Inc. 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 - * - * Contributors: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tcf.te.tcf.locator.nodes; - -import java.util.Map; - -import org.eclipse.core.runtime.Assert; -import org.eclipse.tcf.core.TransientPeer; -import org.eclipse.tcf.protocol.IChannel; -import org.eclipse.tcf.protocol.IPeer; -import org.eclipse.tcf.protocol.Protocol; -import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerRedirector; - -/** - * Peer redirector implementation. - * <p> - * If a peer is discovery by querying the <i>remote</i> locator service of a known peer, than the - * communication with the remotely discovered peer is channeled through the proxy peer (== parent). - */ -public class PeerRedirector extends TransientPeer implements IPeerRedirector { - // Reference to the parent peer which is serving as proxy - private final IPeer parent; - - /** - * Constructor. - * - * @param parent The parent peer. Must not be <code>null</code>. - * @param attrs The peer attributes of the remote discovered peer. Must not be <code>null</code> - * . - */ - public PeerRedirector(IPeer parent, Map<String, String> attrs) { - super(attrs); - - Assert.isNotNull(parent); - this.parent = parent; - } - - /* (non-Javadoc) - * @see org.eclipse.tcf.core.TransientPeer#openChannel() - */ - @Override - public IChannel openChannel() { - Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$ - IChannel c = parent.openChannel(); - c.redirect(getAttributes()); - return c; - } - - /* (non-Javadoc) - * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerRedirector#getParent() - */ - @Override - public IPeer getParent() { - return parent; - } - - /** - * Update the peer attributes. - * - * @param attrs The new peer attributes. Must not be <code>null</code>. - */ - public void updateAttributes(Map<String, String> attrs) { - Assert.isNotNull(attrs); - - if (!attrs.equals(ro_attrs)) { - Assert.isTrue(attrs.get(ATTR_ID).equals(rw_attrs.get(ATTR_ID))); - rw_attrs.clear(); - rw_attrs.putAll(attrs); - } - } - -} diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelRefreshService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelRefreshService.java index 290d09595..4552ef31d 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelRefreshService.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelRefreshService.java @@ -40,7 +40,6 @@ import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelRefreshServi import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelUpdateService; import org.eclipse.tcf.te.tcf.locator.model.ModelLocationUtil; import org.eclipse.tcf.te.tcf.locator.nodes.PeerNode; -import org.eclipse.tcf.te.tcf.locator.nodes.PeerRedirector; /** @@ -189,8 +188,6 @@ public class PeerModelRefreshService extends AbstractPeerModelService implements if (roots.length > 0) { // The map of peers created from the static definitions Map<String, IPeer> peers = new HashMap<String, IPeer>(); - // The list of peer attributes with postponed peer instance creation - List<Map<String, String>> postponed = new ArrayList<Map<String,String>>(); // Process the root locations for (File root : roots) { // List all "*.json" and "*.peer" files within the root location @@ -243,33 +240,10 @@ public class PeerModelRefreshService extends AbstractPeerModelService implements attrs.put(IPeer.ATTR_ID, id); } - // If the redirect property is not set, create the peer right away - if (attrs.get(IPeerNodeProperties.PROP_REDIRECT_PROXY) == null) { - // Construct the peer from the attributes - IPeer peer = new Peer(attrs); - // Add the constructed peer to the peers map - peers.put(peer.getID(), peer); - } else { - // Try to get the peer proxy - String proxyId = attrs.get(IPeerNodeProperties.PROP_REDIRECT_PROXY); - IPeer proxy = peers.get(proxyId); - if (proxy == null) { - IPeerNode peerNode = model.getService(IPeerModelLookupService.class).lkupPeerModelById(proxyId); - if (peerNode != null) { - proxy = peerNode.getPeer(); - } - } - - if (proxy != null) { - // Construct the peer redirector - PeerRedirector redirector = new PeerRedirector(proxy, attrs); - // Add the redirector to the peers map - peers.put(redirector.getID(), redirector); - } else { - // Postpone peer creation - postponed.add(attrs); - } - } + // Construct the peer from the attributes + IPeer peer = new Peer(attrs); + // Add the constructed peer to the peers map + peers.put(peer.getID(), peer); } catch (IOException e) { /* ignored on purpose */ } @@ -277,34 +251,6 @@ public class PeerModelRefreshService extends AbstractPeerModelService implements } } - // Process postponed peers if there are any - if (!postponed.isEmpty()) { - for (Map<String, String> attrs : postponed) { - String proxyId = attrs.get(IPeerNodeProperties.PROP_REDIRECT_PROXY); - IPeer proxy = proxyId != null ? peers.get(proxyId) : null; - if (proxy == null) { - IPeerNode peerNode = model.getService(IPeerModelLookupService.class).lkupPeerModelById(proxyId); - if (peerNode != null) { - proxy = peerNode.getPeer(); - } - } - - if (proxy != null) { - // Construct the peer redirector - PeerRedirector redirector = new PeerRedirector(proxy, attrs); - // Add the redirector to the peers map - peers.put(redirector.getID(), redirector); - } else { - // Proxy not available -> reset redirection - attrs.remove(IPeerNodeProperties.PROP_REDIRECT_PROXY); - // Construct the peer from the attributes - IPeer peer = new Peer(attrs); - // Add the constructed peer to the peers map - peers.put(peer.getID(), peer); - } - } - } - // Process the read peers if (!oldChildren.isEmpty() || !peers.isEmpty()) { processPeers(peers, oldChildren, model); diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/META-INF/MANIFEST.MF b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/META-INF/MANIFEST.MF index 1d623a84c..b76ce87d4 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/META-INF/MANIFEST.MF +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/META-INF/MANIFEST.MF @@ -55,7 +55,6 @@ Export-Package: org.eclipse.tcf.te.tcf.ui.activator, org.eclipse.tcf.te.tcf.ui.navigator.events, org.eclipse.tcf.te.tcf.ui.navigator.filter, org.eclipse.tcf.te.tcf.ui.navigator.images, - org.eclipse.tcf.te.tcf.ui.navigator.nodes, org.eclipse.tcf.te.tcf.ui.nls, org.eclipse.tcf.te.tcf.ui.preferences, org.eclipse.tcf.te.tcf.ui.sections, diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/icons/obj16/discovery_root.gif b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/icons/obj16/discovery_root.gif Binary files differdeleted file mode 100644 index b72da8dab..000000000 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/icons/obj16/discovery_root.gif +++ /dev/null diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.xml index 44255c03c..0e8997ce1 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.xml +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.xml @@ -167,14 +167,10 @@ <instanceof value="org.eclipse.tcf.te.ui.views.interfaces.IRoot"/> <instanceof value="org.eclipse.tcf.te.ui.views.interfaces.ICategory"/> <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode"/> - <instanceof value="org.eclipse.tcf.te.tcf.ui.navigator.nodes.PeerRedirectorGroupNode"/> </or> </triggerPoints> <possibleChildren> - <or> - <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode"/> - <instanceof value="org.eclipse.tcf.te.tcf.ui.navigator.nodes.PeerRedirectorGroupNode"/> - </or> + <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode"/> </possibleChildren> <commonSorter class="org.eclipse.tcf.te.tcf.ui.navigator.ViewerSorter" @@ -235,7 +231,6 @@ <or> <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode"/> <instanceof value="org.eclipse.tcf.protocol.IPeer"/> - <instanceof value="org.eclipse.tcf.te.tcf.ui.navigator.nodes.PeerRedirectorGroupNode"/> </or> </enablement> </labelProviderDelegate> diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java index 8d24b7f0b..513803d6b 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java @@ -251,8 +251,6 @@ public class UIPlugin extends AbstractUIPlugin { registry.put(ImageConsts.PEER_NODE, ImageDescriptor.createFromURL(url)); url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_OBJ + "peer_discovered.gif"); //$NON-NLS-1$ registry.put(ImageConsts.PEER_DISCOVERED, ImageDescriptor.createFromURL(url)); - url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_OBJ + "discovery_root.gif"); //$NON-NLS-1$ - registry.put(ImageConsts.DISCOVERY_ROOT, ImageDescriptor.createFromURL(url)); url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_OBJ + "targets_view.gif"); //$NON-NLS-1$ registry.put(ImageConsts.SYSTEM_MGNT_VIEW, ImageDescriptor.createFromURL(url)); url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_OBJ + "connection.gif"); //$NON-NLS-1$ diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/AttributesSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/AttributesSection.java index 4cd6f8265..ece2c14b5 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/AttributesSection.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/AttributesSection.java @@ -29,7 +29,6 @@ import org.eclipse.tcf.te.runtime.properties.PropertiesContainer; import org.eclipse.tcf.te.tcf.core.peers.Peer; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties; -import org.eclipse.tcf.te.tcf.locator.nodes.PeerRedirector; import org.eclipse.tcf.te.tcf.ui.controls.PeerAttributesTablePart; import org.eclipse.tcf.te.tcf.ui.nls.Messages; import org.eclipse.tcf.te.ui.forms.parts.AbstractSection; @@ -327,7 +326,7 @@ public class AttributesSection extends AbstractSection { } // Create the new peer - IPeer newPeer = oldPeer instanceof PeerRedirector ? new PeerRedirector(((PeerRedirector)oldPeer).getParent(), attributes) : new Peer(attributes); + IPeer newPeer = new Peer(attributes); // Update the peer node instance (silently) boolean changed = node.setChangeEventsEnabled(false); node.setProperty(IPeerNodeProperties.PROP_INSTANCE, newPeer); diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/GeneralInformationSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/GeneralInformationSection.java index 0b024ca87..82f91c7bf 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/GeneralInformationSection.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/GeneralInformationSection.java @@ -38,7 +38,6 @@ import org.eclipse.tcf.te.tcf.core.peers.Peer; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties; import org.eclipse.tcf.te.tcf.locator.model.ModelManager; -import org.eclipse.tcf.te.tcf.locator.nodes.PeerRedirector; import org.eclipse.tcf.te.tcf.ui.activator.UIPlugin; import org.eclipse.tcf.te.tcf.ui.editor.controls.InfoSectionPeerNameControl; import org.eclipse.tcf.te.tcf.ui.help.IContextHelpIds; @@ -303,7 +302,7 @@ public class GeneralInformationSection extends AbstractSection { // Remove the persistence storage URI (if set) attributes.remove(IPersistableNodeProperties.PROPERTY_URI); // Create the new peer - IPeer newPeer = oldPeer instanceof PeerRedirector ? new PeerRedirector(((PeerRedirector)oldPeer).getParent(), attributes) : new Peer(attributes); + IPeer newPeer = new Peer(attributes); // Update the peer node instance (silently) boolean changed = node.setChangeEventsEnabled(false); node.setProperty(IPeerNodeProperties.PROP_INSTANCE, newPeer); diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/TcpTransportSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/TcpTransportSection.java index 15a5c56d9..944285fb0 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/TcpTransportSection.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/TcpTransportSection.java @@ -35,7 +35,6 @@ import org.eclipse.tcf.te.tcf.core.interfaces.ITransportTypes; import org.eclipse.tcf.te.tcf.core.peers.Peer; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties; -import org.eclipse.tcf.te.tcf.locator.nodes.PeerRedirector; import org.eclipse.tcf.te.tcf.ui.nls.Messages; import org.eclipse.tcf.te.ui.controls.net.RemoteHostAddressControl; import org.eclipse.tcf.te.ui.controls.net.RemoteHostPortControl; @@ -518,7 +517,7 @@ public class TcpTransportSection extends AbstractSection implements IDataExchang } // Create the new peer - IPeer newPeer = oldPeer instanceof PeerRedirector ? new PeerRedirector(((PeerRedirector) oldPeer).getParent(), attributes) : new Peer(attributes); + IPeer newPeer = new Peer(attributes); // Update the peer node instance (silently) boolean changed = node.setChangeEventsEnabled(false); node.setProperty(IPeerNodeProperties.PROP_INSTANCE, newPeer); diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/TransportSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/TransportSection.java index 97d2ef1ff..cc44714ee 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/TransportSection.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/TransportSection.java @@ -34,7 +34,6 @@ import org.eclipse.tcf.te.tcf.core.interfaces.ITransportTypes; import org.eclipse.tcf.te.tcf.core.peers.Peer; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties; -import org.eclipse.tcf.te.tcf.locator.nodes.PeerRedirector; import org.eclipse.tcf.te.tcf.ui.controls.CustomTransportPanel; import org.eclipse.tcf.te.tcf.ui.controls.PipeTransportPanel; import org.eclipse.tcf.te.tcf.ui.controls.TcpTransportPanel; @@ -464,8 +463,7 @@ public class TransportSection extends AbstractSection implements IDataExchangeNo } // Create the new peer - IPeer newPeer = oldPeer instanceof PeerRedirector ? new PeerRedirector(((PeerRedirector) oldPeer) - .getParent(), attributes) : new Peer(attributes); + IPeer newPeer = new Peer(attributes); // Update the peer node instance (silently) boolean changed = node.setChangeEventsEnabled(false); node.setProperty(IPeerNodeProperties.PROP_INSTANCE, newPeer); diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RenameHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RenameHandler.java index cefe74fd5..1908e8137 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RenameHandler.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RenameHandler.java @@ -43,7 +43,6 @@ import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties; import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelRefreshService; import org.eclipse.tcf.te.tcf.locator.model.ModelManager; -import org.eclipse.tcf.te.tcf.locator.nodes.PeerRedirector; import org.eclipse.tcf.te.tcf.ui.help.IContextHelpIds; import org.eclipse.tcf.te.tcf.ui.nls.Messages; import org.eclipse.tcf.te.ui.dialogs.RenameDialog; @@ -132,7 +131,7 @@ public class RenameHandler extends AbstractHandler { // Remove the persistence storage URI (if set) attributes.remove(IPersistableNodeProperties.PROPERTY_URI); // Create the new peer - IPeer newPeer = oldPeer instanceof PeerRedirector ? new PeerRedirector(((PeerRedirector)oldPeer).getParent(), attributes) : new Peer(attributes); + IPeer newPeer = new Peer(attributes); // Update the peer node instance (silently) boolean changed = node.setChangeEventsEnabled(false); node.setProperty(IPeerNodeProperties.PROP_INSTANCE, newPeer); diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/ImageConsts.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/ImageConsts.java index b553c5ce3..afb481981 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/ImageConsts.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/ImageConsts.java @@ -71,11 +71,6 @@ public interface ImageConsts { public static final String PEER_DISCOVERED = "PeerObjectDiscovered"; //$NON-NLS-1$ /** - * The key to access the base remote peer discover root node object image. - */ - public static final String DISCOVERY_ROOT = "RemotePeerDiscoverRootNodeObject"; //$NON-NLS-1$ - - /** * The key to access the new peer wizard image. */ public static final String NEW_PEER_NODE = "NewPeerObject"; //$NON-NLS-1$ diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ContentProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ContentProvider.java index d19cc8193..626201369 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ContentProvider.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ContentProvider.java @@ -10,10 +10,7 @@ package org.eclipse.tcf.te.tcf.ui.navigator; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; -import java.util.concurrent.atomic.AtomicReference; import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.Platform; @@ -24,18 +21,14 @@ import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerFilter; import org.eclipse.tcf.protocol.IPeer; import org.eclipse.tcf.protocol.Protocol; -import org.eclipse.tcf.te.runtime.concurrent.util.ExecutorsUtil; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode; -import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerRedirector; -import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelLookupService; import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelRefreshService; import org.eclipse.tcf.te.tcf.locator.model.ModelManager; import org.eclipse.tcf.te.tcf.ui.activator.UIPlugin; import org.eclipse.tcf.te.tcf.ui.internal.ImageConsts; import org.eclipse.tcf.te.tcf.ui.internal.preferences.IPreferenceKeys; -import org.eclipse.tcf.te.tcf.ui.navigator.nodes.PeerRedirectorGroupNode; import org.eclipse.tcf.te.tcf.ui.nls.Messages; import org.eclipse.tcf.te.ui.swt.DisplayUtil; import org.eclipse.tcf.te.ui.views.Managers; @@ -78,9 +71,6 @@ public class ContentProvider implements ICommonContentProvider, ITreePathContent // The locator model listener instance /* default */ LocatorModelListener locatorModelListener = null; - // Internal map of PeerRedirectorGroupNodes per peer id - private final Map<String, PeerRedirectorGroupNode> roots = new HashMap<String, PeerRedirectorGroupNode>(); - // Flag to remember if invisible nodes are to be included in the list of // returned children. private final boolean showInvisible; @@ -299,16 +289,6 @@ public class ContentProvider implements ICommonContentProvider, ITreePathContent public Object getParent(final Object element) { // If it is a peer model node, return the parent locator model if (element instanceof IPeerNode) { - // If it is a peer redirector, return the parent remote peer discover root node - if (((IPeerNode)element).getPeer() instanceof IPeerRedirector) { - IPeer parentPeer = ((IPeerRedirector)((IPeerNode)element).getPeer()).getParent(); - String parentPeerId = parentPeer.getID(); - if (!roots.containsKey(parentPeerId)) { - roots.put(parentPeer.getID(), new PeerRedirectorGroupNode(parentPeerId)); - } - return roots.get(parentPeerId); - } - // Determine the parent category node ICategory category = null; String[] categoryIds = Managers.getCategoryManager().getCategoryIds(((IPeerNode)element).getPeerId()); @@ -319,30 +299,6 @@ public class ContentProvider implements ICommonContentProvider, ITreePathContent } return category != null ? category : ((IPeerNode)element).getModel(); - } else if (element instanceof PeerRedirectorGroupNode) { - // Return the parent peer model node - final AtomicReference<IPeerNode> parent = new AtomicReference<IPeerNode>(); - final Runnable runnable = new Runnable() { - @Override - public void run() { - parent.set(ModelManager.getPeerModel().getService(IPeerModelLookupService.class).lkupPeerModelById(((PeerRedirectorGroupNode)element).peerId)); - } - }; - - Assert.isTrue(!Protocol.isDispatchThread()); - - // The caller thread is very likely the display thread. We have to us a little - // trick here to avoid blocking the display thread via a wait on a monitor as - // this can (and has) lead to dead-locks with the TCF event dispatch thread if - // something fatal (OutOfMemoryError in example) happens in-between. - ExecutorsUtil.executeWait(new Runnable() { - @Override - public void run() { - Protocol.invokeAndWait(runnable); - } - }); - - return parent.get(); } return null; } @@ -440,8 +396,6 @@ public class ContentProvider implements ICommonContentProvider, ITreePathContent else Protocol.invokeAndWait(runnable); locatorModelListener = null; } - - roots.clear(); } /* (non-Javadoc) diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/PeerLabelProviderDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/PeerLabelProviderDelegate.java index ae010e6f9..9bb4bc326 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/PeerLabelProviderDelegate.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/PeerLabelProviderDelegate.java @@ -27,8 +27,6 @@ import org.eclipse.tcf.te.tcf.locator.model.ModelManager; import org.eclipse.tcf.te.tcf.ui.activator.UIPlugin; import org.eclipse.tcf.te.tcf.ui.internal.ImageConsts; import org.eclipse.tcf.te.tcf.ui.navigator.images.PeerNodeImageDescriptor; -import org.eclipse.tcf.te.tcf.ui.navigator.nodes.PeerRedirectorGroupNode; -import org.eclipse.tcf.te.tcf.ui.nls.Messages; import org.eclipse.tcf.te.ui.jface.images.AbstractImageDescriptor; /** @@ -94,8 +92,6 @@ public class PeerLabelProviderDelegate extends LabelProvider implements ILabelDe if (!"".equals(label.trim())) { //$NON-NLS-1$ return label; } - } else if (element instanceof PeerRedirectorGroupNode) { - return Messages.RemotePeerDiscoveryRootNode_label; } return null; @@ -146,9 +142,6 @@ public class PeerLabelProviderDelegate extends LabelProvider implements ILabelDe if (element instanceof IPeer) { return UIPlugin.getImage(ImageConsts.PEER_DISCOVERED); } - if (element instanceof PeerRedirectorGroupNode) { - return UIPlugin.getImage(ImageConsts.DISCOVERY_ROOT); - } return super.getImage(element); } diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/filter/GenericFilter.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/filter/GenericFilter.java index 3ee088e2f..f3adb75a2 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/filter/GenericFilter.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/filter/GenericFilter.java @@ -18,7 +18,6 @@ import org.eclipse.tcf.protocol.Protocol; import org.eclipse.tcf.te.tcf.core.interfaces.IPeerType; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties; -import org.eclipse.tcf.te.tcf.ui.navigator.nodes.PeerRedirectorGroupNode; import org.eclipse.tcf.te.ui.views.interfaces.ICategory; import org.eclipse.tcf.te.ui.views.interfaces.IUIConstants; @@ -50,11 +49,8 @@ public class GenericFilter extends ViewerFilter { boolean belongsTo = type.get() == null || IPeerType.TYPE_GENERIC.equals(type.get()); if (parentElement instanceof TreePath) { - // If the direct parent is not a PeerRedirectorGroupNode, look at the very first - // element in the tree path as parent, which is likely the category. - Object candidate = ((TreePath)parentElement).getSegment(((TreePath)parentElement).getSegmentCount() - 1); - if (candidate instanceof PeerRedirectorGroupNode) parentElement = candidate; - else parentElement = ((TreePath)parentElement).getFirstSegment(); + // Look at the very first element in the tree path as parent, which is likely the category. + parentElement = ((TreePath)parentElement).getFirstSegment(); } if (parentElement instanceof ICategory) { if (IUIConstants.ID_CAT_MY_TARGETS.equals(((ICategory)parentElement).getId()) || IUIConstants.ID_CAT_NEIGHBORHOOD.equals(((ICategory)parentElement).getId())) { @@ -64,7 +60,7 @@ public class GenericFilter extends ViewerFilter { visible = !belongsTo; } } - else if (!(parentElement instanceof PeerRedirectorGroupNode)) { + else { visible = belongsTo; } } diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/nodes/PeerRedirectorGroupNode.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/nodes/PeerRedirectorGroupNode.java deleted file mode 100644 index b096f9dbb..000000000 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/nodes/PeerRedirectorGroupNode.java +++ /dev/null @@ -1,48 +0,0 @@ -/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems, Inc. 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
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.tcf.ui.navigator.nodes;
-
-import org.eclipse.core.runtime.Assert;
-
-/**
- * A node grouping discovered child peers of a proxy peer.
- * <p>
- * Instances of this class are immutable.
- */
-public class PeerRedirectorGroupNode {
- public final String peerId;
-
- /**
- * Constructor.
- */
- public PeerRedirectorGroupNode(String peerId) {
- Assert.isNotNull(peerId);
- this.peerId = peerId;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj) {
- if (obj instanceof PeerRedirectorGroupNode) {
- return peerId.equals(((PeerRedirectorGroupNode)obj).peerId);
- }
- return super.equals(obj);
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- return peerId.hashCode();
- }
-}
\ No newline at end of file diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.java index b73e5ede9..273ec1ab2 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.java @@ -93,8 +93,6 @@ public class Messages extends NLS { public static String NewTargetWizardPage_PeerSelectionDialog_title; public static String NewTargetWizardPage_PeerSelectionDialog_message; - public static String RemotePeerDiscoveryRootNode_label; - public static String PeerIdControl_label; public static String PeerNameControl_label; diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.properties index 313fb6e2f..ded8e3344 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.properties +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.properties @@ -52,8 +52,6 @@ NewTargetWizardPage_PeerSelectionDialog_dialogTitle=Browse NewTargetWizardPage_PeerSelectionDialog_title=Select Target NewTargetWizardPage_PeerSelectionDialog_message=Select the discovered target to create a connection for. -RemotePeerDiscoveryRootNode_label=Neighborhood - PeerIdControl_label=Target ID: PeerNameControl_label=Connection Name: diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/SimulatorTypeSelectionSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/SimulatorTypeSelectionSection.java index 02c9721d7..0ebd0a624 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/SimulatorTypeSelectionSection.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/SimulatorTypeSelectionSection.java @@ -35,7 +35,6 @@ import org.eclipse.tcf.te.runtime.properties.PropertiesContainer; import org.eclipse.tcf.te.tcf.core.peers.Peer; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties; -import org.eclipse.tcf.te.tcf.locator.nodes.PeerRedirector; import org.eclipse.tcf.te.tcf.ui.controls.SimulatorTypeSelectionControl; import org.eclipse.tcf.te.tcf.ui.dialogs.PeerSelectionDialog; import org.eclipse.tcf.te.tcf.ui.nls.Messages; @@ -479,7 +478,7 @@ public class SimulatorTypeSelectionSection extends AbstractSection implements ID } // Create the new peer - IPeer newPeer = oldPeer instanceof PeerRedirector ? new PeerRedirector(((PeerRedirector) oldPeer).getParent(), attributes) : new Peer(attributes); + IPeer newPeer = new Peer(attributes); // Update the peer node instance (silently) boolean changed = node.setChangeEventsEnabled(false); node.setProperty(IPeerNodeProperties.PROP_INSTANCE, newPeer); |