diff options
author | Uwe Stieber | 2012-06-05 10:37:01 +0000 |
---|---|---|
committer | Uwe Stieber | 2012-06-05 10:37:01 +0000 |
commit | dcce5ef42d262ef9e7baabe2a3441ed31b968517 (patch) | |
tree | ba932f22e290d34b1a211c4821b963490b52c85e /target_explorer | |
parent | 35385c93c7aaf198b618818bf3ce349302263805 (diff) | |
download | org.eclipse.tcf-dcce5ef42d262ef9e7baabe2a3441ed31b968517.tar.gz org.eclipse.tcf-dcce5ef42d262ef9e7baabe2a3441ed31b968517.tar.xz org.eclipse.tcf-dcce5ef42d262ef9e7baabe2a3441ed31b968517.zip |
Target Explorer: Peer node scanner is skipping proxies and value-add's
Diffstat (limited to 'target_explorer')
-rw-r--r-- | target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/ScannerRunnable.java | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/ScannerRunnable.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/ScannerRunnable.java index f3f1337a6..af1e0198c 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/ScannerRunnable.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/ScannerRunnable.java @@ -83,16 +83,30 @@ public class ScannerRunnable implements Runnable, IChannel.IChannelListener { */ @Override public void run() { + Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$ + + // Determine the peer + IPeer peer = peerNode.getPeer(); + if (peer == null) return; + + // Don't scan proxies or value-add's + boolean isProxy = peer.getAttributes().containsKey("Proxy"); //$NON-NLS-1$ + + String value = peer.getAttributes().get("ValueAdd"); //$NON-NLS-1$ + boolean isValueAdd = value != null && ("1".equals(value.trim()) || Boolean.parseBoolean(value.trim())); //$NON-NLS-1$ + + if (isProxy || isValueAdd) return; + // Remember the peer node state oldState = peerNode.getIntProperty(IPeerModelProperties.PROP_STATE); // Do not open a channel to incomplete peer nodes - if (peerNode.isComplete() && peerNode.getPeer() != null) { + if (peerNode.isComplete()) { // Check if there is a shared channel available which is still in open state - channel = Tcf.getChannelManager().getChannel(peerNode.getPeer()); + channel = Tcf.getChannelManager().getChannel(peer); if (channel == null || channel.getState() != IChannel.STATE_OPEN) { sharedChannel = false; // Open the channel - channel = peerNode.getPeer().openChannel(); + channel = peer.openChannel(); // Add ourself as channel listener channel.addChannelListener(this); } else { |