Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2013-12-17 08:33:03 -0500
committerTobias Schwarz2013-12-17 08:33:03 -0500
commit8384bf58f9acf5778d1f88ffee9764f7c3622ad1 (patch)
treeb21cdd8028e1631289cd4b91825df0b67cd9412f
parent9c70311b440b7192b6af02fd9dd5fc806492b66a (diff)
downloadorg.eclipse.tcf-8384bf58f9acf5778d1f88ffee9764f7c3622ad1.tar.gz
org.eclipse.tcf-8384bf58f9acf5778d1f88ffee9764f7c3622ad1.tar.xz
org.eclipse.tcf-8384bf58f9acf5778d1f88ffee9764f7c3622ad1.zip
Target Explorer: split peer and ocator model
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpParsePath.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/url/TcfURLConnection.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/adapters/FSTreeNodeFactory.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/TargetSelectionPage.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/adapters/AdapterFactory.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/META-INF/MANIFEST.MF3
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.properties1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml22
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/Scanner.java260
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/ScannerRunnable.java539
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/activator/CoreBundleActivator.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/ITracing.java17
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/ILocatorModel.java79
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerModel.java62
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/ILocatorModelLookupService.java42
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/ILocatorModelRefreshService.java26
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/ILocatorModelService.java26
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/ILocatorModelUpdateService.java39
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IPeerModelLookupService.java52
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IPeerModelQueryService.java12
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IPeerModelRefreshService.java20
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IPeerModelUpdateService.java48
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/PeerModelPropertyTester.java94
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/adapters/AdapterFactory.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/ChannelStateChangeListener.java86
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/LocatorListener.java240
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/ProtocolStateChangeListener.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/model/Model.java117
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/LocatorModel.java241
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/PeerModel.java556
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/persistence/GsonPeerPersistenceDelegate.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/AbstractLocatorModelService.java42
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/LocatorModelLookupService.java90
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/LocatorModelRefreshService.java126
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/LocatorModelUpdateService.java75
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelLookupService.java98
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelQueryService.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelRefreshService.java280
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelUpdateService.java192
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/SignalPeerDisconnectedStep.java64
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/WaitForReadyStep.java22
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/activator/CoreBundleActivator.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.services.contexts/src/org/eclipse/tcf/te/tcf/services/contexts/internal/AdapterFactory.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui/src/org/eclipse/tcf/te/tcf/terminals/ui/launcher/TerminalsMementoHandler.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeersSubMenuAction.java12
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/.classpath14
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/.project78
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/.settings/org.eclipse.jdt.core.prefs724
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.xml10
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/actions/AbstractPeerTypeToolbarAction.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java13
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/ContextSelectorSectionControl.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/dialogs/PeerSelectionDialog.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/AbstractConfigurationEditorPage.java13
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/OverviewEditorPage.java36
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/GeneralInformationSection.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/ServicesSection.java96
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/DeleteHandler.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RedirectHandler.java178
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RefreshHandler.java15
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RenameHandler.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/ResetRedirectHandler.java119
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/adapters/EditorSaveAsAdapter.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/adapters/PeerNodeFactory.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/services/DefaultContextService.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ContentProvider.java99
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/PeerLabelProviderDelegate.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/TreeViewerListener.java96
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/dnd/CommonDnD.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/AbstractContextSelectorSection.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/NewTargetWizard.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/AbstractConfigWizardPage.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/NewTargetWizardPage.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerExportWizardPage.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerImportWizardPage.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/TcfTestCase.java2
76 files changed, 1505 insertions, 3657 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpParsePath.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpParsePath.java
index 27b79ea54..441a50824 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpParsePath.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpParsePath.java
@@ -73,7 +73,7 @@ public class OpParsePath extends Operation {
@Override
public void run() {
- peerNode.set(Model.getModel().getService(IPeerModelLookupService.class).lkupPeerModelById(finPeerId));
+ peerNode.set(Model.getPeerModel().getService(IPeerModelLookupService.class).lkupPeerModelById(finPeerId));
}
};
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/url/TcfURLConnection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/url/TcfURLConnection.java
index fe60d29ad..0696cb1e2 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/url/TcfURLConnection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/url/TcfURLConnection.java
@@ -117,7 +117,7 @@ public class TcfURLConnection extends URLConnection {
public void run() {
IPeer p = Protocol.getLocator().getPeers().get(peerId);
if (p == null) {
- IPeerNode peerNode = Model.getModel().getService(IPeerModelLookupService.class).lkupPeerModelById(peerId);
+ IPeerNode peerNode = Model.getPeerModel().getService(IPeerModelLookupService.class).lkupPeerModelById(peerId);
if (peerNode != null) p = peerNode.getPeer();
}
peer.set(p);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/adapters/FSTreeNodeFactory.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/adapters/FSTreeNodeFactory.java
index 28d3a43cd..f69de1316 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/adapters/FSTreeNodeFactory.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/adapters/FSTreeNodeFactory.java
@@ -33,7 +33,7 @@ public class FSTreeNodeFactory implements IElementFactory {
@Override
public IAdaptable createElement(IMemento memento) {
String peerId = memento.getString("peerId"); //$NON-NLS-1$
- IPeerNode peerNode = Model.getModel().getService(IPeerModelLookupService.class).lkupPeerModelById(peerId);
+ IPeerNode peerNode = Model.getPeerModel().getService(IPeerModelLookupService.class).lkupPeerModelById(peerId);
if(peerNode != null) {
String path = memento.getString("path"); //$NON-NLS-1$
if(path == null) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/TargetSelectionPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/TargetSelectionPage.java
index 29ed9062b..2862f438e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/TargetSelectionPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/TargetSelectionPage.java
@@ -99,7 +99,7 @@ public class TargetSelectionPage extends AbstractValidatingWizardPage {
*/
private void initialize() {
// Refresh the information of remote services.
- IPeerModel model = Model.getModel();
+ IPeerModel model = Model.getPeerModel();
Assert.isNotNull(model);
IPeerNode[] peers = model.getPeerNodes();
if (peers != null) {
@@ -218,7 +218,7 @@ public class TargetSelectionPage extends AbstractValidatingWizardPage {
}
});
- treeViewer.setInput(Model.getModel());
+ treeViewer.setInput(Model.getPeerModel());
NewNodeWizard wizard = getWizard();
IPeerNode peer = wizard.getPeer();
if (wizard.getPeer() != null) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/adapters/AdapterFactory.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/adapters/AdapterFactory.java
index 3db3549ff..eec66c889 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/adapters/AdapterFactory.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/adapters/AdapterFactory.java
@@ -112,7 +112,7 @@ public class AdapterFactory implements IAdapterFactory {
}
}
else if (adaptableObject instanceof IPeer) {
- final IPeerModelLookupService service = Model.getModel().getService(IPeerModelLookupService.class);
+ final IPeerModelLookupService service = Model.getPeerModel().getService(IPeerModelLookupService.class);
final AtomicReference<IPeerNode> peerNode = new AtomicReference<IPeerNode>();
if (service != null) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/META-INF/MANIFEST.MF b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/META-INF/MANIFEST.MF
index deffea96f..c10b704bc 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/META-INF/MANIFEST.MF
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/META-INF/MANIFEST.MF
@@ -20,8 +20,7 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.8.0",
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
-Export-Package: org.eclipse.tcf.te.tcf.locator,
- org.eclipse.tcf.te.tcf.locator.activator;x-internal:=true,
+Export-Package: org.eclipse.tcf.te.tcf.locator.activator;x-internal:=true,
org.eclipse.tcf.te.tcf.locator.help,
org.eclipse.tcf.te.tcf.locator.interfaces,
org.eclipse.tcf.te.tcf.locator.interfaces.nodes,
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.properties
index ae021d7b4..e7704f9b2 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.properties
@@ -19,5 +19,4 @@ StopSimulatorStep.name=Stop Simulator
StartDebuggerStep.name=Start Debugger
StopDebuggerStep.name=Stop Debugger
WaitForReadyStep.name=Wait until peer becomes ready
-SignalPeerDisconnectedStep.name=Signal peer disconnected state
SetAsDefaultContextStep.name=Set peer as default context
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 dc7703c96..2dc9a96fa 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
@@ -53,7 +53,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,isStaticPeer,isRedirected,isProxy,isValueAdd,isOfType"
+ properties="name,nameRegex,osName,osNameRegex,hasLocalService,hasRemoteService,hasOfflineService,hasAttribute,isAttribute,isRedirected,isProxy,isValueAdd,isOfType"
type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode">
</propertyTester>
@@ -61,7 +61,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,isStaticPeer,isRedirected,isProxy,isValueAdd,isOfType"
+ properties="name,nameRegex,osName,osNameRegex,hasLocalService,hasRemoteService,hasOfflineService,hasAttribute,isAttribute,sRedirected,isProxy,isValueAdd,isOfType"
type="org.eclipse.tcf.protocol.IPeer">
</propertyTester>
@@ -142,7 +142,6 @@
</serviceType>
<enablement>
<instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode"/>
- <test forcePluginActivation="true" property="org.eclipse.tcf.te.tcf.locator.isStaticPeer" value="true"/>
<test forcePluginActivation="true" property="org.eclipse.tcf.te.tcf.locator.isOfType" value="null"/>
</enablement>
</service>
@@ -178,10 +177,6 @@
class="org.eclipse.tcf.te.tcf.locator.steps.WaitForReadyStep"
label="%WaitForReadyStep.name"/>
<step
- id="org.eclipse.tcf.te.tcf.locator.signalPeerDisconnectedStep"
- class="org.eclipse.tcf.te.tcf.locator.steps.SignalPeerDisconnectedStep"
- label="%SignalPeerDisconnectedStep.name"/>
- <step
id="org.eclipse.tcf.te.tcf.locator.setAsDefaultContextStep"
class="org.eclipse.tcf.te.tcf.locator.steps.SetAsDefaultContextStep"
label="%SetAsDefaultContextStep.name"/>
@@ -225,7 +220,6 @@
<reference id="org.eclipse.tcf.te.tcf.locator.stopDebuggerStep"/>
<reference id="org.eclipse.tcf.te.tcf.core.shutDownStep"/>
<reference id="org.eclipse.tcf.te.tcf.locator.stopSimulatorStep"/>
- <reference id="org.eclipse.tcf.te.tcf.locator.signalPeerDisconnectedStep"/>
<reference id="org.eclipse.tcf.te.core.setConnectStateStep">
<parameter name="state" value="disconnected" />
</reference>
@@ -262,7 +256,7 @@
<extension point="org.eclipse.core.expressions.definitions">
<!-- Expression to test if current variable
- is adaptable to IPeerModel and has a simulator service
+ is adaptable to IPeerNode and has a simulator service
-->
<definition id="te.expressions.peerModel.hasSimulatorService">
<adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode">
@@ -274,7 +268,7 @@
</definition>
<!-- Expression to test if the active editor input
- is adaptable to IPeerModel and has a simulator service
+ is adaptable to IPeerNode and has a simulator service
-->
<definition id="te.expressions.editor.hasSimulatorService">
<with variable="activeEditorInput">
@@ -283,7 +277,7 @@
</definition>
<!-- Expression to test if the selection
- is adaptable to IPeerModel and has a simulator service
+ is adaptable to IPeerNode and has a simulator service
-->
<definition id="te.expressions.selection.hasSimulatorService">
<with variable="selection">
@@ -295,7 +289,7 @@
</definition>
<!-- Expression to test if current variable
- is adaptable to IPeerModel and has remote or offline run control
+ is adaptable to IPeerNode and has remote or offline run control
-->
<definition id="te.expressions.peerModel.hasRunControl">
<adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode">
@@ -307,7 +301,7 @@
</definition>
<!-- Expression to test if the active editor input
- is adaptable to IPeerModel and has remote or offline run control
+ is adaptable to IPeerNode and has remote or offline run control
-->
<definition id="te.expressions.editor.hasRunControl">
<with variable="activeEditorInput">
@@ -316,7 +310,7 @@
</definition>
<!-- Expression to test if the selection
- is adaptable to IPeerModel and has remote or offline run control
+ is adaptable to IPeerNode and has remote or offline run control
-->
<definition id="te.expressions.selection.hasRunControl">
<with variable="selection">
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/Scanner.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/Scanner.java
deleted file mode 100644
index a1ca4425b..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/Scanner.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2013 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;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.runtime.callback.AsyncCallbackCollector;
-import org.eclipse.tcf.te.runtime.callback.Callback;
-import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
-import org.eclipse.tcf.te.tcf.core.async.CallbackInvocationDelegate;
-import org.eclipse.tcf.te.tcf.locator.activator.CoreBundleActivator;
-import org.eclipse.tcf.te.tcf.locator.interfaces.IScanner;
-import org.eclipse.tcf.te.tcf.locator.interfaces.ITracing;
-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.IPeerNodeProperties;
-import org.eclipse.tcf.te.tcf.locator.model.Model;
-
-
-/**
- * Locator model scanner implementation.
- */
-public class Scanner extends Job implements IScanner {
- // Reference to the parent model instance.
- private final IPeerModel parentModel;
-
- // Reference to the scanner configuration
- private final Map<String, Object> configuration = new HashMap<String, Object>();
-
- // Flag to mark if the scanner is terminated
- private AtomicBoolean terminated = new AtomicBoolean(false);
-
- /**
- * Constructor.
- *
- * @param parentModel The parent model instance. Must not be <code>null</code>.
- */
- public Scanner(IPeerModel parentModel) {
- super(Scanner.class.getName());
- Assert.isNotNull(parentModel);
- this.parentModel = parentModel;
-
- if (CoreBundleActivator.getTraceHandler().isSlotEnabled(ITracing.ID_TRACE_SCANNER)) {
- CoreBundleActivator.getTraceHandler().trace("Scanner created.", ITracing.ID_TRACE_SCANNER, Scanner.this); //$NON-NLS-1$
- }
- }
-
- /**
- * Returns the parent model instance.
- *
- * @return The parent model instance.
- */
- protected IPeerModel getParentModel() {
- return parentModel;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.core.interfaces.IScanner#setConfiguration(java.util.Map)
- */
- @Override
- public void setConfiguration(Map<String, Object> configuration) {
- Assert.isNotNull(configuration);
- this.configuration.clear();
- this.configuration.putAll(configuration);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.core.interfaces.IScanner#getConfiguration()
- */
- @Override
- public Map<String, Object> getConfiguration() {
- return configuration;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- if (monitor == null) monitor = new NullProgressMonitor();
-
- // Get the current list of peers known to the parent model
- IPeerNode[] peers = getParentModel().getPeerNodes();
- // Do we have something to scan at all
- if (peers.length > 0) {
- try {
- // The first runnable is setting the thread which will finish
- // the job at the end
- Protocol.invokeLater(new Runnable() {
- @Override
- public void run() {
- Scanner.this.setThread(Thread.currentThread());
- }
- });
-
- // Create the callback collector keeping track of all scan processes
- final IProgressMonitor finMonitor = monitor;
- final AsyncCallbackCollector collector = new AsyncCallbackCollector(new Callback() {
- @Override
- protected void internalDone(Object caller, IStatus status) {
- // Terminate the job as soon all scanner runnable's are process
- // and reschedule the job (if not terminated)
- final IStatus result = finMonitor.isCanceled() ? Status.CANCEL_STATUS : Status.OK_STATUS;
- if (getState() != Job.NONE) Scanner.this.done(result);
-
- if (!isTerminated()) {
- Long delay = (Long)getConfiguration().get(IScanner.PROP_SCHEDULE);
- if (delay != null) {
- Scanner.this.schedule(delay.longValue());
- }
- }
- }
- }, new CallbackInvocationDelegate());
-
- // Loop the nodes and try to get an channel
- for (IPeerNode peer : peers) {
- // Check for the progress monitor getting canceled
- if (monitor.isCanceled() || isTerminated()) break;
- // Scan the peer
- doScan(peer, collector, monitor);
- }
-
- // Mark the collector initialization done
- collector.initDone();
- } catch (IllegalStateException e) {
- /* ignored on purpose */
- }
- }
-
- return peers.length > 0 ? ASYNC_FINISH : Status.OK_STATUS;
- }
-
- /**
- * Scan the given peer model node and possible child nodes.
- *
- * @param peer The peer model node. Must not be <code>null</code>.
- * @param collector The callback collector. Must not be <code>null</code>.
- * @param monitor The progress monitor. Must not be <code>null</code>.
- */
- /* default */ void doScan(final IPeerNode peer, final AsyncCallbackCollector collector, final IProgressMonitor monitor) {
- Assert.isNotNull(peer);
- Assert.isNotNull(collector);
- Assert.isNotNull(monitor);
-
- // Check for the progress monitor getting canceled
- if (monitor.isCanceled() || isTerminated()) return;
-
- if (CoreBundleActivator.getTraceHandler().isSlotEnabled(ITracing.ID_TRACE_SCANNER)) {
- CoreBundleActivator.getTraceHandler().trace("Schedule scanner runnable for peer '" + peer.getName() + "' (" + peer.getPeerId() + ")", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- ITracing.ID_TRACE_SCANNER, Scanner.this);
- }
-
- final AtomicBoolean isExcluded = new AtomicBoolean(false);
-
- Runnable runnable = new Runnable() {
-
- @Override
- public void run() {
- isExcluded.set(peer.getBooleanProperty(IPeerNodeProperties.PROP_SCANNER_EXCLUDE));
- }
- };
-
- if (Protocol.isDispatchThread()) runnable.run();
- else Protocol.invokeAndWait(runnable);
-
- // If the PROP_SCANNER_EXCLUDE is not set, scan this node
- if (!isExcluded.get()) {
- // Create the callback
- ICallback callback = new Callback() {
- @Override
- protected void internalDone(Object caller, IStatus status) {
- // Check for the progress monitor getting canceled
- if (!monitor.isCanceled() && !isTerminated()) {
- // Get the children of the scanned peer model and make sure
- // they are scanned too if not excluded
- List<IPeerNode> candidates = Model.getModel().getChildren(peer.getPeerId());
- if (candidates != null && candidates.size() > 0) {
- for (IPeerNode candidate : candidates) {
- doScan(candidate, collector, monitor);
- }
- }
- }
-
- // Remove the callback from the collector
- collector.removeCallback(this);
- }
- };
- // Add the callback to the collector
- collector.addCallback(callback);
- // Create the scanner runnable
- Runnable scannerRunnable = new ScannerRunnable(this, peer, callback);
- // Submit for execution
- Protocol.invokeLater(scannerRunnable);
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.core.interfaces.IScanner#terminate()
- */
- @Override
- public void terminate() {
- Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
-
- // Return immediately if the scanner has been terminated already
- if (terminated.get()) return;
-
- // Mark the scanner job as terminated. This flag is checked by
- // the asynchronous callbacks and will stop the processing
- terminated.set(true);
- // Mark the job done from the job manager POV
- if (getState() != Job.NONE) done(Status.CANCEL_STATUS);
-
- if (CoreBundleActivator.getTraceHandler().isSlotEnabled(ITracing.ID_TRACE_SCANNER)) {
- CoreBundleActivator.getTraceHandler().trace("Scanner terminated.", ITracing.ID_TRACE_SCANNER, Scanner.this); //$NON-NLS-1$
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.core.interfaces.IScanner#isTerminated()
- */
- @Override
- public final boolean isTerminated() {
- return terminated.get();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.Job#shouldRun()
- */
- @Override
- public boolean shouldRun() {
- return Platform.isRunning() && !getParentModel().isDisposed() && !isTerminated();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.Job#shouldSchedule()
- */
- @Override
- public boolean shouldSchedule() {
- return Platform.isRunning() && !getParentModel().isDisposed() && !isTerminated();
- }
-}
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
deleted file mode 100644
index 829906bd4..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/ScannerRunnable.java
+++ /dev/null
@@ -1,539 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2013 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;
-
-import java.net.InetAddress;
-import java.net.SocketTimeoutException;
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.Collection;
-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.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.tcf.core.Command;
-import org.eclipse.tcf.protocol.IChannel;
-import org.eclipse.tcf.protocol.IPeer;
-import org.eclipse.tcf.protocol.IToken;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.services.ILocator;
-import org.eclipse.tcf.te.runtime.callback.Callback;
-import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
-import org.eclipse.tcf.te.runtime.utils.net.IPAddressUtil;
-import org.eclipse.tcf.te.tcf.core.Tcf;
-import org.eclipse.tcf.te.tcf.core.peers.Peer;
-import org.eclipse.tcf.te.tcf.locator.activator.CoreBundleActivator;
-import org.eclipse.tcf.te.tcf.locator.interfaces.IScanner;
-import org.eclipse.tcf.te.tcf.locator.interfaces.ITracing;
-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.IPeerNodeProperties;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelLookupService;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelUpdateService;
-import org.eclipse.tcf.te.tcf.locator.nodes.PeerNode;
-import org.eclipse.tcf.te.tcf.locator.nodes.PeerRedirector;
-
-
-/**
- * Scanner runnable to be executed for each peer to probe within the
- * TCF event dispatch thread.
- */
-public class ScannerRunnable implements Runnable, IChannel.IChannelListener {
-
- // Reference to the parent model scanner
- private final IScanner parentScanner;
- // Reference to the peer model node to update
- /* default */ final IPeerNode peerNode;
- // Reference to the channel
- /* default */ IChannel channel = null;
- // Mark if the used channel is a shared channel instance
- /* default */ boolean sharedChannel = false;
-
- // Optional callback to invoke once the scan has been completed
- private final ICallback callback;
-
- /**
- * Constructor.
- *
- * @param scanner The parent model scanner or <code>null</code> if the runnable is constructed from outside a scanner.
- * @param peerNode The peer model instance. Must not be <code>null</code>.
- */
- public ScannerRunnable(IScanner scanner, IPeerNode peerNode) {
- this(scanner, peerNode, null);
- }
-
- /**
- * Constructor.
- *
- * @param scanner The parent model scanner or <code>null</code> if the runnable is constructed from outside a scanner.
- * @param peerNode The peer model instance. Must not be <code>null</code>.
- * @param callback The callback to invoke once the scan has been completed or <code>null</code>.
- */
- public ScannerRunnable(IScanner scanner, IPeerNode peerNode, ICallback callback) {
- super();
-
- parentScanner = scanner;
-
- Assert.isNotNull(peerNode);
- this.peerNode = peerNode;
-
- this.callback = callback;
- }
-
- /**
- * Returns the parent scanner instance.
- *
- * @return The parent scanner instance or <code>null</code>.
- */
- protected final IScanner getParentScanner() {
- return parentScanner;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Runnable#run()
- */
- @Override
- public void run() {
- Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
-
- // If the parent scanner is terminated, don't do anything
- IScanner scanner = getParentScanner();
- if (scanner != null && scanner.isTerminated()) {
- if (callback != null) callback.done(this, Status.OK_STATUS);
- return;
- }
-
- // If a scanner runnable already active for this peer node, there
- // is no need to run another scan.
- if (peerNode.getProperty("scanner.transient") != null) { //$NON-NLS-1$
- if (callback != null) callback.done(this, Status.OK_STATUS);
- return;
- }
- peerNode.setProperty("scanner.transient", this); //$NON-NLS-1$
-
- // Determine the peer
- IPeer peer = peerNode.getPeer();
- if (peer == null) {
- if (callback != null) callback.done(this, Status.OK_STATUS);
- return;
- }
-
- // Don't scan value-adds
- 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 (isValueAdd) {
- if (callback != null) callback.done(this, Status.OK_STATUS);
- return;
- }
-
- // Don't scan "CLI" peers
- boolean isCLI = peer.getName() != null
- && (peer.getName().startsWith("Eclipse CLI") //$NON-NLS-1$
- || peer.getName().startsWith("Eclipse Command Server") //$NON-NLS-1$
- || peer.getName().endsWith("CLI Server") //$NON-NLS-1$
- || peer.getName().endsWith("CLI Client")); //$NON-NLS-1$
- if (isCLI) {
- if (callback != null) callback.done(this, Status.OK_STATUS);
- return;
- }
-
- // Do not open a channel to incomplete peer nodes
- if (peerNode.isComplete()) {
- if (CoreBundleActivator.getTraceHandler().isSlotEnabled(ITracing.ID_TRACE_SCANNER)) {
- CoreBundleActivator.getTraceHandler().trace("Scanner runnable invoked for peer '" + peerNode.getName() + "' (" + peerNode.getPeerId() + "). Attempting to open channel ...", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- ITracing.ID_TRACE_SCANNER, ScannerRunnable.this);
- }
-
- // Check if there is a shared channel available which is still in open state
- channel = Tcf.getChannelManager().getChannel(peer);
- if (channel == null || channel.getState() != IChannel.STATE_OPEN) {
- sharedChannel = false;
- // Open the channel
- channel = peer.openChannel();
- // Add ourself as channel listener
- channel.addChannelListener(this);
- } else {
- sharedChannel = true;
- // Shared channel is in open state -> use it
- onChannelOpened();
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.protocol.IChannel.IChannelListener#onChannelOpened()
- */
- @Override
- public void onChannelOpened() {
- // Peer is reachable
- if (channel != null && !sharedChannel) {
- // Remove ourself as channel listener
- channel.removeChannelListener(this);
- }
-
- if (CoreBundleActivator.getTraceHandler().isSlotEnabled(ITracing.ID_TRACE_SCANNER)) {
- CoreBundleActivator.getTraceHandler().trace("Scanner runnable onChannelOpened invoked for peer '" + peerNode.getName() + "' (" + peerNode.getPeerId() + ").", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- ITracing.ID_TRACE_SCANNER, ScannerRunnable.this);
- }
-
- // Turn off change notifications temporarily
- final boolean changed = peerNode.setChangeEventsEnabled(false);
-
- peerNode.setProperty(IPeerNodeProperties.PROP_LAST_SCANNER_ERROR, null);
-
- // Get the parent model from the model mode
- final IPeerModel model = (IPeerModel)peerNode.getAdapter(IPeerModel.class);
-
- if (channel != null && channel.getState() == IChannel.STATE_OPEN) {
-
- // Update the services lists
- IPeerModelUpdateService updateService = model != null ? model.getService(IPeerModelUpdateService.class) : null;
- if (updateService != null) {
- Collection<String> localServices = channel.getLocalServices();
- Collection<String> remoteServices = channel.getRemoteServices();
-
- updateService.updatePeerServices(peerNode, localServices, remoteServices);
-
- if (CoreBundleActivator.getTraceHandler().isSlotEnabled(ITracing.ID_TRACE_SCANNER)) {
- CoreBundleActivator.getTraceHandler().trace("Services: local = " + localServices + ", remote = " + remoteServices, //$NON-NLS-1$ //$NON-NLS-2$
- ITracing.ID_TRACE_SCANNER, ScannerRunnable.this);
- }
- }
-
- // If we don't queried the DNS name of the peer, or the peer IP changed,
- // trigger a query (can run in any thread, outside TCF dispatch and UI
- // thread). This make sense only if there is an IP address to query at all.
- final String ip = channel.getRemotePeer().getAttributes().get(IPeer.ATTR_IP_HOST);
- if (ip != null && !"".equals(ip)) { //$NON-NLS-1$
- if (peerNode.getStringProperty("dns.name.transient") == null || !ip.equals(peerNode.getStringProperty("dns.lastIP.transient"))) { //$NON-NLS-1$ //$NON-NLS-2$
- // If the IP address changed, reset the "do not query again" marker
- if (!ip.equals(peerNode.getStringProperty("dns.lastIP.transient"))) { //$NON-NLS-1$
- peerNode.setProperty("dns.lastIP.transient", ip); //$NON-NLS-1$
- peerNode.setProperty("dns.skip.transient", false); //$NON-NLS-1$
- }
-
- if (!peerNode.getBooleanProperty("dns.skip.transient")) { //$NON-NLS-1$
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- try {
- InetAddress address = InetAddress.getByName(ip);
- final AtomicReference<String> nameRef = new AtomicReference<String>();
- nameRef.set(address.getCanonicalHostName());
-
- if (ip.equals(nameRef.get()) && IPAddressUtil.getInstance().isLocalHost(ip)) {
- String[] candidates = IPAddressUtil.getInstance().getCanonicalHostNames();
- for (String candidate : candidates) {
- if (!ip.equals(candidate)) {
- nameRef.set(candidate);
- break;
- }
- }
- }
-
- Protocol.invokeLater(new Runnable() {
- @Override
- public void run() {
- String name = nameRef.get();
- if (name != null && !"".equals(name) && !ip.equals(name)) { //$NON-NLS-1$
- String dnsName = name.indexOf('.') != -1 ? name.substring(0, name.indexOf('.')) : name;
- if (!ip.equalsIgnoreCase(dnsName)) {
- peerNode.setProperty("dns.name.transient", dnsName.toLowerCase()); //$NON-NLS-1$
- }
- }
- }
- });
- }
- catch (UnknownHostException e) {
- Protocol.invokeLater(new Runnable() {
- @Override
- public void run() {
- peerNode.setProperty("dns.skip.transient", true); //$NON-NLS-1$
- }
- });
- }
- }
- };
-
- Thread thread = new Thread(runnable, "DNS Query Thread for " + ip); //$NON-NLS-1$
- thread.start();
- }
- }
- }
-
- // Check if the agent ID is already set
- String agentID = channel.getRemotePeer().getAgentID();
- if (agentID == null && channel.getRemotePeer() instanceof Peer) {
- // Determine the agent ID of the remote agent
- ILocator locator = channel.getRemoteService(ILocator.class);
- if (locator != null) {
- locator.getAgentID(new ILocator.DoneGetAgentID() {
- @Override
- public void doneGetAgentID(IToken token, Exception error, String agentID) {
- // Ignore errors. If the agent does not implement this command, we
- // do not fail.
- if (agentID != null) {
- // Update the peer attributes
- Map<String, String> attrs = new HashMap<String, String>(channel.getRemotePeer().getAttributes());
- attrs.put(IPeer.ATTR_AGENT_ID, agentID);
- peerNode.setProperty(IPeerNodeProperties.PROP_INSTANCE, new Peer(attrs));
- }
-
- if (isGetPeersAllowed(channel)) {
- // Get the peers from the remote locator
- getPeers(channel, model, ip, new Callback() {
- @Override
- protected void internalDone(Object caller, IStatus status) {
- // Complete
- onDone(peerNode, changed);
- }
- });
- } else {
- onDone(peerNode, changed);
- }
- }
- });
- } else {
- // Complete
- onDone(peerNode, changed);
- }
- } else {
- if (isGetPeersAllowed(channel)) {
- // Get the peers from the remote locator
- getPeers(channel, model, ip, new Callback() {
- @Override
- protected void internalDone(Object caller, IStatus status) {
- // Complete
- onDone(peerNode, changed);
- }
- });
- } else {
- onDone(peerNode, changed);
- }
- }
- } else {
- // Complete
- onDone(peerNode, changed);
- }
- }
-
- /**
- * Returns if or if not "getPeers" is allowed for the given channel.
- *
- * @param channel The channel. Must not be <code>null</code>.
- * @return <code>True</code> if "getPeers" is allowed, <code>false</code> otherwise.
- */
- /* default */ boolean isGetPeersAllowed(IChannel channel) {
- String remoteIP = channel.getRemotePeer().getAttributes().get(IPeer.ATTR_IP_HOST);
- boolean isLocal = remoteIP != null && IPAddressUtil.getInstance().isLocalHost(remoteIP);
-
- boolean isCLI = channel.getRemotePeer().getName() != null
- && (channel.getRemotePeer().getName().startsWith("Eclipse CLI") //$NON-NLS-1$
- || channel.getRemotePeer().getName().endsWith("CLI Server") //$NON-NLS-1$
- || channel.getRemotePeer().getName().endsWith("CLI Client")); //$NON-NLS-1$
-
- isCLI |= channel.getLocalPeer().getName() != null
- && (channel.getLocalPeer().getName().startsWith("Eclipse CLI") //$NON-NLS-1$
- || channel.getLocalPeer().getName().endsWith("CLI Server") //$NON-NLS-1$
- || channel.getLocalPeer().getName().endsWith("CLI Client")); //$NON-NLS-1$
-
- return !isLocal && !isCLI;
- }
-
- /**
- * Query the peers from the remote locator.
- *
- * @param channel The channel. Must not be <code>null</code>.
- * @param model The locator model. Must not be <code>null</code>.
- * @param ip The IP address or <code>null</code>.
- * @param callback The callback. Must not be <code>null</code>.
- */
- @SuppressWarnings("unused")
- protected void getPeers(final IChannel channel, final IPeerModel model, final String ip, final ICallback callback) {
- Assert.isNotNull(channel);
- Assert.isNotNull(model);
- Assert.isNotNull(callback);
-
- // Keep the channel open as long as the query for the remote peers is running.
- boolean keepOpen = false;
-
- // Get the agent ID of the remote agent we are connected too.
- // Have to use the peer model node here.
- final String agentID = peerNode.getPeer().getAgentID();
-
- // Ask for discovered peers from the remote agents POV.
- //
- // Note: For simulators connected via NAT, we have to do this for localhost address
- // as well. Otherwise we miss the discoverable agents only known to the simulator.
- // The same applies to agent being discovered. If you don't ask for discovered peers
- // here too, we may miss some routes.
- if (ip != null && !"".equals(ip)) { //$NON-NLS-1$
- // Use the open channel to ask the remote peer what other peers it knows
- ILocator locator = channel.getRemoteService(ILocator.class);
- if (locator != null) {
- // Channel must be kept open as long as the command runs
- keepOpen = true;
- // Issue the command
- new Command(channel, locator, "getPeers", null) { //$NON-NLS-1$
- @Override
- public void done(Exception error, Object[] args) {
- if (error == null) {
- Assert.isTrue(args.length == 2);
- error = toError(args[0]);
- }
- // If the error is still null here, process the returned peers
- if (error == null && args[1] != null) {
- // Get the parent peer
- IPeer parentPeer = channel.getRemotePeer();
- // Get the old child list
- List<IPeerNode> oldChildren = new ArrayList<IPeerNode>(model.getChildren(parentPeer.getID()));
-
- // "getPeers" returns a collection of peer attribute maps
- @SuppressWarnings("unchecked")
- Collection<Map<String,String>> peerAttributesList = (Collection<Map<String,String>>)args[1];
- for (Map<String,String> attributes : peerAttributesList) {
- // Don't process value-add's
- String value = attributes.get("ValueAdd"); //$NON-NLS-1$
- boolean isValueAdd = value != null && ("1".equals(value.trim()) || Boolean.parseBoolean(value.trim())); //$NON-NLS-1$
-
- // Don't process CLI service or clients
- String name = attributes.get(IPeer.ATTR_NAME);
- boolean isCLI = name != null
- && (name.startsWith("Eclipse CLI") //$NON-NLS-1$
- || name.endsWith("CLI Server") //$NON-NLS-1$
- || name.endsWith("CLI Client")); //$NON-NLS-1$
-
- if (isValueAdd || isCLI) continue;
-
- // Get the peer id
- String peerId = attributes.get(IPeer.ATTR_ID);
- // Create a peer instance
- IPeer peer = new PeerRedirector(parentPeer, attributes);
- // Try to find an existing peer node first
- IPeerNode peerNode = model.getService(IPeerModelLookupService.class).lkupPeerModelById(parentPeer.getID(), peerId);
- if (peerNode == null) {
- // Not yet known -> add it
- peerNode = new PeerNode(model, peer);
- peerNode.setParent(ScannerRunnable.this.peerNode);
- peerNode.setProperty(IPeerNodeProperties.PROP_SCANNER_EXCLUDE, true);
- // Validate the peer node before adding
- peerNode = model.validateChildPeerNodeForAdd(peerNode);
- if (peerNode != null) {
- // Add the child peer node to model
- model.getService(IPeerModelUpdateService.class).addChild(peerNode);
- }
- } else {
- // The parent node should be set and match
- Assert.isTrue(peerNode.getParent(IPeerNode.class) != null && peerNode.getParent(IPeerNode.class).equals(ScannerRunnable.this.peerNode));
- // Peer node found, update the peer instance
- peerNode.setProperty(IPeerNodeProperties.PROP_INSTANCE, peer);
- // And remove it from the old child list
- oldChildren.remove(peerNode);
- }
- }
- }
-
- // Once everything is processed, close the channel
- if (!sharedChannel) channel.close();
- // Invoke the callback
- callback.done(ScannerRunnable.this, Status.OK_STATUS);
- }
- };
- }
- }
-
- // And close the channel
- if (!sharedChannel && !keepOpen) channel.close();
-
- // Invoke the callback
- if (!keepOpen) callback.done(ScannerRunnable.this, Status.OK_STATUS);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.protocol.IChannel.IChannelListener#onChannelClosed(java.lang.Throwable)
- */
- @Override
- public void onChannelClosed(Throwable error) {
- // Peer is not reachable
-
- if (channel != null) {
- // Remove ourself as channel listener
- channel.removeChannelListener(this);
- }
-
- if (CoreBundleActivator.getTraceHandler().isSlotEnabled(ITracing.ID_TRACE_SCANNER)) {
- CoreBundleActivator.getTraceHandler().trace("Scanner runnable onChannelClosed invoked for peer '" + peerNode.getName() + "' (" + peerNode.getPeerId() + "). Error was: " + (error != null ? error.getLocalizedMessage() : null), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- ITracing.ID_TRACE_SCANNER, ScannerRunnable.this);
- }
-
- // Set the peer state property, if the scanner the runnable
- // has been scheduled from is still active.
- if (parentScanner == null || !parentScanner.isTerminated()) {
- // Turn off change notifications temporarily
- boolean changed = peerNode.setChangeEventsEnabled(false);
-
- peerNode.setProperty(IPeerNodeProperties.PROP_CHANNEL_REF_COUNTER, null);
- peerNode.setProperty(IPeerNodeProperties.PROP_LAST_SCANNER_ERROR, error instanceof SocketTimeoutException ? null : error);
-
- // Clear out previously determined services
- IPeerModel model = (IPeerModel)peerNode.getAdapter(IPeerModel.class);
- if (model != null) {
- IPeerModelUpdateService updateService = model.getService(IPeerModelUpdateService.class);
- updateService.updatePeerServices(peerNode, null, null);
-
- // Clean out possible child nodes
- model.setChildren(peerNode.getPeerId(), null);
- }
-
- // Clean out DNS name detection
- peerNode.setProperty("dns.name.transient", null); //$NON-NLS-1$
- peerNode.setProperty("dns.lastIP.transient", null); //$NON-NLS-1$
- peerNode.setProperty("dns.skip.transient", null); //$NON-NLS-1$
-
- // Complete
- onDone(peerNode, changed);
- }
- }
-
- /**
- * Called from {@link #onChannelOpened()} and {@link #onChannelClosed(Throwable)} once
- * all operations of the scanner are completed.
- *
- * @param node The peer model node. Must not be <code>null</code>.
- * @param changed <code>True</code> if the change events shall be enabled, <code>false</code> otherwise.
- */
- protected void onDone(IPeerNode node, boolean changed) {
- Assert.isNotNull(node);
-
- // Reset the scanner runnable marker
- node.setProperty("scanner.transient", null); //$NON-NLS-1$
-
- // Re-enable the change events and fire a "properties" change event
- if (changed) {
- node.setChangeEventsEnabled(true);
- node.fireChangeEvent("properties", null, peerNode.getProperties()); //$NON-NLS-1$
- }
-
- if (callback != null) callback.done(this, Status.OK_STATUS);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.protocol.IChannel.IChannelListener#congestionLevel(int)
- */
- @Override
- public void congestionLevel(int level) {
- }
-
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/activator/CoreBundleActivator.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/activator/CoreBundleActivator.java
index 5584d8615..a990260e8 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/activator/CoreBundleActivator.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/activator/CoreBundleActivator.java
@@ -87,7 +87,7 @@ public class CoreBundleActivator extends Plugin {
plugin = null;
// Dispose the locator model
- final IPeerModel model = Model.getModel(true);
+ final IPeerModel model = Model.getPeerModel(true);
if (model != null) {
Runnable runnable = new Runnable() {
@Override
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/ITracing.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/ITracing.java
index b8475fb93..24567a348 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/ITracing.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/ITracing.java
@@ -16,9 +16,14 @@ public interface ITracing {
/**
+ * If enabled, prints information about peer model method invocations.
+ */
+ public static String ID_TRACE_PEER_MODEL = "trace/peerModel"; //$NON-NLS-1$
+
+ /**
* If enabled, prints information about locator model method invocations.
*/
- public static String ID_TRACE_LOCATOR_MODEL = "trace/peerModel"; //$NON-NLS-1$
+ public static String ID_TRACE_LOCATOR_MODEL = "trace/locatorModel"; //$NON-NLS-1$
/**
* If enabled, prints information about locator listener method invocations.
@@ -29,14 +34,4 @@ public interface ITracing {
* If enabled, prints information about locator model property tester invocations.
*/
public static String ID_TRACE_PROPERTY_TESTER = "trace/propertyTester"; //$NON-NLS-1$
-
- /**
- * If enabled, prints information about channel state change listener method invocations.
- */
- public static String ID_TRACE_CHANNEL_STATE_CHANGE_LISTENER = "trace/channelStateChangeListener"; //$NON-NLS-1$
-
- /**
- * If enabled, prints information about the scanner.
- */
- public static String ID_TRACE_SCANNER = "trace/scanner"; //$NON-NLS-1$
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/ILocatorModel.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/ILocatorModel.java
new file mode 100644
index 000000000..dd636b057
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/ILocatorModel.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * 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.interfaces.nodes;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.tcf.protocol.IPeer;
+import org.eclipse.tcf.services.ILocator;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelService;
+
+
+/**
+ * The locator model is an extension to the TCF locator service. The
+ * model allows to store additional properties for each peer, keep
+ * track of peers from different origins.
+ * <p>
+ * <b>Note:</b> Updates to the locator model, and the locator model
+ * children needs to be performed in the TCF dispatch thread. The
+ * locator model and all child model nodes do assert this core
+ * assumption. To maintain consistency, and to avoid any performance
+ * overhead for thread synchronization, the model read access must
+ * happen in the TCF dispatch thread as well.
+ *
+ * @see ILocator
+ */
+public interface ILocatorModel extends IAdaptable {
+
+ /**
+ * Dispose the locator model instance.
+ */
+ public void dispose();
+
+ /**
+ * Returns if or if not the locator model instance is disposed.
+ *
+ * @return <code>True</code> if the locator model instance is disposed, <code>false/code> otherwise.
+ */
+ public boolean isDisposed();
+
+ /**
+ * Returns the list of known peers.
+ *
+ * @return The list of known peers or an empty list.
+ */
+ public IPeer[] getPeers();
+
+ /**
+ * Returns an unmodifiable list of known children for the given parent peer.
+ *
+ * @param parentPeerID The parent peer id. Must not be <code>null</code>.
+ * @return The child list.
+ */
+ public List<IPeer> getChildren(String parentPeerID);
+
+ /**
+ * Sets the list of known children for the given parent peer.
+ *
+ * @param parentPeerID The parent peer id. Must not be <code>null</code>.
+ * @param children The list of children or <code>null</code> to remove the parent peer.
+ */
+ public void setChildren(String parentPeerID, List<IPeer> children);
+
+ /**
+ * Returns the locator model service, implementing at least the specified
+ * service interface.
+ *
+ * @param serviceInterface The service interface class. Must not be <code>null</code>.
+ * @return The service instance implementing the specified service interface, or <code>null</code>.
+ */
+ public <V extends ILocatorModelService> V getService(Class<V> serviceInterface);
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerModel.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerModel.java
index daf6d8218..145765c35 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerModel.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerModel.java
@@ -9,13 +9,10 @@
*******************************************************************************/
package org.eclipse.tcf.te.tcf.locator.interfaces.nodes;
-import java.util.List;
-
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.tcf.protocol.IPeer;
import org.eclipse.tcf.services.ILocator;
import org.eclipse.tcf.te.tcf.locator.interfaces.IModelListener;
-import org.eclipse.tcf.te.tcf.locator.interfaces.IScanner;
import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelService;
@@ -78,43 +75,6 @@ public interface IPeerModel extends IAdaptable {
public IPeerNode[] getPeerNodes();
/**
- * Returns an unmodifiable list of known children for the given parent peer.
- *
- * @param parentPeerID The parent peer id. Must not be <code>null</code>.
- * @return The child list.
- */
- public List<IPeerNode> getChildren(String parentPeerID);
-
- /**
- * Sets the list of known children for the given parent peer.
- *
- * @param parentPeerID The parent peer id. Must not be <code>null</code>.
- * @param children The list of children or <code>null</code> to remove the parent peer.
- */
- public void setChildren(String parentPeerID, List<IPeerNode> children);
-
- /**
- * Returns the scanner instance being associated with the
- * locator model.
- *
- * @return The scanner instance.
- */
- public IScanner getScanner();
-
- /**
- * Starts the scanner.
- *
- * @param delay The delay in millisecond before the scanning starts.
- * @param schedule The time in millisecond between the scanner runs.
- */
- public void startScanner(long delay, long schedule);
-
- /**
- * Stops the scanner.
- */
- public void stopScanner();
-
- /**
* Returns the locator model service, implementing at least the specified
* service interface.
*
@@ -133,26 +93,4 @@ public interface IPeerModel extends IAdaptable {
*/
public IPeer validatePeer(IPeer peer);
- /**
- * Validate the given peer model if or if not it can be added to the locator model as new peer
- * node.
- *
- * @param node The peer model. Must not be <code>null</code>.
- * @return The peer node if it allowed add it to the model, or <code>null</code> if not.
- */
- public IPeerNode validatePeerNodeForAdd(IPeerNode node);
-
- /**
- * Validate the given child peer model node if or if not it can be added to the locator model
- * as new child peer node for the associated parent peer model node.
- * <p>
- * <b>Note:</b> The parent peer node is determined by calling {@link IPeerNode#getParentNode()}.
- * The call has to return a non-null value, otherwise {@link #validateChildPeerNodeForAdd(IPeerNode)}
- * will do nothing.
- *
- * @param node The peer model. Must not be <code>null</code>.
- * @return The peer node if it allowed add it to the model, or <code>null</code> if not.
- */
- public IPeerNode validateChildPeerNodeForAdd(IPeerNode node);
-
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/ILocatorModelLookupService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/ILocatorModelLookupService.java
new file mode 100644
index 000000000..c0cce36a0
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/ILocatorModelLookupService.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2013 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.services;
+
+import org.eclipse.tcf.protocol.IPeer;
+
+/**
+ * The service to lookup/search in the parent locator model.
+ */
+public interface ILocatorModelLookupService extends ILocatorModelService {
+
+ /**
+ * Lookup the locator model for the given peer id.
+ *
+ * @param id The peer id. Must not be <code>null</code>.
+ * @return The peer instance, or <code>null</code> if the peer cannot be found.
+ */
+ public IPeer lkupPeerById(String id);
+
+ /**
+ * Lookup the matching peer instances for the given agent id.
+ *
+ * @param agentId The agent id. Must not be <code>null</code>.
+ * @return The peer instances, or an empty list if the given agent id could not be matched.
+ */
+ public IPeer[] lkupPeerByAgentId(String agentId);
+
+ /**
+ * Lookup matching peer instances for the given name.
+ *
+ * @param name The name. Must not be <code>null</code>.
+ * @return The peer instances, or an empty list if the given name could not be matched.
+ */
+ public IPeer[] lkupPeerByName(String name);
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/ILocatorModelRefreshService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/ILocatorModelRefreshService.java
new file mode 100644
index 000000000..bde998762
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/ILocatorModelRefreshService.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2013 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.services;
+
+import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
+
+/**
+ * The service to refresh the parent locator model from remote.
+ */
+public interface ILocatorModelRefreshService extends ILocatorModelService {
+
+ /**
+ * Refreshes the list of known peers from the local locator service
+ * and update the locator model.
+ *
+ * @param callback The callback to invoke once the refresh operation finished, or <code>null</code>.
+ */
+ public void refresh(ICallback callback);
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/ILocatorModelService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/ILocatorModelService.java
new file mode 100644
index 000000000..6dfeb3686
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/ILocatorModelService.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * 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.services;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel;
+
+/**
+ * Common parent interface for locator model services.
+ */
+public interface ILocatorModelService extends IAdaptable {
+
+ /**
+ * Returns the parent locator model.
+ *
+ * @return The parent locator model.
+ */
+ public ILocatorModel getLocatorModel();
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/ILocatorModelUpdateService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/ILocatorModelUpdateService.java
new file mode 100644
index 000000000..da368553a
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/ILocatorModelUpdateService.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * 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.interfaces.services;
+
+import org.eclipse.tcf.protocol.IPeer;
+
+/**
+ * The service to update the properties of given locator node.
+ */
+public interface ILocatorModelUpdateService extends ILocatorModelService {
+
+ /**
+ * Adds the given peer to the list of know peers.
+ *
+ * @param peer The peer to add. Must not be <code>null</code>.
+ */
+ public void add(IPeer peer);
+
+ /**
+ * Removes the given peer from the list of known peers.
+ *
+ * @param peer The peer to remove. Must not be <code>null</code.
+ */
+ public void remove(IPeer peer);
+
+ /**
+ * Update an old peer with the given new one.
+ * @param oldPeer The old peer to update. Must not be <code>null</code.
+ * @param newPeer The new peer. Must not be <code>null</code.
+ */
+ public void update(IPeer oldPeer, IPeer newPeer);
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IPeerModelLookupService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IPeerModelLookupService.java
index 63121f94d..8d5850e6f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IPeerModelLookupService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IPeerModelLookupService.java
@@ -9,11 +9,10 @@
*******************************************************************************/
package org.eclipse.tcf.te.tcf.locator.interfaces.services;
-import org.eclipse.tcf.protocol.IPeer;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
/**
- * The service to lookup/search in the parent locator model.
+ * The service to lookup/search in the parent peer model.
*/
public interface IPeerModelLookupService extends IPeerModelService {
@@ -21,70 +20,35 @@ public interface IPeerModelLookupService extends IPeerModelService {
* Lookup the peer model for the given peer id.
*
* @param id The peer id. Must not be <code>null</code>.
- * @return The peer model instance, or <code>null</code> if the peer model cannot be found.
+ * @return The peer node instance, or <code>null</code> if the peer node cannot be found.
*/
public IPeerNode lkupPeerModelById(String id);
/**
- * Lookup the peer model for the given peer id from the peers child list of
- * the peer identified by the given parent id.
- *
- * @param parentId The parent peer id. Must not be <code>null</code>.
- * @param id The peer id. Must not be <code>null</code>.
- * @return The peer model instance, or <code>null</code> if the peer model cannot be found.
- */
- public IPeerNode lkupPeerModelById(String parentId, String id);
-
- /**
- * Lookup the matching peer model instances for the given agent id.
+ * Lookup the matching peer node instances for the given agent id.
*
* @param agentId The agent id. Must not be <code>null</code>.
- * @return The peer model instances, or an empty list if the given agent id could not be matched.
+ * @return The peer node instances, or an empty list if the given agent id could not be matched.
*/
public IPeerNode[] lkupPeerModelByAgentId(String agentId);
/**
- * Lookup the matching peer model instances for the given agent id.
- *
- * @param parentId The parent peer id. Must not be <code>null</code>.
- * @param agentId The agent id. Must not be <code>null</code>.
- * @return The peer model instances, or an empty list if the given agent id could not be matched.
- */
- public IPeerNode[] lkupPeerModelByAgentId(String parentId, String agentId);
-
- /**
- * Lookup matching peer model instances for the given name.
+ * Lookup matching peer node instances for the given name.
*
* @param name The name. Must not be <code>null</code>.
- * @return The peer model instances, or an empty list if the given name could not be matched.
+ * @return The peer node instances, or an empty list if the given name could not be matched.
*/
public IPeerNode[] lkupPeerModelByName(String name);
/**
- * Lookup matching peer model instances which supports the listed local and remote services.
+ * Lookup matching peer node instances which supports the listed local and remote services.
* <p>
* <b>Note:</b> This method must be called outside the TCF dispatch thread.
*
* @param expectedLocalServices The list of local service names to be supported, or <code>null</code>.
* @param expectedRemoteServices The list of remote service names to be supported, or <code>null</code>.
*
- * @return The peer model instances, or an empty list if the listed services are not supported by any of the peers.
+ * @return The peer node instances, or an empty list if the listed services are not supported by any of the peers node.
*/
public IPeerNode[] lkupPeerModelBySupportedServices(String[] expectedLocalServices, String[] expectedRemoteServices);
-
- /**
- * Lookup the matching static peer model instances for the given peer model node.
- *
- * @param peerNode The peer model node. Must not be <code>null</code>.
- * @return The matching peer model instances or an empty list.
- */
- public IPeerNode[] lkupMatchingStaticPeerModels(IPeerNode peerNode);
-
- /**
- * Lookup the matching static peer model instances for the given peer.
- *
- * @param peer The peer or <code>null</code>.
- * @return The matching peer model instances or an empty list.
- */
- public IPeerNode[] lkupMatchingStaticPeerModels(IPeer peer);
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IPeerModelQueryService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IPeerModelQueryService.java
index 70c937814..49c080d57 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IPeerModelQueryService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IPeerModelQueryService.java
@@ -12,14 +12,14 @@ package org.eclipse.tcf.te.tcf.locator.interfaces.services;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
/**
- * The service to query asynchronous properties of peers.
+ * The service to query asynchronous properties of peer nodes.
*/
public interface IPeerModelQueryService extends IPeerModelService {
/**
- * Query the list of available local services for the given peer.
+ * Query the list of available local services for the given peer node.
* <p>
- * <b>Note:</b> The result of the query is cached within the given peer model
+ * <b>Note:</b> The result of the query is cached within the given peer
* node and subsequent calls will return immediately with the cached value.
* <p>
* <b>Note:</b> This method must be called outside the TCF dispatch thread.
@@ -30,9 +30,9 @@ public interface IPeerModelQueryService extends IPeerModelService {
public String queryLocalServices(IPeerNode node);
/**
- * Query the list of available remote services for the given peer.
+ * Query the list of available remote services for the given peer node.
* <p>
- * <b>Note:</b> The result of the query is cached within the given peer model
+ * <b>Note:</b> The result of the query is cached within the given peer
* node and subsequent calls will return immediately with the cached value.
* <p>
* <b>Note:</b> This method must be called outside the TCF dispatch thread.
@@ -55,7 +55,7 @@ public interface IPeerModelQueryService extends IPeerModelService {
}
/**
- * Asynchronously query the services for the given peer model node.
+ * Asynchronously query the services for the given peer node.
* <p>
* <b>Note:</b> This method must be called from within the TCF dispatch thread.
*
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IPeerModelRefreshService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IPeerModelRefreshService.java
index dc683ea76..201ee399f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IPeerModelRefreshService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IPeerModelRefreshService.java
@@ -10,32 +10,16 @@
package org.eclipse.tcf.te.tcf.locator.interfaces.services;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
/**
- * The service to refresh the parent locator model from remote.
+ * The service to refresh the parent peer model.
*/
public interface IPeerModelRefreshService extends IPeerModelService {
/**
- * Refreshes the list of known peers from the local locator service
- * and update the locator model.
+ * Refreshes the list of known peer nodes and update the peer model.
*
* @param callback The callback to invoke once the refresh operation finished, or <code>null</code>.
*/
public void refresh(ICallback callback);
-
- /**
- * Refreshes the list of static peers only and merge them with the peers
- * already known to the locator model via the dynamic discovery.
- */
- public void refreshStaticPeers();
-
- /**
- * Refresh the agent ID's of the given or all reachable static peers.
- *
- * @param nodes The list of nodes to refresh or <code>null</code> to refresh all.
- * @param callback The callback to invoke once the refresh operation finished, or <code>null</code>.
- */
- public void refreshAgentIDs(IPeerNode[] nodes, ICallback callback);
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IPeerModelUpdateService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IPeerModelUpdateService.java
index ca2734a98..0b6782734 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IPeerModelUpdateService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IPeerModelUpdateService.java
@@ -11,28 +11,24 @@ package org.eclipse.tcf.te.tcf.locator.interfaces.services;
import java.util.Collection;
-import org.eclipse.tcf.protocol.IPeer;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
-
/**
- * The service to update the properties of given locator model nodes.
+ * The service to update the properties of given peer node.
*/
public interface IPeerModelUpdateService extends IPeerModelService {
/**
- * Adds the given peer to the list of know peers.
- * <p>
- * A previous mapping to a peer model with the same id as the given peer model is overwritten.
+ * Adds the given peer node to the list of know peer nodes.
*
- * @param peer The peer model object. Must not be <code>null</code>.
+ * @param peer The peer node to add. Must not be <code>null</code>.
*/
public void add(IPeerNode peer);
/**
- * Removes the given peer from the list of known peers.
+ * Removes the given peer node from the list of known peer nodes.
*
- * @param peer The peer model object. Must not be <code>null</code.
+ * @param peer The peer node to remove. Must not be <code>null</code.
*/
public void remove(IPeerNode peer);
@@ -40,42 +36,10 @@ public interface IPeerModelUpdateService extends IPeerModelService {
* Update the service nodes of the given peer node with the new set of
* local and/or remote services.
*
- * @param peerNode The peer model instance. Must not be <code>null</code>.
+ * @param peerNode The peer node instance. Must not be <code>null</code>.
* @param localServices The list of local service names or <code>null</code>.
* @param remoteServices The list of remote service names or <code>null</code>.
*/
public void updatePeerServices(IPeerNode peerNode, Collection<String> localServices, Collection<String> remoteServices);
- /**
- * Adds the given child peer to the parent peer.
- * <p>
- * <b>Note:</b> The parent peer node is determined by calling {@link IPeerNode#getParentNode()}.
- * The call has to return a non-null value, otherwise {@link #addChild(IPeerNode)}
- * will do nothing.
- *
- * @param parent The parent peer model node. Must not be <code>null</code>.
- * @param child The child peer model object. Must not be <code>null</code>.
- */
- public void addChild(IPeerNode child);
-
- /**
- * Removes the given child peer from the parent peer.
- * <p>
- * <b>Note:</b> The parent peer node is determined by calling {@link IPeerNode#getParentNode()}.
- * The call has to return a non-null value, otherwise {@link #removeChild(IPeerNode)}
- * will do nothing.
- *
- * @param parent The parent peer model node. Must not be <code>null</code>.
- * @param child The child peer model object. Must not be <code>null</code>.
- */
- public void removeChild(IPeerNode child);
-
- /**
- * Merge user defined peer attributes from the given peer into the given peer node.
- *
- * @param node The peer node. Must not be <code>null</code>.
- * @param peer The peer. Must not be <code>null</code>.
- * @param force If <code>true</code>, the peer attributes are merged even if the peer id's don't match.
- */
- public void mergeUserDefinedAttributes(IPeerNode node, IPeer peer, boolean force);
}
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 572fd793e..b8ab91c25 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
@@ -19,12 +19,8 @@ import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.Platform;
import org.eclipse.tcf.protocol.IPeer;
import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.tcf.locator.activator.CoreBundleActivator;
-import org.eclipse.tcf.te.tcf.locator.interfaces.ITracing;
-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.IPeerNodeProperties;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelQueryService;
import org.eclipse.tcf.te.tcf.locator.nodes.PeerRedirector;
/**
@@ -45,28 +41,12 @@ public class PeerModelPropertyTester extends PropertyTester {
final IPeerNode peerNode = (IPeerNode)receiver;
final AtomicBoolean result = new AtomicBoolean();
- // If we have to test for local or remote services, we have to handle it special
- if ("hasLocalService".equals(property) || "hasRemoteService".equals(property)) { //$NON-NLS-1$ //$NON-NLS-2$
- // This tests must happen outside the TCF dispatch thread's
- if (!Protocol.isDispatchThread()) {
- result.set(testServices(peerNode, property, args, expectedValue));
+ Protocol.invokeAndWait(new Runnable() {
+ @Override
+ public void run() {
+ result.set(testPeerModel(peerNode, property, args, expectedValue));
}
- }
- else {
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- result.set(testPeerModel(peerNode, property, args, expectedValue));
- }
- };
-
- if (Protocol.isDispatchThread()) {
- runnable.run();
- }
- else {
- Protocol.invokeAndWait(runnable);
- }
- }
+ });
return result.get();
}
@@ -114,14 +94,6 @@ public class PeerModelPropertyTester extends PropertyTester {
}
}
- if ("isStaticPeer".equals(property)) { //$NON-NLS-1$
- String value = peer.getAttributes().get("static.transient"); //$NON-NLS-1$
- boolean isStaticPeer = value != null && Boolean.parseBoolean(value.trim());
- if (expectedValue instanceof Boolean) {
- return ((Boolean) expectedValue).booleanValue() == isStaticPeer;
- }
- }
-
if ("isRedirected".equals(property)) { //$NON-NLS-1$
boolean isRedirected = peer instanceof PeerRedirector;
if (expectedValue instanceof Boolean) {
@@ -174,53 +146,29 @@ public class PeerModelPropertyTester extends PropertyTester {
List<String> remote = remoteServices != null ? Arrays.asList(remoteServices.split(",\\s*")) : null; //$NON-NLS-1$
boolean hasOfflineService = (remote == null) ? offline.contains(expectedValue) : remote.contains(expectedValue);
if (expectedValue instanceof Boolean) {
- return ((Boolean) expectedValue).booleanValue() == hasOfflineService;
+ return ((Boolean)expectedValue).booleanValue() == hasOfflineService;
}
return hasOfflineService;
}
- return false;
- }
-
- /**
- * Test for the peer model node local or remote services.
- * <p>
- * <b>Node:</b> This method cannot be called from within the TCF Dispatch Thread.
- *
- * @param node The model node. Must not be <code>null</code>.
- * @param property The property to test.
- * @param args The property arguments.
- * @param expectedValue The expected value.
- *
- * @return <code>True</code> if the property to test has the expected value, <code>false</code>
- * otherwise.
- */
- protected boolean testServices(final IPeerNode node, final String property, final Object[] args, final Object expectedValue) {
- Assert.isNotNull(node);
- Assert.isTrue(!Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
-
- String services = null;
-
- IPeerModel model = node.getModel();
- IPeerModelQueryService queryService = model.getService(IPeerModelQueryService.class);
- if ("hasLocalService".equals(property)) { //$NON-NLS-1$
- services = queryService.queryLocalServices(node);
- } else {
- services = queryService.queryRemoteServices(node);
- }
-
- if (CoreBundleActivator.getTraceHandler().isSlotEnabled(ITracing.ID_TRACE_PROPERTY_TESTER)) {
- CoreBundleActivator.getTraceHandler().trace("testServices: property = " + property + ", expectedValue = " + expectedValue + ", services = " + services, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- ITracing.ID_TRACE_PROPERTY_TESTER, PeerModelPropertyTester.this);
+ if ("hasRemoteService".equals(property)) { //$NON-NLS-1$
+ String remoteServices = peerNode.getStringProperty(IPeerNodeProperties.PROP_REMOTE_SERVICES);
+ List<String> remote = remoteServices != null ? Arrays.asList(remoteServices.split(",\\s*")) : Collections.EMPTY_LIST; //$NON-NLS-1$
+ boolean hasRemoteService = remote.contains(expectedValue);
+ if (expectedValue instanceof Boolean) {
+ return ((Boolean)expectedValue).booleanValue() == hasRemoteService;
+ }
+ return hasRemoteService;
}
- if (services != null) {
- // Lookup each service individually to avoid "accidental" matching
- for (String service : services.split(",")) { //$NON-NLS-1$
- if (service != null && service.trim().equals(expectedValue)) {
- return true;
- }
+ if ("hasLocalService".equals(property)) { //$NON-NLS-1$
+ String localServices = peerNode.getStringProperty(IPeerNodeProperties.PROP_LOCAL_SERVICES);
+ List<String> remote = localServices != null ? Arrays.asList(localServices.split(",\\s*")) : Collections.EMPTY_LIST; //$NON-NLS-1$
+ boolean hasLocalService = remote.contains(expectedValue);
+ if (expectedValue instanceof Boolean) {
+ return ((Boolean)expectedValue).booleanValue() == hasLocalService;
}
+ return hasLocalService;
}
return false;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/adapters/AdapterFactory.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/adapters/AdapterFactory.java
index cdbede25b..17d0c1318 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/adapters/AdapterFactory.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/adapters/AdapterFactory.java
@@ -70,7 +70,7 @@ public class AdapterFactory implements IAdapterFactory {
@Override
public void run() {
String id = peer.getID();
- IPeerModel model = Model.getModel();
+ IPeerModel model = Model.getPeerModel();
Assert.isNotNull(model);
IPeerNode candidate = model.getService(IPeerModelLookupService.class).lkupPeerModelById(id);
if (candidate != null) node.set(candidate);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/ChannelStateChangeListener.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/ChannelStateChangeListener.java
deleted file mode 100644
index 599383404..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/ChannelStateChangeListener.java
+++ /dev/null
@@ -1,86 +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.listener;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.tcf.protocol.IChannel;
-import org.eclipse.tcf.protocol.IPeer;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.tcf.core.listeners.interfaces.IChannelStateChangeListener;
-import org.eclipse.tcf.te.tcf.locator.activator.CoreBundleActivator;
-import org.eclipse.tcf.te.tcf.locator.interfaces.ITracing;
-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.IPeerNodeProperties;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelLookupService;
-
-
-/**
- * Channel state change listener implementation.
- */
-public class ChannelStateChangeListener implements IChannelStateChangeListener {
- // Reference to the parent model
- private final IPeerModel model;
-
- /**
- * Constructor.
- *
- * @param model The parent locator model. Must not be <code>null</code>.
- */
- public ChannelStateChangeListener(IPeerModel model) {
- Assert.isNotNull(model);
- this.model = model;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.tcf.core.interfaces.listeners.IChannelStateChangeListener#stateChanged(org.eclipse.tcf.protocol.IChannel, int)
- */
- @Override
- public void stateChanged(IChannel channel, int state) {
- Assert.isNotNull(channel);
- Assert.isTrue(Protocol.isDispatchThread());
-
- if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITracing.ID_TRACE_CHANNEL_STATE_CHANGE_LISTENER)) {
- CoreBundleActivator.getTraceHandler().trace("ChannelStateChangeListener.stateChanged( " + channel + ", " + (state == IChannel.STATE_OPEN ? "OPEN" : "CLOSED") + " )", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- ITracing.ID_TRACE_CHANNEL_STATE_CHANGE_LISTENER, this);
- }
-
- switch (state) {
- case IChannel.STATE_OPEN:
- IPeer peer = channel.getRemotePeer();
- if (peer != null && peer.getID() != null) {
- // Find the corresponding model node
- IPeerNode node = model.getService(IPeerModelLookupService.class).lkupPeerModelById(peer.getID());
- if (node != null) {
- // Increase the channel reference counter by 1
- int counter = node.getIntProperty(IPeerNodeProperties.PROP_CHANNEL_REF_COUNTER);
- if (counter < 0) counter = 0;
- counter++;
- node.setProperty(IPeerNodeProperties.PROP_CHANNEL_REF_COUNTER, counter);
- }
- }
- break;
- case IChannel.STATE_CLOSED:
- peer = channel.getRemotePeer();
- if (peer != null && peer.getID() != null) {
- // Find the corresponding model node
- IPeerNode node = model.getService(IPeerModelLookupService.class).lkupPeerModelById(peer.getID());
- if (node != null) {
- // Decrease the channel reference counter by 1
- int counter = node.getIntProperty(IPeerNodeProperties.PROP_CHANNEL_REF_COUNTER);
- counter--;
- if (counter < 0) counter = 0;
- node.setProperty(IPeerNodeProperties.PROP_CHANNEL_REF_COUNTER, counter);
- }
- }
- break;
- }
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/LocatorListener.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/LocatorListener.java
index 81c31c723..8df69f05a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/LocatorListener.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/LocatorListener.java
@@ -9,49 +9,30 @@
*******************************************************************************/
package org.eclipse.tcf.te.tcf.locator.listener;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
-
import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.tcf.core.AbstractPeer;
import org.eclipse.tcf.protocol.IPeer;
import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.services.ILocator;
-import org.eclipse.tcf.te.runtime.callback.Callback;
import org.eclipse.tcf.te.runtime.utils.net.IPAddressUtil;
-import org.eclipse.tcf.te.tcf.core.peers.Peer;
-import org.eclipse.tcf.te.tcf.locator.ScannerRunnable;
import org.eclipse.tcf.te.tcf.locator.activator.CoreBundleActivator;
-import org.eclipse.tcf.te.tcf.locator.interfaces.IModelListener;
import org.eclipse.tcf.te.tcf.locator.interfaces.ITracing;
-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.IPeerNodeProperties;
-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.interfaces.services.IPeerModelUpdateService;
-import org.eclipse.tcf.te.tcf.locator.nodes.PeerNode;
-import org.eclipse.tcf.te.tcf.locator.nodes.PeerRedirector;
-
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelUpdateService;
/**
* Locator listener implementation.
*/
public final class LocatorListener implements ILocator.LocatorListener {
// Reference to the parent model
- /* default */ final IPeerModel model;
+ /* default */ final ILocatorModel model;
/**
* Constructor.
*
* @param model The parent locator model. Must not be <code>null</code>.
*/
- public LocatorListener(IPeerModel model) {
+ public LocatorListener(ILocatorModel model) {
super();
Assert.isNotNull(model);
@@ -95,107 +76,20 @@ public final class LocatorListener implements ILocator.LocatorListener {
if (isFiltered(peer)) return;
if (model != null && peer != null) {
- // find the corresponding model node to remove (expected to be null)
- IPeerNode peerNode = model.getService(IPeerModelLookupService.class).lkupPeerModelById(peer.getID());
- if (peerNode == null) {
+ IPeer lkupPeer = model.getService(ILocatorModelLookupService.class).lkupPeerById(peer.getID());
+ if (lkupPeer == null) {
// Double check with "ClientID" if set
String clientID = peer.getAttributes().get("ClientID"); //$NON-NLS-1$
if (clientID != null) {
- peerNode = model.getService(IPeerModelLookupService.class).lkupPeerModelById(clientID);
+ lkupPeer = model.getService(ILocatorModelLookupService.class).lkupPeerById(clientID);
}
}
- // If not found, create a new peer node instance
- if (peerNode == null) {
- peerNode = new PeerNode(model, peer);
- // Validate the peer node before adding
- peerNode = model.validatePeerNodeForAdd(peerNode);
- // Add the peer node to the model
- if (peerNode != null) {
- // If there are reachable static peers without an agent ID associated or
- // static peers with unknown link state, refresh the agent ID's first.
- List<IPeerNode> nodes = new ArrayList<IPeerNode>();
-
- for (IPeerNode node : model.getPeerNodes()) {
- // We expect the agent ID to be set
- if (node.getPeer().getAgentID() == null || "".equals(node.getPeer().getAgentID())) { //$NON-NLS-1$
- nodes.add(node);
- }
- }
-
- // Create the runnable to execute after the agent ID refresh (if needed)
- final IPeerNode finPeerNode = peerNode;
- final IPeer finPeer = peer;
- final Runnable runnable = new Runnable() {
- @Override
- public void run() {
- IPeerNode[] matches = model.getService(IPeerModelLookupService.class).lkupMatchingStaticPeerModels(finPeerNode);
- if (matches.length == 0) {
- // If the peer node is still in the model, schedule for immediate status update
- if (model.getService(IPeerModelLookupService.class).lkupPeerModelById(finPeerNode.getPeerId()) != null) {
- Runnable runnable2 = new ScannerRunnable(model.getScanner(), finPeerNode);
- Protocol.invokeLater(runnable2);
- }
- } else {
- // Remove the preliminary added node from the model again
- model.getService(IPeerModelUpdateService.class).remove(finPeerNode);
-
- for (IPeerNode match : matches) {
- IPeer myPeer = model.validatePeer(finPeer);
- if (myPeer != null) {
- // Update the matching static node
- boolean changed = match.setChangeEventsEnabled(false);
- // Merge user configured properties between the peers
- model.getService(IPeerModelUpdateService.class).mergeUserDefinedAttributes(match, myPeer, true);
- if (changed) match.setChangeEventsEnabled(true);
- match.fireChangeEvent(IPeerNodeProperties.PROP_INSTANCE, myPeer, match.getPeer());
- // And schedule for immediate status update
- Runnable runnable2 = new ScannerRunnable(model.getScanner(), match);
- Protocol.invokeLater(runnable2);
- }
- }
- }
- }
- };
-
- // Preliminary add the node to the model now. If we have to refresh the agent ID,
- // this is an asynchronous operation and other peerAdded events might be processed before.
- model.getService(IPeerModelUpdateService.class).add(peerNode);
-
- if (nodes.size() > 0) {
- // Refresh the agent ID's first
- model.getService(IPeerModelRefreshService.class).refreshAgentIDs(nodes.toArray(new IPeerNode[nodes.size()]), new Callback() {
- @Override
- protected void internalDone(Object caller, IStatus status) {
- // Ignore errors
- runnable.run();
- }
- });
- } else {
- // No need to refresh the agent ID's -> run runnable
- runnable.run();
- }
- }
- } else {
- // Peer node found, update the peer instance
- // Validate the peer node before updating
- IPeer myPeer = model.validatePeer(peer);
- if (myPeer != null) {
- boolean changed = peerNode.setChangeEventsEnabled(false);
- // Merge user configured properties between the peers
- model.getService(IPeerModelUpdateService.class).mergeUserDefinedAttributes(peerNode, myPeer, true);
- if (changed) peerNode.setChangeEventsEnabled(true);
- peerNode.fireChangeEvent(IPeerNodeProperties.PROP_INSTANCE, myPeer, peerNode.getPeer());
- // And schedule for immediate status update
- Runnable runnable = new ScannerRunnable(model.getScanner(), peerNode);
- Protocol.invokeLater(runnable);
- }
+ if (lkupPeer == null) {
+ model.getService(ILocatorModelUpdateService.class).add(peer);
}
}
}
- // Map of guardian objects per peer
- private final Map<IPeer, AtomicBoolean> PEER_CHANGED_GUARDIANS = new HashMap<IPeer, AtomicBoolean>();
-
/* (non-Javadoc)
* @see org.eclipse.tcf.services.ILocator.LocatorListener#peerChanged(org.eclipse.tcf.protocol.IPeer)
*/
@@ -209,54 +103,21 @@ public final class LocatorListener implements ILocator.LocatorListener {
if (isFiltered(peer)) return;
- // Protect ourself from reentrant calls while processing a changed peer.
- if (peer != null) {
- AtomicBoolean guard = PEER_CHANGED_GUARDIANS.get(peer);
- if (guard != null && guard.get()) return;
- if (guard != null) guard.set(true);
- else PEER_CHANGED_GUARDIANS.put(peer, new AtomicBoolean(true));
- }
-
if (model != null && peer != null) {
// find the corresponding model node to remove
- IPeerNode peerNode = model.getService(IPeerModelLookupService.class).lkupPeerModelById(peer.getID());
- if (peerNode == null) {
+ IPeer lkupPeer = model.getService(ILocatorModelLookupService.class).lkupPeerById(peer.getID());
+ if (lkupPeer == null) {
// Double check with "ClientID" if set
String clientID = peer.getAttributes().get("ClientID"); //$NON-NLS-1$
if (clientID != null) {
- peerNode = model.getService(IPeerModelLookupService.class).lkupPeerModelById(clientID);
+ lkupPeer = model.getService(ILocatorModelLookupService.class).lkupPeerById(clientID);
}
}
// Update the peer instance
- if (peerNode != null) {
- // Get the old peer instance
- IPeer oldPeer = peerNode.getPeer();
- // If old peer and new peer instance are the same _objects_, nothing to do
- if (oldPeer != peer) {
- // Peers visible to the locator are replaced with the new instance
- if (oldPeer instanceof AbstractPeer) {
- peerNode.setProperty(IPeerNodeProperties.PROP_INSTANCE, peer);
- }
- // Non-visible peers are updated
- else {
- // Validate the peer node before updating
- IPeer myPeer = model.validatePeer(peer);
- if (myPeer != null) {
- boolean changed = peerNode.setChangeEventsEnabled(false);
- // Merge user configured properties between the peers
- model.getService(IPeerModelUpdateService.class).mergeUserDefinedAttributes(peerNode, myPeer, true);
- if (changed) peerNode.setChangeEventsEnabled(true);
- peerNode.fireChangeEvent(IPeerNodeProperties.PROP_INSTANCE, myPeer, peerNode.getPeer());
- }
- }
- }
+ if (lkupPeer != null) {
+ model.getService(ILocatorModelUpdateService.class).update(lkupPeer, peer);
}
- // Refresh static peers and merge attributes if required
- model.getService(IPeerModelRefreshService.class).refreshStaticPeers();
}
-
- // Clean up the guardians
- if (peer != null) PEER_CHANGED_GUARDIANS.remove(peer);
}
/* (non-Javadoc)
@@ -272,11 +133,11 @@ public final class LocatorListener implements ILocator.LocatorListener {
if (model != null && id != null) {
// find the corresponding model node to remove
- IPeerNode peerNode = model.getService(IPeerModelLookupService.class).lkupPeerModelById(id);
+ IPeer lkupPeer = model.getService(ILocatorModelLookupService.class).lkupPeerById(id);
// If we cannot find a model node, it is probably because the remove is sent for the
// non-loopback addresses of the localhost. We have to double check this.
- if (peerNode == null) {
+ if (lkupPeer == null) {
int beginIndex = id.indexOf(':');
int endIndex = id.lastIndexOf(':');
String ip = id.substring(beginIndex+1, endIndex);
@@ -299,73 +160,12 @@ public final class LocatorListener implements ILocator.LocatorListener {
newId.append(id.substring(endIndex + 1));
// Try the lookup again
- peerNode = model.getService(IPeerModelLookupService.class).lkupPeerModelById(newId.toString());
+ lkupPeer = model.getService(ILocatorModelLookupService.class).lkupPeerById(newId.toString());
}
// If the model node is found in the model, process the removal.
- if (peerNode != null) {
- boolean changed = peerNode.setChangeEventsEnabled(false);
- IPeer peer = peerNode.getPeer();
-
- // Create a modifiable copy of the peer attributes
- Map<String, String> attrs = new HashMap<String, String>(peerNode.getPeer().getAttributes());
- // Remember the remote peer id before removing it
- String remotePeerID = attrs.get("remote.id.transient"); //$NON-NLS-1$
-
- // Remove all merged attributes from the peer instance
- String merged = attrs.remove("remote.merged.transient"); //$NON-NLS-1$
- if (merged != null) {
- merged = merged.replace('[', ' ').replace(']', ' ').trim();
- List<String> keysToRemove = Arrays.asList(merged.split(",\\ ")); //$NON-NLS-1$
- String[] keys = attrs.keySet().toArray(new String[attrs.keySet().size()]);
- for (String key : keys) {
- if (keysToRemove.contains(key)) {
- attrs.remove(key);
- }
- }
-
- // Make sure the ID is set correctly
- if (attrs.get(IPeer.ATTR_ID) == null) {
- attrs.put(IPeer.ATTR_ID, peer.getID());
- }
-
- // Update the peer attributes
- if (peer instanceof PeerRedirector) {
- ((PeerRedirector)peer).updateAttributes(attrs);
- } else if (peer instanceof Peer) {
- ((Peer)peer).updateAttributes(attrs);
- }
- }
-
- // Remove the attributes stored at peer node level
- peerNode.setProperty(IPeerNodeProperties.PROP_LOCAL_SERVICES, null);
- peerNode.setProperty(IPeerNodeProperties.PROP_REMOTE_SERVICES, null);
-
- // Check if we have to remote the peer in the underlying locator service too
- if (remotePeerID != null) {
- Map<String, IPeer> peers = Protocol.getLocator().getPeers();
- IPeer remotePeer = peers.get(remotePeerID);
- if (remotePeer instanceof AbstractPeer) ((AbstractPeer)remotePeer).dispose();
- }
-
- // Clean out possible child nodes
- peerNode.getModel().setChildren(peerNode.getPeerId(), null);
-
- if (changed) peerNode.setChangeEventsEnabled(true);
- peerNode.fireChangeEvent(IPeerNodeProperties.PROP_INSTANCE, peer, peerNode.getPeer());
-
- final IModelListener[] listeners = model.getListener();
- if (listeners.length > 0) {
- final IPeerNode finPeerNode = peerNode;
- Protocol.invokeLater(new Runnable() {
- @Override
- public void run() {
- for (IModelListener listener : listeners) {
- listener.locatorModelChanged(model, finPeerNode, false);
- }
- }
- });
- }
+ if (lkupPeer != null) {
+ model.getService(ILocatorModelUpdateService.class).remove(lkupPeer);
}
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/ProtocolStateChangeListener.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/ProtocolStateChangeListener.java
index 4f3a46afd..cf90ec9d2 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/ProtocolStateChangeListener.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/ProtocolStateChangeListener.java
@@ -23,7 +23,7 @@ public class ProtocolStateChangeListener implements IProtocolStateChangeListener
@Override
public void stateChanged(boolean state) {
// If the TCF frame work got started, initialize the locator model as well
- if (state) Model.getModel();
+ if (state) Model.getPeerModel();
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/model/Model.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/model/Model.java
index 2af3c5844..b70b3a09a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/model/Model.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/model/Model.java
@@ -11,18 +11,62 @@ package org.eclipse.tcf.te.tcf.locator.model;
import org.eclipse.core.runtime.Assert;
import org.eclipse.tcf.protocol.Protocol;
+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.services.ILocatorModelRefreshService;
import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelRefreshService;
+import org.eclipse.tcf.te.tcf.locator.nodes.LocatorModel;
import org.eclipse.tcf.te.tcf.locator.nodes.PeerModel;
/**
- * Helper class to instantiate and initialize the TCF locator model.
+ * Helper class to instantiate and initialize the peer and locator model.
*/
public final class Model {
- // Reference to the locator model
+ // Reference to the peer model
/* default */ static volatile IPeerModel peerModel;
+ // Reference to the locator model
+ /* default */ static volatile ILocatorModel locatorModel;
+
+ /**
+ * Returns the shared peer model instance.
+ * <p>
+ * If the shared peer model instance has not been yet initialized,
+ * the method does initialize the shared peer model instance.
+ *
+ * @return The shared peer model.
+ */
+ public static IPeerModel getPeerModel() {
+ return getPeerModel(false);
+ }
+
+ /**
+ * Returns the shared peer model instance.
+ * <p>
+ * If the shared peer model instance has not been yet initialized,
+ * and <code>shutdown</code> is <code>false</code>, the method does
+ * initialize the shared peer model instance.
+ *
+ * @param shutdown <code>True</code> if the method is called during shutdown and
+ * the model should not be initialized if not done anyway. <code>
+ * false</code> in any other case.
+ *
+ * @return The shared peer model.
+ */
+ public static IPeerModel getPeerModel(boolean shutdown) {
+ // Access to the locator model must happen in the TCF dispatch thread
+ if (peerModel == null && !shutdown) {
+ Protocol.invokeAndWait(new Runnable() {
+ @Override
+ public void run() {
+ initialize();
+ }
+ });
+ }
+ return peerModel;
+ }
+
/**
* Returns the shared locator model instance.
* <p>
@@ -31,8 +75,8 @@ public final class Model {
*
* @return The shared locator model.
*/
- public static IPeerModel getModel() {
- return getModel(false);
+ public static ILocatorModel getLocatorModel() {
+ return getLocatorModel(false);
}
/**
@@ -48,21 +92,17 @@ public final class Model {
*
* @return The shared locator model.
*/
- public static IPeerModel getModel(boolean shutdown) {
+ public static ILocatorModel getLocatorModel(boolean shutdown) {
// Access to the locator model must happen in the TCF dispatch thread
- if (peerModel == null && !shutdown) {
- if (Protocol.isDispatchThread()) {
- initialize();
- } else {
- Protocol.invokeAndWait(new Runnable() {
- @Override
- public void run() {
- initialize();
- }
- });
- }
+ if (locatorModel == null && !shutdown) {
+ Protocol.invokeAndWait(new Runnable() {
+ @Override
+ public void run() {
+ initialize();
+ }
+ });
}
- return peerModel;
+ return locatorModel;
}
/**
@@ -71,37 +111,50 @@ public final class Model {
protected static void initialize() {
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- // If locator model is set in the mean while, initialize got
+ // If peer model is set in the mean while, initialize got
// called twice. Return immediately in this case.
- if (peerModel != null) return;
+ if (peerModel == null) {
+ // Create the model instance
+ peerModel = new PeerModel();
+ // Refresh the model right away
+ peerModel.getService(IPeerModelRefreshService.class).refresh(null);
+ }
- // Create the model instance
- peerModel = new PeerModel();
- // Refresh the model right away
- peerModel.getService(IPeerModelRefreshService.class).refresh(null);
- // Start the scanner
- peerModel.startScanner(5000, 120000);
+ // If locator model is set in the mean while, initialize got
+ // called twice. Return immediately in this case.
+ if (locatorModel == null) {
+ // Create the model instance
+ locatorModel = new LocatorModel();
+ // Refresh the model right away
+ locatorModel.getService(ILocatorModelRefreshService.class).refresh(null);
+ }
}
/**
* Dispose the root node.
*/
public static void dispose() {
- if (peerModel == null) return;
-
- // Access to the locator model must happen in the TCF dispatch thread
- if (Protocol.isDispatchThread()) {
- peerModel.dispose();
- } else {
+ if (peerModel != null) {
+ // Access to the peer model must happen in the TCF dispatch thread
Protocol.invokeAndWait(new Runnable() {
@Override
public void run() {
peerModel.dispose();
}
});
+ peerModel = null;
}
- peerModel = null;
+ if (locatorModel != null) {
+ // Access to the locator model must happen in the TCF dispatch thread
+ Protocol.invokeAndWait(new Runnable() {
+ @Override
+ public void run() {
+ locatorModel.dispose();
+ }
+ });
+ locatorModel = null;
+ }
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/LocatorModel.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/LocatorModel.java
new file mode 100644
index 000000000..215ea5145
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/LocatorModel.java
@@ -0,0 +1,241 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2013 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.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicReference;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.PlatformObject;
+import org.eclipse.tcf.protocol.IPeer;
+import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.services.ILocator;
+import org.eclipse.tcf.te.tcf.locator.activator.CoreBundleActivator;
+import org.eclipse.tcf.te.tcf.locator.interfaces.ITracing;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelRefreshService;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelService;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelUpdateService;
+import org.eclipse.tcf.te.tcf.locator.listener.LocatorListener;
+import org.eclipse.tcf.te.tcf.locator.services.LocatorModelLookupService;
+import org.eclipse.tcf.te.tcf.locator.services.LocatorModelRefreshService;
+import org.eclipse.tcf.te.tcf.locator.services.LocatorModelUpdateService;
+
+
+/**
+ * Default locator model implementation.
+ */
+public class LocatorModel extends PlatformObject implements ILocatorModel {
+ // The unique model id
+ private final UUID uniqueId = UUID.randomUUID();
+ // Flag to mark the model disposed
+ private boolean disposed;
+
+ // The list of known peers
+ /* default */ final Map<String, IPeer> peers = new HashMap<String, IPeer>();
+ // The list of "proxied" peers per proxy peer id
+ /* default */ final Map<String, List<IPeer>> peerChildren = new HashMap<String, List<IPeer>>();
+
+ // Reference to the model locator listener
+ private ILocator.LocatorListener locatorListener = null;
+
+ // Reference to the refresh service
+ private final ILocatorModelRefreshService refreshService = new LocatorModelRefreshService(this);
+ // Reference to the lookup service
+ private final ILocatorModelLookupService lookupService = new LocatorModelLookupService(this);
+ // Reference to the update service
+ private final ILocatorModelUpdateService updateService = new LocatorModelUpdateService(this);
+ /**
+ * Constructor.
+ */
+ public LocatorModel() {
+ super();
+ disposed = false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.tcf.locator.core.interfaces.nodes.ILocatorModel#dispose()
+ */
+ @Override
+ public void dispose() {
+ Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
+
+ if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITracing.ID_TRACE_LOCATOR_MODEL)) {
+ CoreBundleActivator.getTraceHandler().trace("PeerModel.dispose()", ITracing.ID_TRACE_LOCATOR_MODEL, this); //$NON-NLS-1$
+ }
+
+ // If already disposed, we are done immediately
+ if (disposed) return;
+
+ disposed = true;
+
+ if (locatorListener != null) {
+ Protocol.getLocator().removeListener(locatorListener);
+ locatorListener = null;
+ }
+
+ peers.clear();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.tcf.locator.core.interfaces.nodes.ILocatorModel#isDisposed()
+ */
+ @Override
+ public boolean isDisposed() {
+ return disposed;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel#getPeers()
+ */
+ @Override
+ public IPeer[] getPeers() {
+ final AtomicReference<IPeer[]> result = new AtomicReference<IPeer[]>();
+
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ result.set(peers.values().toArray(new IPeer[peers.values().size()]));
+ }
+ };
+
+ if (Protocol.isDispatchThread()) runnable.run();
+ else Protocol.invokeAndWait(runnable);
+
+ return result.get();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel#getChildren(java.lang.String)
+ */
+ @Override
+ public List<IPeer> getChildren(final String parentPeerID) {
+ Assert.isNotNull(parentPeerID);
+
+ final AtomicReference<List<IPeer>> result = new AtomicReference<List<IPeer>>();
+
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ List<IPeer> children = peerChildren.get(parentPeerID);
+ if (children == null) children = Collections.emptyList();
+ result.set(children);
+ }
+ };
+
+ if (Protocol.isDispatchThread()) runnable.run();
+ else Protocol.invokeAndWait(runnable);
+
+ return Collections.unmodifiableList(result.get());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel#setChildren(java.lang.String, java.util.List)
+ */
+ @Override
+ public void setChildren(String parentPeerID, List<IPeer> children) {
+ Assert.isNotNull(parentPeerID);
+ Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
+
+ if (children == null || children.size() == 0) {
+ peerChildren.remove(parentPeerID);
+ } else {
+ peerChildren.put(parentPeerID, new ArrayList<IPeer>(children));
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
+ */
+ @Override
+ public Object getAdapter(Class adapter) {
+ if (adapter.isAssignableFrom(ILocator.LocatorListener.class)) {
+ return locatorListener;
+ }
+ if (adapter.isAssignableFrom(ILocatorModelRefreshService.class)) {
+ return refreshService;
+ }
+ if (adapter.isAssignableFrom(ILocatorModelLookupService.class)) {
+ return lookupService;
+ }
+ if (adapter.isAssignableFrom(ILocatorModelUpdateService.class)) {
+ return updateService;
+ }
+ if (adapter.isAssignableFrom(Map.class)) {
+ return peers;
+ }
+
+ return super.getAdapter(adapter);
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ return uniqueId.hashCode();
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public final boolean equals(Object obj) {
+ if (obj instanceof LocatorModel) {
+ return uniqueId.equals(((LocatorModel)obj).uniqueId);
+ }
+ return super.equals(obj);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel#getService(java.lang.Class)
+ */
+ @Override
+ @SuppressWarnings("unchecked")
+ public <V extends ILocatorModelService> V getService(Class<V> serviceInterface) {
+ Assert.isNotNull(serviceInterface);
+ return (V)getAdapter(serviceInterface);
+ }
+
+ /**
+ * Check if the locator listener has been created and registered
+ * to the global locator service.
+ * <p>
+ * <b>Note:</b> This method is not intended to be call from clients.
+ */
+ public void checkLocatorListener() {
+ Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
+ Assert.isNotNull(Protocol.getLocator());
+
+ if (locatorListener == null) {
+ locatorListener = doCreateLocatorListener(this);
+ Protocol.getLocator().addListener(locatorListener);
+ }
+ }
+
+ /**
+ * Creates the locator listener instance.
+ *
+ * @param model The parent model. Must not be <code>null</code>.
+ * @return The locator listener instance.
+ */
+ protected ILocator.LocatorListener doCreateLocatorListener(ILocatorModel model) {
+ Assert.isNotNull(model);
+ Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
+
+ return new LocatorListener(model);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/PeerModel.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/PeerModel.java
index 594031ffd..6731388a1 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/PeerModel.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/PeerModel.java
@@ -10,7 +10,6 @@
package org.eclipse.tcf.te.tcf.locator.nodes;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -19,17 +18,11 @@ import java.util.concurrent.atomic.AtomicReference;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.tcf.protocol.IPeer;
import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.services.ILocator;
import org.eclipse.tcf.te.runtime.utils.net.IPAddressUtil;
-import org.eclipse.tcf.te.tcf.core.Tcf;
-import org.eclipse.tcf.te.tcf.core.listeners.interfaces.IChannelStateChangeListener;
-import org.eclipse.tcf.te.tcf.locator.Scanner;
import org.eclipse.tcf.te.tcf.locator.activator.CoreBundleActivator;
import org.eclipse.tcf.te.tcf.locator.interfaces.IModelListener;
-import org.eclipse.tcf.te.tcf.locator.interfaces.IScanner;
import org.eclipse.tcf.te.tcf.locator.interfaces.ITracing;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
@@ -38,8 +31,6 @@ import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelQueryService
import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelRefreshService;
import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelService;
import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelUpdateService;
-import org.eclipse.tcf.te.tcf.locator.listener.ChannelStateChangeListener;
-import org.eclipse.tcf.te.tcf.locator.listener.LocatorListener;
import org.eclipse.tcf.te.tcf.locator.services.PeerModelLookupService;
import org.eclipse.tcf.te.tcf.locator.services.PeerModelQueryService;
import org.eclipse.tcf.te.tcf.locator.services.PeerModelRefreshService;
@@ -47,7 +38,7 @@ import org.eclipse.tcf.te.tcf.locator.services.PeerModelUpdateService;
/**
- * Default locator model implementation.
+ * Default peer model implementation.
*/
public class PeerModel extends PlatformObject implements IPeerModel {
// The unique model id
@@ -56,17 +47,7 @@ public class PeerModel extends PlatformObject implements IPeerModel {
private boolean disposed;
// The list of known peers
- /* default */ final Map<String, IPeerNode> peers = new HashMap<String, IPeerNode>();
- // The list of "proxied" peers per proxy peer id
- /* default */ final Map<String, List<IPeerNode>> peerChildren = new HashMap<String, List<IPeerNode>>();
-
- // Reference to the scanner
- private IScanner scanner = null;
-
- // Reference to the model locator listener
- private ILocator.LocatorListener locatorListener = null;
- // Reference to the model channel state change listener
- private IChannelStateChangeListener channelStateChangeListener = null;
+ /* default */ final Map<String, IPeerNode> peerNodes = new HashMap<String, IPeerNode>();
// The list of registered model listeners
private final List<IModelListener> modelListener = new ArrayList<IModelListener>();
@@ -86,9 +67,6 @@ public class PeerModel extends PlatformObject implements IPeerModel {
public PeerModel() {
super();
disposed = false;
-
- channelStateChangeListener = new ChannelStateChangeListener(this);
- Tcf.addChannelStateChangeListener(channelStateChangeListener);
}
/* (non-Javadoc)
@@ -99,8 +77,8 @@ public class PeerModel extends PlatformObject implements IPeerModel {
Assert.isNotNull(listener);
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITracing.ID_TRACE_LOCATOR_MODEL)) {
- CoreBundleActivator.getTraceHandler().trace("PeerModel.addListener( " + listener + " )", ITracing.ID_TRACE_LOCATOR_MODEL, this); //$NON-NLS-1$ //$NON-NLS-2$
+ if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITracing.ID_TRACE_PEER_MODEL)) {
+ CoreBundleActivator.getTraceHandler().trace("PeerModel.addListener( " + listener + " )", ITracing.ID_TRACE_PEER_MODEL, this); //$NON-NLS-1$ //$NON-NLS-2$
}
if (!modelListener.contains(listener)) modelListener.add(listener);
@@ -114,8 +92,8 @@ public class PeerModel extends PlatformObject implements IPeerModel {
Assert.isNotNull(listener);
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITracing.ID_TRACE_LOCATOR_MODEL)) {
- CoreBundleActivator.getTraceHandler().trace("PeerModel.removeListener( " + listener + " )", ITracing.ID_TRACE_LOCATOR_MODEL, this); //$NON-NLS-1$ //$NON-NLS-2$
+ if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITracing.ID_TRACE_PEER_MODEL)) {
+ CoreBundleActivator.getTraceHandler().trace("PeerModel.removeListener( " + listener + " )", ITracing.ID_TRACE_PEER_MODEL, this); //$NON-NLS-1$ //$NON-NLS-2$
}
modelListener.remove(listener);
@@ -137,8 +115,8 @@ public class PeerModel extends PlatformObject implements IPeerModel {
public void dispose() {
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITracing.ID_TRACE_LOCATOR_MODEL)) {
- CoreBundleActivator.getTraceHandler().trace("PeerModel.dispose()", ITracing.ID_TRACE_LOCATOR_MODEL, this); //$NON-NLS-1$
+ if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITracing.ID_TRACE_PEER_MODEL)) {
+ CoreBundleActivator.getTraceHandler().trace("PeerModel.dispose()", ITracing.ID_TRACE_PEER_MODEL, this); //$NON-NLS-1$
}
// If already disposed, we are done immediately
@@ -159,22 +137,7 @@ public class PeerModel extends PlatformObject implements IPeerModel {
}
modelListener.clear();
- if (locatorListener != null) {
- Protocol.getLocator().removeListener(locatorListener);
- locatorListener = null;
- }
-
- if (channelStateChangeListener != null) {
- Tcf.removeChannelStateChangeListener(channelStateChangeListener);
- channelStateChangeListener = null;
- }
-
- if (scanner != null) {
- stopScanner();
- scanner = null;
- }
-
- peers.clear();
+ peerNodes.clear();
}
/* (non-Javadoc)
@@ -195,7 +158,7 @@ public class PeerModel extends PlatformObject implements IPeerModel {
Runnable runnable = new Runnable() {
@Override
public void run() {
- result.set(peers.values().toArray(new IPeerNode[peers.values().size()]));
+ result.set(peerNodes.values().toArray(new IPeerNode[peerNodes.values().size()]));
}
};
@@ -206,55 +169,10 @@ public class PeerModel extends PlatformObject implements IPeerModel {
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel#getChildren(java.lang.String)
- */
- @Override
- public List<IPeerNode> getChildren(final String parentPeerID) {
- Assert.isNotNull(parentPeerID);
-
- final AtomicReference<List<IPeerNode>> result = new AtomicReference<List<IPeerNode>>();
-
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- List<IPeerNode> children = peerChildren.get(parentPeerID);
- if (children == null) children = Collections.emptyList();
- result.set(children);
- }
- };
-
- if (Protocol.isDispatchThread()) runnable.run();
- else Protocol.invokeAndWait(runnable);
-
- return Collections.unmodifiableList(result.get());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel#setChildren(java.lang.String, java.util.List)
- */
- @Override
- public void setChildren(String parentPeerID, List<IPeerNode> children) {
- Assert.isNotNull(parentPeerID);
- Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
-
- if (children == null || children.size() == 0) {
- peerChildren.remove(parentPeerID);
- } else {
- peerChildren.put(parentPeerID, new ArrayList<IPeerNode>(children));
- }
- }
-
- /* (non-Javadoc)
* @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
*/
@Override
public Object getAdapter(Class adapter) {
- if (adapter.isAssignableFrom(ILocator.LocatorListener.class)) {
- return locatorListener;
- }
- if (adapter.isAssignableFrom(IScanner.class)) {
- return scanner;
- }
if (adapter.isAssignableFrom(IPeerModelRefreshService.class)) {
return refreshService;
}
@@ -268,7 +186,7 @@ public class PeerModel extends PlatformObject implements IPeerModel {
return queryService;
}
if (adapter.isAssignableFrom(Map.class)) {
- return peers;
+ return peerNodes;
}
return super.getAdapter(adapter);
@@ -303,88 +221,6 @@ public class PeerModel extends PlatformObject implements IPeerModel {
return (V)getAdapter(serviceInterface);
}
- /**
- * Check if the locator listener has been created and registered
- * to the global locator service.
- * <p>
- * <b>Note:</b> This method is not intended to be call from clients.
- */
- public void checkLocatorListener() {
- Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- Assert.isNotNull(Protocol.getLocator());
-
- if (locatorListener == null) {
- locatorListener = doCreateLocatorListener(this);
- Protocol.getLocator().addListener(locatorListener);
- }
- }
-
- /**
- * Creates the locator listener instance.
- *
- * @param model The parent model. Must not be <code>null</code>.
- * @return The locator listener instance.
- */
- protected ILocator.LocatorListener doCreateLocatorListener(IPeerModel model) {
- Assert.isNotNull(model);
- Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
-
- return new LocatorListener(model);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.core.interfaces.nodes.ILocatorModel#getScanner()
- */
- @Override
- public IScanner getScanner() {
- if (scanner == null) scanner = new Scanner(this);
- return scanner;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.core.interfaces.nodes.ILocatorModel#startScanner(long, long)
- */
- @Override
- public void startScanner(long delay, long schedule) {
- if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITracing.ID_TRACE_LOCATOR_MODEL)) {
- CoreBundleActivator.getTraceHandler().trace("PeerModel.startScanner( " + delay + ", " + schedule + " )", ITracing.ID_TRACE_LOCATOR_MODEL, this); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- IScanner scanner = getScanner();
- Assert.isNotNull(scanner);
-
- // Pass on the schedule parameter
- Map<String, Object> config = new HashMap<String, Object>(scanner.getConfiguration());
- config.put(IScanner.PROP_SCHEDULE, Long.valueOf(schedule));
- scanner.setConfiguration(config);
-
- // The default scanner implementation is a job.
- // -> schedule here if it is a job
- if (scanner instanceof Job) {
- Job job = (Job)scanner;
- job.setSystem(true);
- job.setPriority(Job.DECORATE);
- job.schedule(delay);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.core.interfaces.nodes.ILocatorModel#stopScanner()
- */
- @Override
- public void stopScanner() {
- if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITracing.ID_TRACE_LOCATOR_MODEL)) {
- CoreBundleActivator.getTraceHandler().trace("PeerModel.stopScanner()", ITracing.ID_TRACE_LOCATOR_MODEL, this); //$NON-NLS-1$
- }
-
- if (scanner != null) {
- // Terminate the scanner
- scanner.terminate();
- // Reset the scanner reference
- scanner = null;
- }
- }
-
/* (non-Javadoc)
* @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel#validatePeer(org.eclipse.tcf.protocol.IPeer)
*/
@@ -393,8 +229,8 @@ public class PeerModel extends PlatformObject implements IPeerModel {
Assert.isNotNull(peer);
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITracing.ID_TRACE_LOCATOR_MODEL)) {
- CoreBundleActivator.getTraceHandler().trace("PeerModel.validatePeer( " + peer.getID() + " )", ITracing.ID_TRACE_LOCATOR_MODEL, this); //$NON-NLS-1$ //$NON-NLS-2$
+ if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITracing.ID_TRACE_PEER_MODEL)) {
+ CoreBundleActivator.getTraceHandler().trace("PeerModel.validatePeer( " + peer.getID() + " )", ITracing.ID_TRACE_PEER_MODEL, this); //$NON-NLS-1$ //$NON-NLS-2$
}
IPeer result = peer;
@@ -410,374 +246,12 @@ public class PeerModel extends PlatformObject implements IPeerModel {
// Not loopback address -> drop the peer
result = null;
- if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITracing.ID_TRACE_LOCATOR_MODEL)) {
+ if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITracing.ID_TRACE_PEER_MODEL)) {
CoreBundleActivator.getTraceHandler().trace("PeerModel.validatePeer: local host peer but not loopback address -> peer node dropped" //$NON-NLS-1$
- , ITracing.ID_TRACE_LOCATOR_MODEL, this);
+ , ITracing.ID_TRACE_PEER_MODEL, this);
}
}
return result;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.core.interfaces.nodes.ILocatorModel#validatePeerNodeForAdd(org.eclipse.tcf.te.tcf.locator.core.interfaces.nodes.IPeerModel)
- */
- @Override
- public IPeerNode validatePeerNodeForAdd(IPeerNode node) {
- Assert.isNotNull(node);
- Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
-
- // Get the peer from the peer node
- IPeer peer = node.getPeer();
- if (peer == null) return node;
-
- // Skip static peer IP address validation
- return node;
-
-// // Skip validation if the transport type is not TCP or SSL
-// String transport = peer.getTransportName();
-// if (transport == null || !"TCP".equals(transport) && !"SSL".equals(transport)){ //$NON-NLS-1$ //$NON-NLS-2$
-// return node;
-// }
-//
-// if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITracing.ID_TRACE_LOCATOR_MODEL)) {
-// CoreBundleActivator.getTraceHandler().trace("PeerModel.validatePeerNodeForAdd( " + peer.getID() + " )", ITracing.ID_TRACE_LOCATOR_MODEL, this); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-//
-// IPeerNode result = node;
-//
-// // Get the loopback address
-// String loopback = IPAddressUtil.getInstance().getIPv4LoopbackAddress();
-// // Get the peer IP
-// String peerIP = peer.getAttributes().get(IPeer.ATTR_IP_HOST);
-//
-// // If the peer node is for local host, we ignore all peers not being
-// // associated with the loopback address.
-// if (IPAddressUtil.getInstance().isLocalHost(peerIP) && !loopback.equals(peerIP)) {
-// boolean drop = true;
-//
-// // Simulator nodes appears on local host IP addresses too, but does not have
-// // a loopback peer available. We have to check the agent ID to determine if
-// // a specific node can be dropped
-// String agentID = peer.getAgentID();
-// if (agentID != null) {
-// // Get all discovered peers
-// Map<String, IPeer> peers = Protocol.getLocator().getPeers();
-// // Sort them by agent id
-// Map<String, List<IPeer>> byAgentID = new HashMap<String, List<IPeer>>();
-//
-// for (IPeer candidate : peers.values()) {
-// if (candidate.getAgentID() == null) continue;
-//
-// List<IPeer> l = byAgentID.get(candidate.getAgentID());
-// if (l == null) {
-// l = new ArrayList<IPeer>();
-// byAgentID.put(candidate.getAgentID(), l);
-// }
-// Assert.isNotNull(l);
-// if (!l.contains(candidate)) l.add(candidate);
-// }
-//
-// // Check all peers found for the same agent ID as the current peer to validate
-// List<IPeer> candidates = byAgentID.get(agentID);
-// if (candidates != null && candidates.size() > 1) {
-// // Check if the found peers contains one with the loopback address
-// drop = false;
-// for (IPeer candidate : candidates) {
-// String ip = candidate.getAttributes().get(IPeer.ATTR_IP_HOST);
-// if (IPAddressUtil.getInstance().isLocalHost(ip) && loopback.equals(ip)) {
-// drop = true;
-// break;
-// }
-// }
-// } else {
-// // No other node for this agent ID -> do not drop the peer
-// drop = false;
-// }
-// }
-//
-//
-// if (drop) {
-// // Not loopback address -> drop the peer
-// result = null;
-//
-// if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITracing.ID_TRACE_LOCATOR_MODEL)) {
-// CoreBundleActivator.getTraceHandler().trace("PeerModel.validatePeerNodeForAdd: local host peer but not loopback address -> peer node dropped", //$NON-NLS-1$
-// ITracing.ID_TRACE_LOCATOR_MODEL, this);
-// }
-// }
-// }
-//
-// // Continue filtering if the node is not yet dropped
-// if (result != null) {
-// List<IPeerNode> previousNodes = new ArrayList<IPeerNode>();
-//
-// // Peers are filtered by agent id. Don't add the peer node if we have another peer
-// // node already having the same agent id
-// String agentId = peer.getAgentID();
-// if (agentId != null) {
-// previousNodes.addAll(Arrays.asList(getService(IPeerModelLookupService.class).lkupPeerModelByAgentId(agentId)));
-// }
-//
-// // Lookup for matching static peer nodes not found by the agent id lookup
-// IPeerNode[] candidates = getService(IPeerModelLookupService.class).lkupMatchingStaticPeerModels(peer);
-// for (IPeerNode candidate : candidates) {
-// if (!previousNodes.contains(candidate)) previousNodes.add(candidate);
-// }
-//
-// if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITracing.ID_TRACE_LOCATOR_MODEL)) {
-// CoreBundleActivator.getTraceHandler().trace("PeerModel.validatePeerNodeForAdd: agentId=" + agentId + ", Matching peer nodes " //$NON-NLS-1$ //$NON-NLS-2$
-// + (previousNodes.size() > 0 ? "found (" + previousNodes.size() +")" : "not found --> DONE") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-// , ITracing.ID_TRACE_LOCATOR_MODEL, this);
-// }
-//
-// for (IPeerNode previousNode : previousNodes) {
-// // Get the peer for the previous node
-// IPeer previousPeer = previousNode.getPeer();
-// if (previousPeer != null) {
-// // Get the IP address of the previous node
-// String previousPeerIP = previousPeer.getAttributes().get(IPeer.ATTR_IP_HOST);
-// if (IPAddressUtil.getInstance().isLocalHost(previousPeerIP) && !loopback.equals(previousPeerIP) && loopback.equals(peerIP)) {
-// // Remove the previous node from the model
-// getService(IPeerModelUpdateService.class).remove(previousNode);
-//
-// if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITracing.ID_TRACE_LOCATOR_MODEL)) {
-// CoreBundleActivator.getTraceHandler().trace("PeerModel.validatePeerNodeForAdd: Previous peer removed and replaced by new peer representing the loopback address" //$NON-NLS-1$
-// , ITracing.ID_TRACE_LOCATOR_MODEL, this);
-// }
-//
-// continue;
-// }
-//
-// // Get the ports
-// String peerPort = peer.getAttributes().get(IPeer.ATTR_IP_PORT);
-// String previousPeerPort = previousPeer.getAttributes().get(IPeer.ATTR_IP_PORT);
-//
-// if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITracing.ID_TRACE_LOCATOR_MODEL)) {
-// CoreBundleActivator.getTraceHandler().trace("PeerModel.validatePeerNodeForAdd: peerIP=" + peerIP //$NON-NLS-1$
-// + ", peerPort=" + peerPort + ", previousPeerPort=" + previousPeerPort //$NON-NLS-1$ //$NON-NLS-2$
-// , ITracing.ID_TRACE_LOCATOR_MODEL, this);
-// }
-//
-// // If the ports of the agent instances are identical,
-// // than try to find the best representation of the agent instance
-// if (peerPort != null && peerPort.equals(previousPeerPort)) {
-// // Drop the current node
-// result = null;
-//
-// if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITracing.ID_TRACE_LOCATOR_MODEL)) {
-// CoreBundleActivator.getTraceHandler().trace("PeerModel.validatePeerNodeForAdd: Previous peer node kept, new peer node dropped" //$NON-NLS-1$
-// , ITracing.ID_TRACE_LOCATOR_MODEL, this);
-// }
-//
-//
-// // Break the loop if the ports matched
-// break;
-// }
-//
-// if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITracing.ID_TRACE_LOCATOR_MODEL)) {
-// CoreBundleActivator.getTraceHandler().trace("PeerModel.validatePeerNodeForAdd: Previous peer node kept, new peer node added (Port mismatch)" //$NON-NLS-1$
-// , ITracing.ID_TRACE_LOCATOR_MODEL, this);
-// }
-// }
-// }
-// }
-//
-// return result;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel#validateChildPeerNodeForAdd(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode)
- */
- @Override
- public IPeerNode validateChildPeerNodeForAdd(final IPeerNode node) {
- Assert.isNotNull(node);
- Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
-
- if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITracing.ID_TRACE_LOCATOR_MODEL)) {
- CoreBundleActivator.getTraceHandler().trace("PeerModel.validateChildPeerNodeForAdd( " + node.getPeerId() + " )", ITracing.ID_TRACE_LOCATOR_MODEL, this); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // Determine the parent node. If null, the child node is invalid
- // and cannot be added
- final IPeerNode parent = node.getParent(IPeerNode.class);
- if (parent == null) return null;
-
- return validateChildPeerNodeForAdd(parent, node);
- }
-
- /**
- * Validates the given child peer model node in relation to the given parent peer model node
- * hierarchy.
- * <p>
- * The method is recursive.
- *
- * @param parent The parent model node. Must not be <code>null</code>.
- * @param node The child model node. Must not be <code>null</code>.
- *
- * @return The validated child peer model node, or <code>null</code>.
- */
- protected IPeerNode validateChildPeerNodeForAdd(IPeerNode parent, IPeerNode node) {
- Assert.isNotNull(parent);
- Assert.isNotNull(node);
- Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
-
- if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITracing.ID_TRACE_LOCATOR_MODEL)) {
- CoreBundleActivator.getTraceHandler().trace("PeerModel.validateChildPeerNodeForAdd( " + parent.getPeerId() + ", " + node.getPeerId() + " )", ITracing.ID_TRACE_LOCATOR_MODEL, this); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- // Validate against the given parent
- if (doValidateChildPeerNodeForAdd(parent, node) == null) {
- return null;
- }
-
- // If the parent node is child node by itself, validate the
- // child node against the parent parent node.
- if (parent.getParent(IPeerNode.class) != null) {
- IPeerNode parentParentNode = parent.getParent(IPeerNode.class);
- if (doValidateChildPeerNodeForAdd(parentParentNode, node) == null) {
- return null;
- }
-
- // And validate the child node against all child nodes of the parent parent.
- List<IPeerNode> childrenList = getChildren(parentParentNode.getPeerId());
- IPeerNode[] children = childrenList.toArray(new IPeerNode[childrenList.size()]);
- for (IPeerNode parentParentChild : children) {
- if (node.equals(parentParentChild) || parent.equals(parentParentChild)) {
- return null;
- }
- if (doValidateChildPeerNodeForAdd(parentParentChild, node) == null) {
- return null;
- }
- }
- }
-
- return node;
- }
-
- /**
- * Validates the given child peer model node in relation to the given parent peer model node.
- * <p>
- * The method is non-recursive.
- *
- * @param parent The parent model node. Must not be <code>null</code>.
- * @param node The child model node. Must not be <code>null</code>.
- *
- * @return The validated child peer model node, or <code>null</code>.
- */
- protected IPeerNode doValidateChildPeerNodeForAdd(IPeerNode parent, IPeerNode node) {
- Assert.isNotNull(parent);
- Assert.isNotNull(node);
- Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
-
- if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITracing.ID_TRACE_LOCATOR_MODEL)) {
- CoreBundleActivator.getTraceHandler().trace("PeerModel.doValidateChildPeerNodeForAdd( " + parent.getPeerId() + ", " + node.getPeerId() + " )", ITracing.ID_TRACE_LOCATOR_MODEL, this); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- // If the child node is already visible as root node, drop the child node
- String id = node.getPeerId();
- if (isRootNode(id)) {
- return null;
- }
-
- int beginIndex = id.indexOf(':');
- int endIndex = id.lastIndexOf(':');
- String ip = beginIndex != -1 && endIndex != -1 ? id.substring(beginIndex+1, endIndex) : ""; //$NON-NLS-1$
-
- // Get the loopback address
- String loopback = IPAddressUtil.getInstance().getIPv4LoopbackAddress();
- // Empty IP address means loopback
- if ("".equals(ip)) ip = loopback; //$NON-NLS-1$
-
- // If the IP is a localhost IP, try the loopback IP
- if (IPAddressUtil.getInstance().isLocalHost(ip)) {
- // Build up the new id to lookup
- StringBuilder newId = new StringBuilder();
- newId.append(id.substring(0, beginIndex));
- newId.append(':');
- newId.append(loopback);
- newId.append(':');
- newId.append(id.substring(endIndex + 1));
-
- // Try the lookup again
- if (isRootNode(newId.toString())) {
- return null;
- }
- }
-
- // Get the peer from the peer node
- IPeer peer = node.getPeer();
-
- // If the child peer represents the same agent as the parent peer,
- // drop the child peer
- String parentAgentID = parent.getPeer().getAgentID();
- if (parentAgentID != null && parentAgentID.equals(peer.getAgentID())) {
- return null;
- }
- // If the child peer represents the same agent as another child peer,
- // drop the child peer
- String agentID = node.getPeer().getAgentID();
- if (agentID != null) {
- IPeerNode[] matches = getService(IPeerModelLookupService.class).lkupPeerModelByAgentId(parent.getPeerId(), agentID);
- for (IPeerNode match : matches) {
- if (agentID.equals(match.getPeer().getAgentID())) {
- // Try to keep the peer with the real IP, filter the "127.0.0.1" peer
- if ("127.0.0.1".equals(node.getPeer().getAttributes().get(IPeer.ATTR_IP_HOST)) //$NON-NLS-1$
- && !"127.0.0.1".equals(match.getPeer().getAttributes().get(IPeer.ATTR_IP_HOST))) { //$NON-NLS-1$
- // Keep the other child node
- return null;
- }
-
- if (!"127.0.0.1".equals(node.getPeer().getAttributes().get(IPeer.ATTR_IP_HOST)) //$NON-NLS-1$
- && "127.0.0.1".equals(match.getPeer().getAttributes().get(IPeer.ATTR_IP_HOST))) { //$NON-NLS-1$
- // Keep the node
- getService(IPeerModelUpdateService.class).removeChild(match);
- }
-
- // If both nodes have a IP different from "127.0.0.1", keep the first node
- if (!"127.0.0.1".equals(node.getPeer().getAttributes().get(IPeer.ATTR_IP_HOST)) //$NON-NLS-1$
- && !"127.0.0.1".equals(match.getPeer().getAttributes().get(IPeer.ATTR_IP_HOST))) { //$NON-NLS-1$
- // Keep the other child node
- return null;
- }
- }
- }
- }
- // If the child peer's IP address and port are the same as the parent's
- // IP address and port, drop the child node
- Map<String, String> parentPeerAttributes = parent.getPeer().getAttributes();
- if (parentPeerAttributes.get(IPeer.ATTR_IP_HOST) != null && parentPeerAttributes.get(IPeer.ATTR_IP_HOST).equals(peer.getAttributes().get(IPeer.ATTR_IP_HOST))) {
- String parentPort = parentPeerAttributes.get(IPeer.ATTR_IP_PORT);
- String port = peer.getAttributes().get(IPeer.ATTR_IP_PORT);
-
- if (parentPort != null && parentPort.equals(port)) return null;
- }
-
- return node;
- }
-
- /**
- * Checks if the given peer id belongs to an already known root node
- * or to one of the discovered nodes.
- *
- * @param id The peer id. Must not be <code>null</code>.
- * @return <code>True</code> if the given id belongs to a root node, <code>false</code> otherwise.
- */
- private boolean isRootNode(String id) {
- Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- Assert.isNotNull(id);
-
- boolean isRoot = false;
-
- if (getService(IPeerModelLookupService.class).lkupPeerModelById(id) != null) {
- isRoot = true;
- } else {
- Map<String, IPeer> peers = Protocol.getLocator().getPeers();
- if (peers.containsKey(id)) {
- isRoot = true;
- }
- }
-
- return isRoot;
- }
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/persistence/GsonPeerPersistenceDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/persistence/GsonPeerPersistenceDelegate.java
index a274f8129..1b94b1e6b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/persistence/GsonPeerPersistenceDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/persistence/GsonPeerPersistenceDelegate.java
@@ -85,10 +85,10 @@ public class GsonPeerPersistenceDelegate extends GsonMapPersistenceDelegate {
String id = peer.getID();
if (id != null) {
// Lookup the id within the model
- IPeerNode peerNode = Model.getModel().getService(IPeerModelLookupService.class).lkupPeerModelById(id);
+ IPeerNode peerNode = Model.getPeerModel().getService(IPeerModelLookupService.class).lkupPeerModelById(id);
if (peerNode == null) {
// Not found in the model -> create a ghost object
- peerNode = new PeerNode(Model.getModel(), peer);
+ peerNode = new PeerNode(Model.getPeerModel(), peer);
peerNode.setProperty(IModelNode.PROPERTY_IS_GHOST, true);
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/AbstractLocatorModelService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/AbstractLocatorModelService.java
new file mode 100644
index 000000000..5650583f1
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/AbstractLocatorModelService.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2013 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.services;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.PlatformObject;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelService;
+
+
+/**
+ * Abstract locator model service base implementation.
+ */
+public abstract class AbstractLocatorModelService extends PlatformObject implements ILocatorModelService {
+ // Reference to the parent locator model
+ private final ILocatorModel locatorModel;
+
+ /**
+ * Constructor.
+ *
+ * @param parentModel The parent locator model instance. Must not be <code>null</code>.
+ */
+ public AbstractLocatorModelService(ILocatorModel parentModel) {
+ Assert.isNotNull(parentModel);
+ locatorModel = parentModel;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelService#getPeerModel()
+ */
+ @Override
+ public final ILocatorModel getLocatorModel() {
+ return locatorModel;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/LocatorModelLookupService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/LocatorModelLookupService.java
new file mode 100644
index 000000000..bd603bdab
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/LocatorModelLookupService.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2013 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.services;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.tcf.protocol.IPeer;
+import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService;
+
+
+/**
+ * Default locator model lookup service implementation.
+ */
+public class LocatorModelLookupService extends AbstractLocatorModelService implements ILocatorModelLookupService {
+
+ /**
+ * Constructor.
+ *
+ * @param parentModel The parent locator model instance. Must not be <code>null</code>.
+ */
+ public LocatorModelLookupService(ILocatorModel parentModel) {
+ super(parentModel);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService#lkupPeerById(java.lang.String)
+ */
+ @Override
+ public IPeer lkupPeerById(String id) {
+ Assert.isNotNull(id);
+ Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
+
+ IPeer node = null;
+ for (IPeer peer : getLocatorModel().getPeers()) {
+ if (id.equals(peer.getID())) {
+ node = peer;
+ break;
+ }
+ }
+
+ return node;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService#lkupPeerByAgentId(java.lang.String)
+ */
+ @Override
+ public IPeer[] lkupPeerByAgentId(String agentId) {
+ Assert.isNotNull(agentId);
+ Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
+
+ List<IPeer> nodes = new ArrayList<IPeer>();
+ for (IPeer peer : getLocatorModel().getPeers()) {
+ if (agentId.equals(peer.getAgentID())) {
+ nodes.add(peer);
+ }
+ }
+
+ return nodes.toArray(new IPeer[nodes.size()]);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService#lkupPeerByName(java.lang.String)
+ */
+ @Override
+ public IPeer[] lkupPeerByName(String name) {
+ Assert.isNotNull(name);
+ Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
+
+ List<IPeer> nodes = new ArrayList<IPeer>();
+ for (IPeer peer : getLocatorModel().getPeers()) {
+ if (name.equals(peer.getName())) {
+ nodes.add(peer);
+ }
+ }
+
+ return nodes.toArray(new IPeer[nodes.size()]);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/LocatorModelRefreshService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/LocatorModelRefreshService.java
new file mode 100644
index 000000000..399e15ad8
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/LocatorModelRefreshService.java
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2013 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.services;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.tcf.protocol.IPeer;
+import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
+import org.eclipse.tcf.te.tcf.core.Tcf;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelRefreshService;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelUpdateService;
+
+
+/**
+ * Default locator model refresh service implementation.
+ */
+public class LocatorModelRefreshService extends AbstractLocatorModelService implements ILocatorModelRefreshService {
+
+ /**
+ * Constructor.
+ *
+ * @param parentModel The parent locator model instance. Must not be <code>null</code>.
+ */
+ public LocatorModelRefreshService(ILocatorModel parentModel) {
+ super(parentModel);
+ }
+
+ /**
+ * Asynchronously invoke the callback within the TCF dispatch thread.
+ *
+ * @param callback The callback to invoke or <code>null</code>.
+ */
+ protected final void invokeCallback(final ICallback callback) {
+ Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
+
+ if (callback != null) {
+ Protocol.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+ callback.done(LocatorModelRefreshService.this, Status.OK_STATUS);
+ }
+ });
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelRefreshService#refresh(org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
+ */
+ @Override
+ public void refresh(final ICallback callback) {
+ Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
+
+ // Get the parent peer model
+ ILocatorModel model = getLocatorModel();
+
+ // If the parent model is already disposed, the service will drop out immediately
+ if (model.isDisposed()) {
+ invokeCallback(callback);
+ return;
+ }
+
+ // If the TCF framework isn't initialized yet, the service will drop out immediately
+ if (!Tcf.isRunning()) {
+ invokeCallback(callback);
+ return;
+ }
+
+ // Get the list of old children (update node instances where possible)
+ final List<IPeer> oldChildren = new ArrayList<IPeer>(Arrays.asList(model.getPeers()));
+
+ // Refresh the static peer definitions
+ processPeers(Protocol.getLocator().getPeers(), oldChildren, model);
+
+ // Invoke the callback
+ invokeCallback(callback);
+ }
+
+ /**
+ * Process the given map of peers and update the given locator model.
+ *
+ * @param peers The map of peers to process. Must not be <code>null</code>.
+ * @param oldChildren The list of old children. Must not be <code>null</code>.
+ * @param model The locator model. Must not be <code>null</code>.
+ */
+ protected void processPeers(Map<String, IPeer> peers, List<IPeer> oldChildren, ILocatorModel model) {
+ Assert.isNotNull(peers);
+ Assert.isNotNull(oldChildren);
+ Assert.isNotNull(model);
+
+ for (Entry<String, IPeer> entry : peers.entrySet()) {
+ // Get the peer instance for the current peer id
+ IPeer peer = entry.getValue();
+ // Try to find an existing peer node first
+ IPeer lkupPeer = model.getService(ILocatorModelLookupService.class).lkupPeerById(entry.getKey());
+ // And create a new one if we cannot find it
+ if (lkupPeer == null) {
+ model.getService(ILocatorModelUpdateService.class).add(peer);
+ }
+ else {
+ oldChildren.remove(peer);
+ }
+ }
+
+ if (!oldChildren.isEmpty()) {
+ for (IPeer oldPeer : oldChildren) {
+ model.getService(ILocatorModelUpdateService.class).remove(oldPeer);
+ }
+ }
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/LocatorModelUpdateService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/LocatorModelUpdateService.java
new file mode 100644
index 000000000..124660f4a
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/LocatorModelUpdateService.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * 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.services;
+
+import java.util.Map;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.tcf.protocol.IPeer;
+import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelUpdateService;
+
+
+/**
+ * Default locator model update service implementation.
+ */
+public class LocatorModelUpdateService extends AbstractLocatorModelService implements ILocatorModelUpdateService {
+
+ /**
+ * Constructor.
+ *
+ * @param parentModel The parent locator model instance. Must not be <code>null</code>.
+ */
+ public LocatorModelUpdateService(ILocatorModel parentModel) {
+ super(parentModel);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelUpdateService#add(org.eclipse.tcf.protocol.IPeer)
+ */
+ @Override
+ public void add(final IPeer peer) {
+ Assert.isNotNull(peer);
+ Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
+
+ Map<String, IPeer> peers = (Map<String, IPeer>)getLocatorModel().getAdapter(Map.class);
+ Assert.isNotNull(peers);
+ peers.put(peer.getID(), peer);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelUpdateService#remove(org.eclipse.tcf.protocol.IPeer)
+ */
+ @Override
+ public void remove(final IPeer peer) {
+ Assert.isNotNull(peer);
+ Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
+
+ Map<String, IPeer> peers = (Map<String, IPeer>)getLocatorModel().getAdapter(Map.class);
+ Assert.isNotNull(peers);
+ peers.remove(peer.getID());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelUpdateService#update(org.eclipse.tcf.protocol.IPeer, org.eclipse.tcf.protocol.IPeer)
+ */
+ @Override
+ public void update(IPeer oldPeer, IPeer newPeer) {
+ Assert.isNotNull(oldPeer);
+ Assert.isNotNull(newPeer);
+ Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
+
+ Map<String, IPeer> peers = (Map<String, IPeer>)getLocatorModel().getAdapter(Map.class);
+ Assert.isNotNull(peers);
+ peers.remove(oldPeer.getID());
+ peers.put(newPeer.getID(), newPeer);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelLookupService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelLookupService.java
index 2dbca2eef..75fcefca4 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelLookupService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelLookupService.java
@@ -22,14 +22,14 @@ import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelQueryService
/**
- * Default locator model lookup service implementation.
+ * Default peer model lookup service implementation.
*/
public class PeerModelLookupService extends AbstractPeerModelService implements IPeerModelLookupService {
/**
* Constructor.
*
- * @param parentModel The parent locator model instance. Must not be <code>null</code>.
+ * @param parentModel The parent peer model instance. Must not be <code>null</code>.
*/
public PeerModelLookupService(IPeerModel parentModel) {
super(parentModel);
@@ -60,31 +60,6 @@ public class PeerModelLookupService extends AbstractPeerModelService implements
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelLookupService#lkupPeerModelById(java.lang.String, java.lang.String)
- */
- @Override
- public IPeerNode lkupPeerModelById(String parentId, String id) {
- Assert.isNotNull(parentId);
- Assert.isNotNull(id);
- Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
-
- IPeerNode node = null;
- for (IPeerNode candidate : getPeerModel().getChildren(parentId)) {
- IPeer peer = candidate.getPeer();
- if (id.equals(peer.getID())) {
- node = candidate;
- break;
- } else if (peer.getAttributes().get("remote.id.transient") != null //$NON-NLS-1$
- && peer.getAttributes().get("remote.id.transient").equals(id)) { //$NON-NLS-1$
- node = candidate;
- break;
- }
- }
-
- return node;
- }
-
- /* (non-Javadoc)
* @see org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelLookupService#lkupPeerModelByAgentId(java.lang.String)
*/
@Override
@@ -104,26 +79,6 @@ public class PeerModelLookupService extends AbstractPeerModelService implements
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelLookupService#lkupPeerModelByAgentId(java.lang.String, java.lang.String)
- */
- @Override
- public IPeerNode[] lkupPeerModelByAgentId(String parentId, String agentId) {
- Assert.isNotNull(parentId);
- Assert.isNotNull(agentId);
- Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
-
- List<IPeerNode> nodes = new ArrayList<IPeerNode>();
- for (IPeerNode candidate : getPeerModel().getChildren(parentId)) {
- IPeer peer = candidate.getPeer();
- if (agentId.equals(peer.getAgentID())) {
- nodes.add(candidate);
- }
- }
-
- return nodes.toArray(new IPeerNode[nodes.size()]);
- }
-
- /* (non-Javadoc)
* @see org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelLookupService#lkupPeerModelByName(java.lang.String)
*/
@Override
@@ -195,53 +150,4 @@ public class PeerModelLookupService extends AbstractPeerModelService implements
return nodes.toArray(new IPeerNode[nodes.size()]);
}
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelLookupService#lkupMatchingStaticPeerModels(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode)
- */
- @Override
- public IPeerNode[] lkupMatchingStaticPeerModels(IPeerNode peerNode) {
- Assert.isNotNull(peerNode);
- Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- return lkupMatchingStaticPeerModels(peerNode.getPeer());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelLookupService#lkupMatchingStaticPeerModels(org.eclipse.tcf.protocol.IPeer)
- */
- @Override
- public IPeerNode[] lkupMatchingStaticPeerModels(IPeer peer) {
- Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
-
- List<IPeerNode> nodes = new ArrayList<IPeerNode>();
-
- if (peer != null) {
- for (IPeerNode candidate : getPeerModel().getPeerNodes()) {
- // If the agent id is available, match up the agent id first.
- if (candidate.getPeer().getAgentID() != null && candidate.getPeer().getAgentID().equals(peer.getAgentID())) {
- nodes.add(candidate);
- continue;
- }
-
- // Get the transport types. Transport type must match and must be either "TCP" or "SSL".
- String t1 = peer.getTransportName();
- String t2 = candidate.getPeer().getTransportName();
-
- if (t1 != null && t1.equals(t2) && ("TCP".equals(t1) || "SSL".equals(t1))) { //$NON-NLS-1$ //$NON-NLS-2$
- // Compare IP and Port. If they match, add the candidate to the result list
- String i1 = peer.getAttributes().get(IPeer.ATTR_IP_HOST);
- String i2 = candidate.getPeer().getAttributes().get(IPeer.ATTR_IP_HOST);
- if (i1 != null && i1.equals(i2)) {
- String p1 = peer.getAttributes().get(IPeer.ATTR_IP_PORT);
- String p2 = candidate.getPeer().getAttributes().get(IPeer.ATTR_IP_PORT);
- if (p1 != null && p1.equals(p2)) {
- nodes.add(candidate);
- }
- }
- }
- }
- }
-
- return nodes.toArray(new IPeerNode[nodes.size()]);
- }
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelQueryService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelQueryService.java
index 3e5cda423..63eef4d92 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelQueryService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelQueryService.java
@@ -30,14 +30,14 @@ import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelQueryService
import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelUpdateService;
/**
- * Default locator model peer node query service implementation.
+ * Default peer model peer node query service implementation.
*/
public class PeerModelQueryService extends AbstractPeerModelService implements IPeerModelQueryService {
/**
* Constructor.
*
- * @param parentModel The parent locator model instance. Must not be <code>null</code>.
+ * @param parentModel The parent peer model instance. Must not be <code>null</code>.
*/
public PeerModelQueryService(IPeerModel parentModel) {
super(parentModel);
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 9c6c75306..c5ab977ff 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
@@ -12,7 +12,6 @@ package org.eclipse.tcf.te.tcf.locator.services;
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
-import java.net.URI;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
@@ -23,26 +22,16 @@ import java.util.concurrent.atomic.AtomicBoolean;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
-import org.eclipse.tcf.protocol.IChannel;
import org.eclipse.tcf.protocol.IPeer;
-import org.eclipse.tcf.protocol.IToken;
import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.services.ILocator;
-import org.eclipse.tcf.te.runtime.callback.AsyncCallbackCollector;
-import org.eclipse.tcf.te.runtime.callback.Callback;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
import org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistableNodeProperties;
import org.eclipse.tcf.te.runtime.persistence.interfaces.IURIPersistenceService;
import org.eclipse.tcf.te.runtime.services.ServiceManager;
-import org.eclipse.tcf.te.runtime.utils.net.IPAddressUtil;
import org.eclipse.tcf.te.tcf.core.Tcf;
-import org.eclipse.tcf.te.tcf.core.async.CallbackInvocationDelegate;
-import org.eclipse.tcf.te.tcf.core.interfaces.IChannelManager;
import org.eclipse.tcf.te.tcf.core.peers.Peer;
-import org.eclipse.tcf.te.tcf.locator.ScannerRunnable;
import org.eclipse.tcf.te.tcf.locator.activator.CoreBundleActivator;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
@@ -57,14 +46,14 @@ import org.eclipse.tcf.te.tcf.locator.nodes.PeerRedirector;
/**
- * Default locator model refresh service implementation.
+ * Default peer model refresh service implementation.
*/
public class PeerModelRefreshService extends AbstractPeerModelService implements IPeerModelRefreshService {
/**
* Constructor.
*
- * @param parentModel The parent locator model instance. Must not be <code>null</code>.
+ * @param parentModel The parent peer model instance. Must not be <code>null</code>.
*/
public PeerModelRefreshService(IPeerModel parentModel) {
super(parentModel);
@@ -95,7 +84,7 @@ public class PeerModelRefreshService extends AbstractPeerModelService implements
public void refresh(final ICallback callback) {
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- // Get the parent locator model
+ // Get the parent peer model
IPeerModel model = getPeerModel();
// If the parent model is already disposed, the service will drop out immediately
@@ -116,34 +105,16 @@ public class PeerModelRefreshService extends AbstractPeerModelService implements
// Refresh the static peer definitions
refreshStaticPeers(oldChildren, model);
-// // Get the locator service
-// ILocator locatorService = Protocol.getLocator();
-// if (locatorService != null) {
-// // Check for the locator listener to be created and registered
-// if (model instanceof PeerModel) {
-// ((PeerModel)model).checkLocatorListener();
-// }
-// // Get the map of peers known to the locator service.
-// Map<String, IPeer> peers = locatorService.getPeers();
-// // Process the peers
-// processPeers(peers, oldChildren, model);
-// }
-
- // If there are remaining old children, remove them from the model (non-recursive)
- for (IPeerNode oldChild : oldChildren) {
- model.getService(IPeerModelUpdateService.class).remove(oldChild);
- }
-
// Invoke the callback
invokeCallback(callback);
}
/**
- * Process the given map of peers and update the given locator model.
+ * Process the given map of peers and update the given peer model.
*
* @param peers The map of peers to process. Must not be <code>null</code>.
* @param oldChildren The list of old children. Must not be <code>null</code>.
- * @param model The locator model. Must not be <code>null</code>.
+ * @param model The peer model. Must not be <code>null</code>.
*/
protected void processPeers(Map<String, IPeer> peers, List<IPeerNode> oldChildren, IPeerModel model) {
Assert.isNotNull(peers);
@@ -158,102 +129,27 @@ public class PeerModelRefreshService extends AbstractPeerModelService implements
// And create a new one if we cannot find it
if (peerNode == null) {
peerNode = new PeerNode(model, peer);
+ model.getService(IPeerModelUpdateService.class).add(peerNode);
}
else {
oldChildren.remove(peerNode);
}
if (peerNode.getPeer() != peer) {
- String value = peerNode.getPeer().getAttributes().get(IPersistableNodeProperties.PROPERTY_URI);
- URI uri = value != null ? URI.create(value) : null;
- File file = uri != null && "file".equals(uri.getScheme()) ? new File(uri.normalize()) : null; //$NON-NLS-1$
- if (file != null && !file.exists()) {
- peerNode.setProperty(IPeerNodeProperties.PROP_INSTANCE, peer);
- } else {
- // Merge user configured properties between the peers
- model.getService(IPeerModelUpdateService.class).mergeUserDefinedAttributes(peerNode, peer, false);
- }
+ peerNode.setProperty(IPeerNodeProperties.PROP_INSTANCE, peer);
}
+ }
- // Validate the peer node before adding
- peerNode = model.validatePeerNodeForAdd(peerNode);
- if (peerNode != null) {
- // There is still the chance that the node we add is a static node and
- // there exist an dynamically discovered node with a different id but
- // for the same peer. Do this check only if the peer to add is a static one.
- IPeerNode toRemove = null;
- for (IPeerNode candidate : model.getPeerNodes()) {
- if (candidate.equals(peerNode))continue;
- String peerID = peerNode.getPeerId();
- String clientID = candidate.getPeer().getAttributes().get("ClientID"); //$NON-NLS-1$
- if (clientID != null && clientID.equals(peerID)) {
- // Merge user configured properties between the peers
- model.getService(IPeerModelUpdateService.class).mergeUserDefinedAttributes(candidate, peerNode.getPeer(), true);
- peerNode = null;
- break;
- }
-
- if (peerNode.getPeer().getTransportName() != null && peerNode.getPeer().getTransportName().equals(candidate.getPeer().getTransportName())) {
- // Same transport name
- if ("PIPE".equals(candidate.getPeer().getTransportName())) { //$NON-NLS-1$
- // Compare the pipe name
- String name1 = peerNode.getPeer().getAttributes().get("PipeName"); //$NON-NLS-1$
- String name2 = candidate.getPeer().getAttributes().get("PipeName"); //$NON-NLS-1$
- // Same pipe -> same node
- if (name1 != null && name1.equals(name2)) {
- // Merge user configured properties between the peers
- model.getService(IPeerModelUpdateService.class).mergeUserDefinedAttributes(peerNode, candidate.getPeer(), true);
- toRemove = candidate;
- break;
- }
- } else if ("Loop".equals(candidate.getPeer().getTransportName())) { //$NON-NLS-1$
- // Merge user configured properties between the peers
- model.getService(IPeerModelUpdateService.class).mergeUserDefinedAttributes(peerNode, candidate.getPeer(), true);
- toRemove = candidate;
- break;
- } else {
- // Compare IP_HOST and IP_Port;
- String ip1 = peerNode.getPeer().getAttributes().get(IPeer.ATTR_IP_HOST);
- String ip2 = candidate.getPeer().getAttributes().get(IPeer.ATTR_IP_HOST);
- if (IPAddressUtil.getInstance().isSameHost(ip1, ip2)) {
- // Compare the ports
- String port1 = peerNode.getPeer().getAttributes().get(IPeer.ATTR_IP_PORT);
- String port2 = candidate.getPeer().getAttributes().get(IPeer.ATTR_IP_PORT);
-
- if (port1 != null && port1.equals(port2)) {
- // Merge user configured properties between the peers
- model.getService(IPeerModelUpdateService.class).mergeUserDefinedAttributes(peerNode, candidate.getPeer(), true);
- toRemove = candidate;
- break;
- }
- }
- }
- }
- }
-
- if (toRemove != null) {
- model.getService(IPeerModelUpdateService.class).remove(toRemove);
- toRemove = null;
- }
-
- if (peerNode != null) {
- // Add the peer node to model
- model.getService(IPeerModelUpdateService.class).add(peerNode);
- // And schedule for immediate status update
- Runnable runnable = new ScannerRunnable(model.getScanner(), peerNode);
- Protocol.invokeLater(runnable);
- }
- }
+ if (!oldChildren.isEmpty()) {
+ for (IPeerNode oldPeerNode : oldChildren) {
+ model.getService(IPeerModelUpdateService.class).remove(oldPeerNode);
+ }
}
}
private final AtomicBoolean REFRESH_STATIC_PEERS_GUARD = new AtomicBoolean(false);
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelRefreshService#refreshStaticPeers()
- */
- @Override
- public void refreshStaticPeers() {
+ protected void refreshStaticPeers() {
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
// This method might be called reentrant while processing. Return immediately
@@ -263,7 +159,7 @@ public class PeerModelRefreshService extends AbstractPeerModelService implements
}
REFRESH_STATIC_PEERS_GUARD.set(true);
- // Get the parent locator model
+ // Get the parent peer model
IPeerModel model = getPeerModel();
// If the parent model is already disposed, the service will drop out immediately
@@ -284,7 +180,7 @@ public class PeerModelRefreshService extends AbstractPeerModelService implements
* Refresh the static peer definitions.
*
* @param oldChildren The list of old children. Must not be <code>null</code>.
- * @param model The locator model. Must not be <code>null</code>.
+ * @param model The peer model. Must not be <code>null</code>.
*/
protected void refreshStaticPeers(List<IPeerNode> oldChildren, IPeerModel model) {
Assert.isNotNull(oldChildren);
@@ -304,8 +200,7 @@ public class PeerModelRefreshService extends AbstractPeerModelService implements
@Override
public boolean accept(File pathname) {
IPath path = new Path(pathname.getAbsolutePath());
- return path.getFileExtension() != null &&
- (path.getFileExtension().toLowerCase().equals("json") || path.getFileExtension().toLowerCase().equals("peer")); //$NON-NLS-1$ //$NON-NLS-2$
+ return path.getFileExtension() != null && path.getFileExtension().toLowerCase().equals("peer"); //$NON-NLS-1$
}
});
// If there are ini files to read, process them
@@ -320,8 +215,6 @@ public class PeerModelRefreshService extends AbstractPeerModelService implements
// Remember the file path within the properties
attrs.put(IPersistableNodeProperties.PROPERTY_URI, candidate.getAbsoluteFile().toURI().toString());
- // Mark the node as static peer model node
- attrs.put("static.transient", "true"); //$NON-NLS-1$ //$NON-NLS-2$
// Validate the name attribute. If not set, set
// it to the file name without the .ini extension.
@@ -418,26 +311,6 @@ public class PeerModelRefreshService extends AbstractPeerModelService implements
if (!peers.isEmpty()) {
processPeers(peers, oldChildren, model);
}
-
- // Scan the peers for redirected ones ... and set up the peer model association
- for (Entry<String, IPeer> entry : peers.entrySet()) {
- IPeer peer = entry.getValue();
- if (!(peer instanceof PeerRedirector)) {
- continue;
- }
-
- // Get the peers peer model object
- IPeerNode peerNode = model.getService(IPeerModelLookupService.class).lkupPeerModelById(entry.getKey());
- Assert.isNotNull(peerNode);
-
- // The peer is a peer redirector -> get the proxy peer id and proxy peer model
- String proxyPeerId = ((PeerRedirector)peer).getParent().getID();
- IPeerNode proxy = model.getService(IPeerModelLookupService.class).lkupPeerModelById(proxyPeerId);
- Assert.isNotNull(proxy);
-
- peerNode.setParent(proxy);
- model.getService(IPeerModelUpdateService.class).addChild(peerNode);
- }
}
}
@@ -475,125 +348,4 @@ public class PeerModelRefreshService extends AbstractPeerModelService implements
return rootLocations.toArray(new File[rootLocations.size()]);
}
-
- /* default */ final List<ICallback> refreshAgentIDCallbacks = new ArrayList<ICallback>();
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelRefreshService#refreshAgentIDs(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode[], org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
- */
- @Override
- public void refreshAgentIDs(IPeerNode[] nodes, final ICallback callback) {
- Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
-
- // This method might be called reentrant while processing. Add
- // the callback to the "wait" list and return immediately.
- if (refreshAgentIDCallbacks.size() > 0) {
- refreshAgentIDCallbacks.add(callback);
- return;
- }
- refreshAgentIDCallbacks.add(callback);
-
- // Get the parent locator model
- IPeerModel model = getPeerModel();
-
- // If the parent model is already disposed, the service will drop out immediately
- if (model.isDisposed()) {
- return;
- }
-
- // The callback collector will fire once all static peers have been refreshed
- final AsyncCallbackCollector collector = new AsyncCallbackCollector(new Callback() {
- @Override
- protected void internalDone(Object caller, IStatus status) {
- // Make a copy of the callbacks to invoke
- List<ICallback> callbacks = new ArrayList<ICallback>(refreshAgentIDCallbacks);
- refreshAgentIDCallbacks.clear();
- // And invoke the final callbacks
- for (ICallback callback : callbacks) {
- invokeCallback(callback);
- }
- }
- }, new CallbackInvocationDelegate());
-
- // Make a copy of the current list of static peers before processing
- List<IPeerNode> nodesToProcess = new ArrayList<IPeerNode>(Arrays.asList(nodes != null ? nodes : model.getPeerNodes()));
- // Loop the list of static peers and try to get the agent ID
- for (IPeerNode node : nodesToProcess) {
- // If not static or not complete --> ignore
- if (!node.isComplete()) continue;
- // Refresh the agent ID
- refreshAgentID(node, new AsyncCallbackCollector.SimpleCollectorCallback(collector));
- }
-
- // Mark the collector initialization as done
- collector.initDone();
- }
-
- /**
- * Refreshes the agent ID of the given static peer node, if reachable.
- *
- * @param node The peer model node. Must not be <code>null</code>.
- * @param callback The callback. Must not be <code>null</code>.
- */
- protected void refreshAgentID(final IPeerNode node, final ICallback callback) {
- Assert.isNotNull(node);
- Assert.isNotNull(callback);
-
- if (!(node.getPeer() instanceof Peer)) return;
-
- // Try to open a channel to the node
- Map<String, Boolean> flags = new HashMap<String, Boolean>();
- flags.put(IChannelManager.FLAG_FORCE_NEW, Boolean.TRUE);
- flags.put(IChannelManager.FLAG_NO_VALUE_ADD, Boolean.TRUE);
-
- Tcf.getChannelManager().openChannel(node.getPeer(), flags, new IChannelManager.DoneOpenChannel() {
-
- @Override
- public void doneOpenChannel(Throwable error, final IChannel channel) {
- if (channel != null && channel.getState() == IChannel.STATE_OPEN) {
- // Get the locator service
- ILocator service = channel.getRemoteService(ILocator.class);
- if (service != null) {
- // Query the agent ID
- service.getAgentID(new ILocator.DoneGetAgentID() {
- @Override
- public void doneGetAgentID(IToken token, Exception error, String agentID) {
- // Close the channel
- Tcf.getChannelManager().closeChannel(channel);
-
- // Update the peer
- if (agentID == null || "".equals(agentID)) { //$NON-NLS-1$
- if (node.getPeer().getAgentID() != null) {
- // Remove the old agent ID
- Map<String, String> attrs = new HashMap<String, String>(channel.getRemotePeer().getAttributes());
- attrs.remove(IPeer.ATTR_AGENT_ID);
- node.setProperty(IPeerNodeProperties.PROP_INSTANCE, new Peer(attrs));
- }
- } else if (node.getPeer().getAgentID() == null || !agentID.equals(node.getPeer().getAgentID())){
- // Set the new agent ID
- Map<String, String> attrs = new HashMap<String, String>(channel.getRemotePeer().getAttributes());
- attrs.put(IPeer.ATTR_AGENT_ID, agentID);
- node.setProperty(IPeerNodeProperties.PROP_INSTANCE, new Peer(attrs));
- }
-
- // Invoke the callback
- callback.done(PeerModelRefreshService.this, Status.OK_STATUS);
- }
- });
- } else {
- // Close the channel
- Tcf.getChannelManager().closeChannel(channel);
- // Invoke the callback
- callback.done(PeerModelRefreshService.this, Status.OK_STATUS);
- }
- } else {
- // Close the channel in any case
- if (channel != null) Tcf.getChannelManager().closeChannel(channel);
- // Invoke the callback
- callback.done(PeerModelRefreshService.this, Status.OK_STATUS);
- }
-
- }
- });
- }
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelUpdateService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelUpdateService.java
index 0f4684ca4..53651c041 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelUpdateService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelUpdateService.java
@@ -9,34 +9,26 @@
*******************************************************************************/
package org.eclipse.tcf.te.tcf.locator.services;
-import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
import java.util.Map;
import org.eclipse.core.runtime.Assert;
-import org.eclipse.tcf.protocol.IPeer;
import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistableNodeProperties;
-import org.eclipse.tcf.te.tcf.core.peers.Peer;
-import org.eclipse.tcf.te.tcf.locator.interfaces.IModelListener;
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.IPeerNodeProperties;
import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelUpdateService;
-import org.eclipse.tcf.te.tcf.locator.nodes.PeerRedirector;
/**
- * Default locator model update service implementation.
+ * Default peer model update service implementation.
*/
public class PeerModelUpdateService extends AbstractPeerModelService implements IPeerModelUpdateService {
/**
* Constructor.
*
- * @param parentModel The parent locator model instance. Must not be <code>null</code>.
+ * @param parentModel The parent peer model instance. Must not be <code>null</code>.
*/
public PeerModelUpdateService(IPeerModel parentModel) {
super(parentModel);
@@ -46,52 +38,26 @@ public class PeerModelUpdateService extends AbstractPeerModelService implements
* @see org.eclipse.tcf.te.tcf.locator.core.interfaces.services.ILocatorModelUpdateService#add(org.eclipse.tcf.te.tcf.locator.core.interfaces.nodes.IPeerModel)
*/
@Override
- public void add(final IPeerNode peer) {
- Assert.isNotNull(peer);
+ public void add(final IPeerNode peerNode) {
+ Assert.isNotNull(peerNode);
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- Map<String, IPeerNode> peers = (Map<String, IPeerNode>)getPeerModel().getAdapter(Map.class);
- Assert.isNotNull(peers);
- peers.put(peer.getPeerId(), peer);
-
- final IModelListener[] listeners = getPeerModel().getListener();
- if (listeners.length > 0) {
- Protocol.invokeLater(new Runnable() {
- @Override
- public void run() {
- for (IModelListener listener : listeners) {
- listener.locatorModelChanged(getPeerModel(), peer, true);
- }
- }
- });
- }
+ Map<String, IPeerNode> peerNodes = (Map<String, IPeerNode>)getPeerModel().getAdapter(Map.class);
+ Assert.isNotNull(peerNodes);
+ peerNodes.put(peerNode.getPeerId(), peerNode);
}
/* (non-Javadoc)
* @see org.eclipse.tcf.te.tcf.locator.core.interfaces.services.ILocatorModelUpdateService#remove(org.eclipse.tcf.te.tcf.locator.core.interfaces.nodes.IPeerModel)
*/
@Override
- public void remove(final IPeerNode peer) {
- Assert.isNotNull(peer);
+ public void remove(final IPeerNode peerNode) {
+ Assert.isNotNull(peerNode);
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- Map<String, IPeerNode> peers = (Map<String, IPeerNode>)getPeerModel().getAdapter(Map.class);
- Assert.isNotNull(peers);
- peers.remove(peer.getPeerId());
-
- getPeerModel().setChildren(peer.getPeerId(), null);
-
- final IModelListener[] listeners = getPeerModel().getListener();
- if (listeners.length > 0) {
- Protocol.invokeLater(new Runnable() {
- @Override
- public void run() {
- for (IModelListener listener : listeners) {
- listener.locatorModelChanged(getPeerModel(), peer, false);
- }
- }
- });
- }
+ Map<String, IPeerNode> peerNodes = (Map<String, IPeerNode>)getPeerModel().getAdapter(Map.class);
+ Assert.isNotNull(peerNodes);
+ peerNodes.remove(peerNode.getPeerId());
}
/* (non-Javadoc)
@@ -122,138 +88,4 @@ public class PeerModelUpdateService extends AbstractPeerModelService implements
return buffer.trim();
}
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelUpdateService#addChild(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode)
- */
- @Override
- public void addChild(final IPeerNode child) {
- Assert.isNotNull(child);
- Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
-
- // Determine the parent node
- final IPeerNode parent = child.getParent(IPeerNode.class);
- if (parent == null) return;
-
- // Determine the peer id of the parent
- String parentPeerId = parent.getPeerId();
- Assert.isNotNull(parentPeerId);
-
- // Get the list of existing children
- List<IPeerNode> children = new ArrayList<IPeerNode>(getPeerModel().getChildren(parentPeerId));
- if (!children.contains(child)) {
- children.add(child);
- getPeerModel().setChildren(parentPeerId, children);
- }
-
- // Notify listeners
- parent.fireChangeEvent("changed", null, children); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelUpdateService#removeChild(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode)
- */
- @Override
- public void removeChild(final IPeerNode child) {
- Assert.isNotNull(child);
- Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
-
- // Determine the parent node
- final IPeerNode parent = child.getParent(IPeerNode.class);
- if (parent == null) return;
-
- // Determine the peer id of the parent
- String parentPeerId = parent.getPeerId();
- Assert.isNotNull(parentPeerId);
-
- // Get the list of existing children
- List<IPeerNode> children = new ArrayList<IPeerNode>(getPeerModel().getChildren(parentPeerId));
- if (children.contains(child)) {
- children.remove(child);
- getPeerModel().setChildren(parentPeerId, children);
- }
-
- // Notify listeners
- parent.fireChangeEvent("changed", null, children); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelUpdateService#mergeUserDefinedAttributes(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode, org.eclipse.tcf.protocol.IPeer, boolean)
- */
- @Override
- public void mergeUserDefinedAttributes(IPeerNode node, IPeer peer, boolean force) {
- Assert.isNotNull(node);
- Assert.isNotNull(peer);
- Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
-
- // We can merge the peer attributes only if the destination peer is a AbstractPeer
- IPeer dst = node.getPeer();
- // If not of correct type, than we cannot update the attributes
- if (!(dst instanceof PeerRedirector) && !(dst instanceof Peer)) return;
- // If destination and source peer are the same objects(!) nothing to do here
- if (dst == peer) return;
-
- // If not forced, the peer id's of both attribute maps must be the same
- if (!force) Assert.isTrue(dst.getID().equals(peer.getID())
- || (dst.getAttributes().get("remote.id.transient") != null && dst.getAttributes().get("remote.id.transient").equals(peer.getID()))); //$NON-NLS-1$ //$NON-NLS-2$
-
- // Get a modifiable copy of the destination peer attributes
- Map<String, String> dstAttrs = new HashMap<String, String>(dst.getAttributes());
-
- // Get a modifiable copy of the source peer attributes
- Map<String, String> srcAttrs = new HashMap<String, String>(peer.getAttributes());
-
- // Remove the URI from the destination if requested
- boolean removeURI = srcAttrs.containsKey(IPersistableNodeProperties.PROPERTY_URI + ".remove"); //$NON-NLS-1$
- removeURI = removeURI ? Boolean.parseBoolean(srcAttrs.remove(IPersistableNodeProperties.PROPERTY_URI + ".remove")) : false; //$NON-NLS-1$
- if (removeURI) dstAttrs.remove(IPersistableNodeProperties.PROPERTY_URI);
-
- // Determine the peer class
- String peerClassSimpleName = peer.getClass().getSimpleName();
- if (peer.getAttributes().containsKey("remote.transient")) { //$NON-NLS-1$
- peerClassSimpleName = "RemotePeer"; //$NON-NLS-1$
- }
-
- // If the source is a RemotePeer and the destination not, attributes from
- // the remote peer overwrites local attributes.
- if ("RemotePeer".equals(peerClassSimpleName) && !"RemotePeer".equals(dst.getClass().getSimpleName())) { //$NON-NLS-1$ //$NON-NLS-2$
- // The ID is not merged from remote to local
- srcAttrs.remove(IPeer.ATTR_ID);
- // The Name is not merged from remote to local
- srcAttrs.remove(IPeer.ATTR_NAME);
-
- // Eliminate all attributes already set in the destination attributes map
- String merged = dstAttrs.get("remote.merged.transient"); //$NON-NLS-1$
- for (String key : dstAttrs.keySet()) {
- if (merged == null || !merged.contains(key)) {
- srcAttrs.remove(key);
- }
- }
- }
-
- // Mark the peer as a remote peer and remember the remote peer id
- if ("RemotePeer".equals(peerClassSimpleName) && !"RemotePeer".equals(dst.getClass().getSimpleName())) { //$NON-NLS-1$ //$NON-NLS-2$
- srcAttrs.put("remote.transient", Boolean.TRUE.toString()); //$NON-NLS-1$
- srcAttrs.put("remote.id.transient", peer.getID()); //$NON-NLS-1$
- srcAttrs.put("remote.merged.transient", srcAttrs.keySet().toString()); //$NON-NLS-1$
- }
-
- // Copy all remaining attributes from source to destination
- if (!srcAttrs.isEmpty()) {
- dstAttrs.putAll(srcAttrs);
- }
-
- // If the ID's are different between the peers to merge and force is set,
- // we have set the ID in dstAttrs to the original one as set in the destination peer.
- if (force && !dst.getID().equals(dstAttrs.get(IPeer.ATTR_ID))) {
- dstAttrs.put(IPeer.ATTR_ID, dst.getID());
- }
-
- // And update the destination peer attributes
- if (dst instanceof PeerRedirector) {
- ((PeerRedirector)dst).updateAttributes(dstAttrs);
- } else if (dst instanceof Peer) {
- ((Peer)dst).updateAttributes(dstAttrs);
- }
- }
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/SignalPeerDisconnectedStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/SignalPeerDisconnectedStep.java
deleted file mode 100644
index f29164fca..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/SignalPeerDisconnectedStep.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 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.steps;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-import org.eclipse.tcf.te.tcf.locator.interfaces.IModelListener;
-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.model.Model;
-
-/**
- * Signal peer disconnected step.
- */
-public class SignalPeerDisconnectedStep extends AbstractPeerNodeStep {
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStep#validateExecute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public void validateExecute(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStep#execute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
- */
- @Override
- public void execute(final IStepContext context, final IPropertiesContainer data, final IFullQualifiedId fullQualifiedId, final IProgressMonitor monitor, final ICallback callback) {
- Assert.isNotNull(context);
- Assert.isNotNull(data);
- Assert.isNotNull(fullQualifiedId);
- Assert.isNotNull(monitor);
- Assert.isNotNull(callback);
-
- final IPeerNode peerNode = getActivePeerModelContext(context, data, fullQualifiedId);
- if (peerNode != null) {
- Protocol.invokeLater(new Runnable() {
- @Override
- public void run() {
- IPeerModel model = Model.getModel();
- for (IModelListener listener : model.getListener()) {
- listener.locatorModelChanged(model, peerNode, false);
- }
- callback.done(SignalPeerDisconnectedStep.this, Status.OK_STATUS);
- }
- });
- }
- }
-
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/WaitForReadyStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/WaitForReadyStep.java
index f1c79cc7a..8530a59a0 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/WaitForReadyStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/WaitForReadyStep.java
@@ -10,6 +10,9 @@
package org.eclipse.tcf.te.tcf.locator.steps;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
import java.util.concurrent.TimeoutException;
import org.eclipse.core.runtime.CoreException;
@@ -28,6 +31,7 @@ import org.eclipse.tcf.te.runtime.utils.StatusHelper;
import org.eclipse.tcf.te.tcf.core.Tcf;
import org.eclipse.tcf.te.tcf.core.interfaces.IChannelManager;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelUpdateService;
import org.eclipse.tcf.te.tcf.locator.nls.Messages;
/**
@@ -85,10 +89,26 @@ public class WaitForReadyStep extends AbstractPeerNodeStep {
}
// Close the channel right away
- if (channel != null) Tcf.getChannelManager().closeChannel(channel);
+// if (channel != null) Tcf.getChannelManager().closeChannel(channel);
// If we have an OK status, we are done
if (status != null && status.isOK()) {
+ // Get the local service
+ List<String> localServices = new ArrayList<String>(channel.getLocalServices());
+ // Get the remote services
+ List<String> remoteServices = new ArrayList<String>(channel.getRemoteServices());
+
+ // Close the channel
+ Tcf.getChannelManager().closeChannel(channel);
+
+ // Sort the service lists
+ Collections.sort(localServices);
+ Collections.sort(remoteServices);
+
+ // Update the services
+ IPeerModelUpdateService updateService = peerNode.getModel().getService(IPeerModelUpdateService.class);
+ updateService.updatePeerServices(peerNode, localServices, remoteServices);
+
callback(data, fullQualifiedId, callback, status, null);
return;
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/activator/CoreBundleActivator.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/activator/CoreBundleActivator.java
index 855302f66..4ed4c1d8e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/activator/CoreBundleActivator.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/activator/CoreBundleActivator.java
@@ -88,7 +88,7 @@ public class CoreBundleActivator extends Plugin {
public void run() {
if (listener == null) return;
// Register the model listener with the locator model
- Model.getModel().addListener(listener);
+ Model.getPeerModel().addListener(listener);
}
};
@@ -108,7 +108,7 @@ public class CoreBundleActivator extends Plugin {
Runnable runnable = new Runnable() {
@Override
public void run() {
- IPeerModel model = Model.getModel(true);
+ IPeerModel model = Model.getPeerModel(true);
if (model != null) model.removeListener(listener);
listener = null;
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.services.contexts/src/org/eclipse/tcf/te/tcf/services/contexts/internal/AdapterFactory.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.services.contexts/src/org/eclipse/tcf/te/tcf/services/contexts/internal/AdapterFactory.java
index 77d4174f0..8e837f2c2 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.services.contexts/src/org/eclipse/tcf/te/tcf/services/contexts/internal/AdapterFactory.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.services.contexts/src/org/eclipse/tcf/te/tcf/services/contexts/internal/AdapterFactory.java
@@ -55,7 +55,7 @@ public class AdapterFactory implements IAdapterFactory {
Runnable runnable = new Runnable() {
@Override
public void run() {
- Model.getModel().addListener(listener);
+ Model.getPeerModel().addListener(listener);
}
};
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui/src/org/eclipse/tcf/te/tcf/terminals/ui/launcher/TerminalsMementoHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui/src/org/eclipse/tcf/te/tcf/terminals/ui/launcher/TerminalsMementoHandler.java
index cffd6ed86..c8211cad4 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui/src/org/eclipse/tcf/te/tcf/terminals/ui/launcher/TerminalsMementoHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui/src/org/eclipse/tcf/te/tcf/terminals/ui/launcher/TerminalsMementoHandler.java
@@ -66,7 +66,7 @@ public class TerminalsMementoHandler implements IMementoHandler {
final String peerID = memento.getString("peerID"); //$NON-NLS-1$
if (peerID != null) {
- final IPeerModel model = Model.getModel();
+ final IPeerModel model = Model.getPeerModel();
Assert.isNotNull(model);
final AtomicReference<IPeerNode> peerNode = new AtomicReference<IPeerNode>();
Runnable runnable = new Runnable() {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeersSubMenuAction.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeersSubMenuAction.java
index 63fcb819f..7ca72e643 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeersSubMenuAction.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeersSubMenuAction.java
@@ -63,7 +63,7 @@ public class PeersSubMenuAction extends Action implements IMenuCreator, IViewAct
public void locatorModelChanged(IPeerModel model, IPeerNode peer, boolean added) {
// Re-evaluate the enablement
if (actionProxy != null) {
- final IPeerNode[] peers = Model.getModel().getPeerNodes();
+ final IPeerNode[] peers = Model.getPeerModel().getPeerNodes();
actionProxy.setEnabled(peers != null && peers.length > 0);
// If the peer is not set to the view yet, but the action get's
@@ -83,7 +83,7 @@ public class PeersSubMenuAction extends Action implements IMenuCreator, IViewAct
Protocol.invokeLater(new Runnable() {
@Override
public void run() {
- Model.getModel().addListener(listener);
+ Model.getPeerModel().addListener(listener);
}
});
}
@@ -104,7 +104,7 @@ public class PeersSubMenuAction extends Action implements IMenuCreator, IViewAct
// If the action proxy is already set, it means that the init(IAction)
// has been called before. Re-trigger the action enablement.
if (actionProxy != null) {
- listener.locatorModelChanged(Model.getModel(), null, false);
+ listener.locatorModelChanged(Model.getPeerModel(), null, false);
}
}
@@ -119,7 +119,7 @@ public class PeersSubMenuAction extends Action implements IMenuCreator, IViewAct
// Determine the enablement. The action is disabled
// if no peers are available.
- IPeerNode[] peers = Model.getModel().getPeerNodes();
+ IPeerNode[] peers = Model.getPeerModel().getPeerNodes();
if (peers != null && peers.length > 0) {
action.setEnabled(true);
if (view instanceof ScriptPad) ((ScriptPad)view).setPeerModel(peers[0]);
@@ -160,7 +160,7 @@ public class PeersSubMenuAction extends Action implements IMenuCreator, IViewAct
Protocol.invokeLater(new Runnable() {
@Override
public void run() {
- Model.getModel().removeListener(listener);
+ Model.getPeerModel().removeListener(listener);
listener = null;
}
});
@@ -209,7 +209,7 @@ public class PeersSubMenuAction extends Action implements IMenuCreator, IViewAct
boolean selectFirst = selected == null;
- IPeerNode[] peerNodes = Model.getModel().getPeerNodes();
+ IPeerNode[] peerNodes = Model.getPeerModel().getPeerNodes();
if (peerNodes != null && peerNodes.length > 0) {
for (IPeerNode peerNode : peerNodes) {
if (isValueAdd(peerNode)) continue;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/.classpath b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/.classpath
index 8a8f1668c..ad32c83a7 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/.classpath
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/.classpath
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/.project b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/.project
index 673c58a93..484463572 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/.project
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/.project
@@ -1,39 +1,39 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.tcf.te.tcf.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
- <filteredResources>
- <filter>
- <id>1311579491339</id>
- <name></name>
- <type>10</type>
- <matcher>
- <id>org.eclipse.ui.ide.multiFilter</id>
- <arguments>1.0-name-matches-false-false-target</arguments>
- </matcher>
- </filter>
- </filteredResources>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.tcf.te.tcf.ui</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+ <filteredResources>
+ <filter>
+ <id>1311579491339</id>
+ <name></name>
+ <type>10</type>
+ <matcher>
+ <id>org.eclipse.ui.ide.multiFilter</id>
+ <arguments>1.0-name-matches-false-false-target</arguments>
+ </matcher>
+ </filter>
+ </filteredResources>
+</projectDescription>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/.settings/org.eclipse.jdt.core.prefs b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/.settings/org.eclipse.jdt.core.prefs
index cc849d463..242feb7e3 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/.settings/org.eclipse.jdt.core.prefs
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/.settings/org.eclipse.jdt.core.prefs
@@ -1,362 +1,362 @@
-#Fri Oct 07 16:14:24 CEST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=warning
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
-org.eclipse.jdt.core.compiler.problem.nullReference=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
-org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=0
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=0
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=0
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=0
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=0
-org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=0
-org.eclipse.jdt.core.formatter.alignment_for_compact_if=0
-org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=0
-org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
-org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=0
-org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
-org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=0
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=0
-org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
-org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=0
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=0
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=0
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=0
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=0
-org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
-org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_after_package=1
-org.eclipse.jdt.core.formatter.blank_lines_before_field=0
-org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
-org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
-org.eclipse.jdt.core.formatter.blank_lines_before_method=1
-org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
-org.eclipse.jdt.core.formatter.blank_lines_before_package=0
-org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
-org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
-org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
-org.eclipse.jdt.core.formatter.comment.format_block_comments=true
-org.eclipse.jdt.core.formatter.comment.format_header=false
-org.eclipse.jdt.core.formatter.comment.format_html=true
-org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
-org.eclipse.jdt.core.formatter.comment.format_line_comments=true
-org.eclipse.jdt.core.formatter.comment.format_source_code=true
-org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
-org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
-org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
-org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
-org.eclipse.jdt.core.formatter.comment.line_length=100
-org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
-org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
-org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
-org.eclipse.jdt.core.formatter.compact_else_if=true
-org.eclipse.jdt.core.formatter.continuation_indentation=4
-org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=4
-org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
-org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
-org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
-org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
-org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_empty_lines=false
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
-org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
-org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
-org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.join_lines_in_comments=true
-org.eclipse.jdt.core.formatter.join_wrapped_lines=true
-org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=true
-org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=true
-org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=true
-org.eclipse.jdt.core.formatter.lineSplit=100
-org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
-org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
-org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
-org.eclipse.jdt.core.formatter.tabulation.char=tab
-org.eclipse.jdt.core.formatter.tabulation.size=4
-org.eclipse.jdt.core.formatter.use_on_off_tags=false
-org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=true
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
-org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
-org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
+#Fri Oct 07 16:14:24 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=warning
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=0
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=0
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
+org.eclipse.jdt.core.formatter.comment.line_length=100
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=4
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=4
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=true
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=true
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=true
+org.eclipse.jdt.core.formatter.lineSplit=100
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=true
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
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 9fd60e0a4..146ec319d 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
@@ -345,10 +345,7 @@
<with variable="selection">
<count value="1"/>
<iterate operator="and" ifEmpty="false">
- <and>
- <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode"/>
- <test property="org.eclipse.tcf.te.tcf.locator.isStaticPeer" value="true"/>
- </and>
+ <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode"/>
</iterate>
</with>
</visibleWhen>
@@ -524,10 +521,7 @@
<with variable="selection">
<count value="1"/>
<iterate operator="and" ifEmpty="false">
- <and>
- <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode"/>
- <test property="org.eclipse.tcf.te.tcf.locator.isStaticPeer" value="true"/>
- </and>
+ <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode"/>
</iterate>
</with>
</enabledWhen>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/actions/AbstractPeerTypeToolbarAction.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/actions/AbstractPeerTypeToolbarAction.java
index 48be9247c..4f6e2bda3 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/actions/AbstractPeerTypeToolbarAction.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/actions/AbstractPeerTypeToolbarAction.java
@@ -207,7 +207,7 @@ public abstract class AbstractPeerTypeToolbarAction extends Action implements IA
Runnable runnable = new Runnable() {
@Override
public void run() {
- IPeerModel model = Model.getModel();
+ IPeerModel model = Model.getPeerModel();
Assert.isNotNull(model);
peerNode.set(model.getService(IPeerModelLookupService.class).lkupPeerModelById(peerId));
}
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 2384a51e3..e7a3ae1f7 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
@@ -104,18 +104,7 @@ public class UIPlugin extends AbstractUIPlugin {
if (proceedShutdown || forced) {
// Terminate the scanner
- final IPeerModel model = Model.getModel(true);
- if (model != null) {
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- model.getScanner().terminate();
- }
- };
-
- Assert.isTrue(!Protocol.isDispatchThread());
- Protocol.invokeAndWait(runnable);
- }
+ final IPeerModel model = Model.getPeerModel(true);
// Disconnect all connected connections via the stepper service
if (model != null) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/ContextSelectorSectionControl.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/ContextSelectorSectionControl.java
index 85fad0345..d68aa1a31 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/ContextSelectorSectionControl.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/ContextSelectorSectionControl.java
@@ -45,7 +45,7 @@ public class ContextSelectorSectionControl extends AbstractContextSelectorContro
*/
@Override
protected Object getInitialViewerInput() {
- return Model.getModel();
+ return Model.getPeerModel();
}
/* (non-Javadoc)
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/dialogs/PeerSelectionDialog.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/dialogs/PeerSelectionDialog.java
index aca1888fc..9f210081c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/dialogs/PeerSelectionDialog.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/dialogs/PeerSelectionDialog.java
@@ -254,7 +254,7 @@ public class PeerSelectionDialog extends CustomTitleAreaDialog {
* @return The locator model instance.
*/
protected IPeerModel getModel() {
- return Model.getModel();
+ return Model.getPeerModel();
}
/**
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/AbstractConfigurationEditorPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/AbstractConfigurationEditorPage.java
index 6b368f08c..629927df1 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/AbstractConfigurationEditorPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/AbstractConfigurationEditorPage.java
@@ -16,14 +16,12 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.core.interfaces.IConnectable;
import org.eclipse.tcf.te.runtime.persistence.interfaces.IURIPersistenceService;
import org.eclipse.tcf.te.runtime.services.ServiceManager;
import org.eclipse.tcf.te.runtime.services.interfaces.ISimulatorService;
import org.eclipse.tcf.te.runtime.statushandler.StatusHandlerUtil;
import org.eclipse.tcf.te.runtime.utils.StatusHelper;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelRefreshService;
import org.eclipse.tcf.te.tcf.ui.help.IContextHelpIds;
import org.eclipse.tcf.te.tcf.ui.nls.Messages;
import org.eclipse.tcf.te.tcf.ui.sections.SimulatorTypeSelectionSection;
@@ -148,15 +146,8 @@ public abstract class AbstractConfigurationEditorPage extends AbstractCustomForm
// Save the peer node to the new persistence storage
uRIPersistenceService.write(((IPeerNode)input).getPeer(), null);
- // In case the node had been dynamically discovered before, we have to trigger a refresh
- // to the locator model to read in the newly created static peer
- if (((IPeerNode)input).getConnectState() == IConnectable.STATE_CONNECTED) {
- // Refresh the static peers
- ((IPeerNode)input).getModel().getService(IPeerModelRefreshService.class).refreshStaticPeers();
-
- // Reopen the editor on the current page
- ViewsUtil.reopenEditor(getEditor(), getEditor().getActivePageInstance().getId(), false);
- }
+ // Reopen the editor on the current page
+ ViewsUtil.reopenEditor(getEditor(), getEditor().getActivePageInstance().getId(), false);
} catch (IOException e) {
// Build up the message template
String template = NLS.bind(Messages.AbstractConfigurationEditorPage_error_save, ((IPeerNode)input).getName(), Messages.AbstractConfigurationEditorPage_error_possibleCause);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/OverviewEditorPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/OverviewEditorPage.java
index d614abe14..61d4c4076 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/OverviewEditorPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/OverviewEditorPage.java
@@ -23,7 +23,6 @@ import org.eclipse.tcf.te.runtime.persistence.interfaces.IURIPersistenceService;
import org.eclipse.tcf.te.runtime.services.ServiceManager;
import org.eclipse.tcf.te.runtime.statushandler.StatusHandlerUtil;
import org.eclipse.tcf.te.runtime.utils.StatusHelper;
-import org.eclipse.tcf.te.tcf.locator.ScannerRunnable;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
import org.eclipse.tcf.te.tcf.ui.activator.UIPlugin;
import org.eclipse.tcf.te.tcf.ui.editor.sections.AttributesSection;
@@ -35,7 +34,6 @@ import org.eclipse.tcf.te.tcf.ui.internal.ImageConsts;
import org.eclipse.tcf.te.tcf.ui.nls.Messages;
import org.eclipse.tcf.te.ui.forms.CustomFormToolkit;
import org.eclipse.tcf.te.ui.views.editor.pages.AbstractCustomFormToolkitEditorPage;
-import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.forms.widgets.TableWrapData;
import org.eclipse.ui.forms.widgets.TableWrapLayout;
@@ -165,36 +163,6 @@ public class OverviewEditorPage extends AbstractCustomFormToolkitEditorPage {
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractEditorPage#setInput(org.eclipse.ui.IEditorInput)
- */
- @Override
- protected void setInput(IEditorInput input) {
- IEditorInput oldInput = getEditorInput();
- // do nothing when input did not change
- if (oldInput != null && oldInput.equals(input)) {
- return;
- }
- super.setInput(input);
- if (getEditorInputNode() instanceof IPeerNode) {
- // Invoke the scanner runnable
- ScannerRunnable runnable = new ScannerRunnable(null, ((IPeerNode)getEditorInputNode()));
- Protocol.invokeLater(runnable);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractEditorPage#setInputWithNotify(org.eclipse.ui.IEditorInput)
- */
- @Override
- protected void setInputWithNotify(IEditorInput input) {
- super.setInputWithNotify(input);
- if (getEditorInputNode() instanceof IPeerNode) {
- ScannerRunnable runnable = new ScannerRunnable(null, ((IPeerNode)getEditorInputNode()));
- Protocol.invokeLater(runnable);
- }
- }
-
- /* (non-Javadoc)
* @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractEditorPage#postDoSave(org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
@@ -231,10 +199,6 @@ public class OverviewEditorPage extends AbstractCustomFormToolkitEditorPage {
((IPeerNode)input).fireChangeEvent("properties", null, ((IPeerNode)input).getProperties()); //$NON-NLS-1$
}
});
-
- // Force a scan of the peer
- ScannerRunnable runnable2 = new ScannerRunnable(null, ((IPeerNode)input));
- Protocol.invokeLater(runnable2);
}
}
}
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 fef9eca27..fc92ccb17 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
@@ -456,7 +456,7 @@ public class GeneralInformationSection extends AbstractSection {
@Override
public void run() {
// Get all peer model objects
- IPeerNode[] peers = Model.getModel().getPeerNodes();
+ IPeerNode[] peers = Model.getPeerModel().getPeerNodes();
// Loop them and find the ones which are of our handled types
for (IPeerNode peerNode : peers) {
if (!peerNode.equals(od)) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/ServicesSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/ServicesSection.java
index 3f2296a93..9811ed6cf 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/ServicesSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/ServicesSection.java
@@ -9,8 +9,6 @@
*******************************************************************************/
package org.eclipse.tcf.te.tcf.ui.editor.sections;
-import java.util.concurrent.atomic.AtomicBoolean;
-
import org.eclipse.core.runtime.Assert;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
@@ -23,10 +21,8 @@ import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
import org.eclipse.tcf.te.runtime.properties.PropertiesContainer;
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.IPeerModelQueryService;
import org.eclipse.tcf.te.tcf.ui.nls.Messages;
import org.eclipse.tcf.te.ui.forms.parts.AbstractSection;
-import org.eclipse.tcf.te.ui.swt.DisplayUtil;
import org.eclipse.tcf.te.ui.swt.SWTControlUtil;
import org.eclipse.tcf.te.ui.views.editor.pages.AbstractEditorPage;
import org.eclipse.ui.forms.IManagedForm;
@@ -125,9 +121,6 @@ public class ServicesSection extends AbstractSection {
}
}
- // Flag to mark that the services query had been done for the current peer model node
- private boolean servicesQueryTriggered = false;
-
/**
* Initialize the page widgets based of the data from the given peer node.
* <p>
@@ -137,8 +130,6 @@ public class ServicesSection extends AbstractSection {
* @param node The peer node or <code>null</code>.
*/
public void setupData(final IPeerNode node) {
- // Reset the services query triggered flag if we setup for a new peer model node
- if (od != node) servicesQueryTriggered = false;
// Besides the node itself, we need to look at the node data to determine
// if the widgets needs to be updated. For the comparisation, keep the
@@ -164,82 +155,19 @@ public class ServicesSection extends AbstractSection {
}
});
- boolean forceQuery = false;
-
- // If the original data copy does not match the previous original
- // data copy, the services needs to be queried again.
- if (!previousOdc.getProperties().equals(odc.getProperties())) {
- servicesQueryTriggered = false;
- forceQuery = true;
- }
-
// Create the UI runnable
- final AtomicBoolean fireRefreshTabs = new AtomicBoolean();
- final Runnable uiRunnable = new Runnable() {
-
- @Override
- public void run() {
- boolean fireNotification = fireRefreshTabs.get();
-
- String value = odc.getStringProperty(IPeerNodeProperties.PROP_LOCAL_SERVICES);
- fireNotification |= value != null && !value.equals(SWTControlUtil.getText(local));
- SWTControlUtil.setText(local, value != null ? value : ""); //$NON-NLS-1$
- value = odc.getStringProperty(IPeerNodeProperties.PROP_REMOTE_SERVICES);
- fireNotification |= value != null && !value.equals(SWTControlUtil.getText(remote));
- SWTControlUtil.setText(remote, value != null ? value : ""); //$NON-NLS-1$
-
- if (fireNotification) {
- // Fire a change event to trigger the editor refresh
- od.fireChangeEvent("editor.refreshTab", Boolean.FALSE, Boolean.TRUE); //$NON-NLS-1$
- }
- }
- };
-
- // If not yet triggered or if forced, run the service query
- if (!servicesQueryTriggered) {
- // Mark the services query as triggered
- servicesQueryTriggered = true;
-
- final boolean finForceQuery = forceQuery;
-
- Runnable runnable = new Runnable() {
-
- @Override
- public void run() {
- // Check if we have to run the query at all
- boolean doQuery = finForceQuery ||
- (!node.containsKey(IPeerNodeProperties.PROP_REMOTE_SERVICES)
- && !node.containsKey(IPeerNodeProperties.PROP_LOCAL_SERVICES));
-
- if (doQuery) {
- IPeerModelQueryService service = node.getModel().getService(IPeerModelQueryService.class);
- if (service != null) {
- service.queryServicesAsync(node, new IPeerModelQueryService.DoneQueryServices() {
- @Override
- public void doneQueryServices(Throwable error) {
- // Copy over the service properties
- odc.setProperty(IPeerNodeProperties.PROP_REMOTE_SERVICES, node.getProperty(IPeerNodeProperties.PROP_REMOTE_SERVICES));
- odc.setProperty(IPeerNodeProperties.PROP_LOCAL_SERVICES, node.getProperty(IPeerNodeProperties.PROP_LOCAL_SERVICES));
-
- // Setup the data within the UI controls and fire the change notification
- fireRefreshTabs.set(true);
- DisplayUtil.safeAsyncExec(uiRunnable);
- }
- });
- }
- } else {
- // Copy over the properties
- odc.setProperties(node.getProperties());
- // Setup the data within the UI controls
- DisplayUtil.safeAsyncExec(uiRunnable);
- }
- }
- };
-
- Protocol.invokeLater(runnable);
- } else {
- // Setup the data within the UI controls
- uiRunnable.run();
+ boolean fireNotification = false;
+
+ String value = odc.getStringProperty(IPeerNodeProperties.PROP_LOCAL_SERVICES);
+ fireNotification |= value != null && !value.equals(SWTControlUtil.getText(local));
+ SWTControlUtil.setText(local, value != null ? value : ""); //$NON-NLS-1$
+ value = odc.getStringProperty(IPeerNodeProperties.PROP_REMOTE_SERVICES);
+ fireNotification |= value != null && !value.equals(SWTControlUtil.getText(remote));
+ SWTControlUtil.setText(remote, value != null ? value : ""); //$NON-NLS-1$
+
+ if (fireNotification) {
+ // Fire a change event to trigger the editor refresh
+ od.fireChangeEvent("editor.refreshTab", Boolean.FALSE, Boolean.TRUE); //$NON-NLS-1$
}
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/DeleteHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/DeleteHandler.java
index d85fa1d91..3f5483c9c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/DeleteHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/DeleteHandler.java
@@ -269,7 +269,7 @@ public class DeleteHandler extends AbstractHandler {
Protocol.invokeLater(new Runnable() {
@Override
public void run() {
- IPeerModelRefreshService service = Model.getModel().getService(IPeerModelRefreshService.class);
+ IPeerModelRefreshService service = Model.getPeerModel().getService(IPeerModelRefreshService.class);
// Refresh the model now (must be executed within the TCF dispatch thread)
if (service != null) service.refresh(new Callback() {
@Override
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RedirectHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RedirectHandler.java
deleted file mode 100644
index f46a4ab54..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RedirectHandler.java
+++ /dev/null
@@ -1,178 +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.ui.handler;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.runtime.persistence.interfaces.IURIPersistenceService;
-import org.eclipse.tcf.te.runtime.services.ServiceManager;
-import org.eclipse.tcf.te.runtime.statushandler.StatusHandlerUtil;
-import org.eclipse.tcf.te.runtime.utils.StatusHelper;
-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.interfaces.services.IPeerModelRefreshService;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelUpdateService;
-import org.eclipse.tcf.te.tcf.locator.model.Model;
-import org.eclipse.tcf.te.tcf.locator.nodes.PeerRedirector;
-import org.eclipse.tcf.te.tcf.ui.dialogs.RedirectPeerSelectionDialog;
-import org.eclipse.tcf.te.tcf.ui.help.IContextHelpIds;
-import org.eclipse.tcf.te.tcf.ui.nls.Messages;
-import org.eclipse.tcf.te.ui.swt.DisplayUtil;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.navigator.CommonNavigator;
-
-/**
- * Redirect peer command handler implementation.
- */
-public class RedirectHandler extends AbstractHandler {
-
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- */
- @Override
- public Object execute(final ExecutionEvent event) throws ExecutionException {
- // Determine the peer selected in Target Explorer tree
- ISelection selection = HandlerUtil.getCurrentSelection(event);
- if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
- // Redirect is supporting single selection only
- Object candidate = ((IStructuredSelection)selection).getFirstElement();
- if (candidate instanceof IPeerNode) {
- final IPeerNode peerNode = (IPeerNode)candidate;
-
- // Create the agent selection dialog
- RedirectPeerSelectionDialog dialog = new RedirectPeerSelectionDialog(HandlerUtil.getActiveShell(event), null) {
- @Override
- protected void configureTableViewer(TableViewer viewer) {
- Assert.isNotNull(viewer);
-
- List<ViewerFilter> filter = new ArrayList<ViewerFilter>();
- if (viewer.getFilters() != null && viewer.getFilters().length > 0) {
- filter.addAll(Arrays.asList(viewer.getFilters()));
- }
-
- filter.add(new ViewerFilter() {
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- if (peerNode.equals(element)) {
- return false;
- }
- return true;
- }
- });
-
- viewer.setFilters(filter.toArray(new ViewerFilter[filter.size()]));
- }
- };
-
- // Open the dialog
- if (dialog.open() == Window.OK) {
- // Get the selected proxy from the dialog
- selection = dialog.getSelection();
- if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
- candidate = ((IStructuredSelection)selection).getFirstElement();
- if (candidate instanceof IPeerNode) {
- final IPeerNode proxy = (IPeerNode)candidate;
-
- Protocol.invokeLater(new Runnable() {
- @Override
- public void run() {
- redirect(peerNode, proxy);
-
- DisplayUtil.safeAsyncExec(new Runnable() {
- @Override
- public void run() {
- IWorkbenchPart part = HandlerUtil.getActivePart(event);
- if (part instanceof CommonNavigator) {
- CommonNavigator navigator = (CommonNavigator)part;
- navigator.selectReveal(new StructuredSelection(peerNode));
- }
- }
- });
- }
- });
- }
- }
- }
- }
- }
-
-
- return null;
- }
-
- /**
- * Redirect the communication to the given peer through the given proxy.
- * <p>
- * The method must be called from within the TCF dispatch thread.
- *
- * @param peerNode The peer to redirect. Must not be <code>null</code>.
- * @param proxy The proxy. Must not be <code>null</code>
- */
- public void redirect(IPeerNode peerNode, IPeerNode proxy) {
- Assert.isNotNull(peerNode);
- Assert.isNotNull(proxy);
- Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
-
- // Get the peer attributes
- Map<String, String> attributes = new HashMap<String, String>();
- attributes.putAll(peerNode.getPeer().getAttributes());
- // Set the redirection
- attributes.put(IPeerNodeProperties.PROP_REDIRECT_PROXY, proxy.getPeerId());
-
- try {
- IURIPersistenceService uRIPersistenceService = ServiceManager.getInstance().getService(IURIPersistenceService.class);
- if (uRIPersistenceService == null) {
- throw new IOException("Persistence service instance unavailable."); //$NON-NLS-1$
- }
- uRIPersistenceService.write(new Peer(attributes), null);
-
- // Create a peer redirector
- PeerRedirector redirector = new PeerRedirector(proxy.getPeer(), attributes);
- // And update the instance
- peerNode.setProperty(IPeerNodeProperties.PROP_INSTANCE, redirector);
-
- // Associate proxy (parent) and peer model (child)
- peerNode.setParent(proxy);
- Model.getModel().getService(IPeerModelUpdateService.class).addChild(peerNode);
-
- // Trigger a refresh of the locator model in a later dispatch cycle
- Protocol.invokeLater(new Runnable() {
- @Override
- public void run() {
- Model.getModel().getService(IPeerModelRefreshService.class).refresh(null);
- }
- });
- } catch (IOException e) {
- String template = NLS.bind(Messages.RedirectHandler_error_redirectFailed, Messages.PossibleCause);
- StatusHandlerUtil.handleStatus(StatusHelper.getStatus(e), peerNode, template,
- Messages.RedirectHandler_error_title, IContextHelpIds.MESSAGE_REDIRECT_FAILED, this, null);
- }
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RefreshHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RefreshHandler.java
index bbc12e44a..fd01beb65 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RefreshHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RefreshHandler.java
@@ -26,7 +26,6 @@ import org.eclipse.tcf.te.runtime.callback.AsyncCallbackCollector;
import org.eclipse.tcf.te.runtime.callback.Callback;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
import org.eclipse.tcf.te.tcf.core.async.CallbackInvocationDelegate;
-import org.eclipse.tcf.te.tcf.locator.ScannerRunnable;
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.services.IPeerModelRefreshService;
@@ -115,20 +114,6 @@ public class RefreshHandler extends AbstractHandler {
Protocol.invokeLater(runnable);
}
- for (IPeerNode model : peerToRefresh) {
- final IPeerNode finModel = model;
- final ICallback innerCallback = new AsyncCallbackCollector.SimpleCollectorCallback(collector);
-
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- new ScannerRunnable(null, finModel).run();
- innerCallback.done(this, Status.OK_STATUS);
- }
- };
- Protocol.invokeLater(runnable);
- }
-
// Mark the collector as fully initialized
collector.initDone();
} else {
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 af5804276..e7b34928d 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
@@ -174,7 +174,7 @@ public class RenameHandler extends AbstractHandler {
Protocol.invokeLater(new Runnable() {
@Override
public void run() {
- final IPeerModelRefreshService service = Model.getModel().getService(IPeerModelRefreshService.class);
+ final IPeerModelRefreshService service = Model.getPeerModel().getService(IPeerModelRefreshService.class);
// Refresh the model now (must be executed within the TCF dispatch thread)
if (service != null) {
service.refresh(new Callback() {
@@ -215,7 +215,7 @@ public class RenameHandler extends AbstractHandler {
public void run() {
name.set(node.getPeer().getName());
- IPeerModel model = Model.getModel();
+ IPeerModel model = Model.getPeerModel();
Assert.isNotNull(model);
IPeerNode[] peers = model.getPeerNodes();
for (IPeerNode peer : peers) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/ResetRedirectHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/ResetRedirectHandler.java
deleted file mode 100644
index c1229abf8..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/ResetRedirectHandler.java
+++ /dev/null
@@ -1,119 +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.ui.handler;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.tcf.protocol.IPeer;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.runtime.persistence.interfaces.IURIPersistenceService;
-import org.eclipse.tcf.te.runtime.services.ServiceManager;
-import org.eclipse.tcf.te.runtime.statushandler.StatusHandlerUtil;
-import org.eclipse.tcf.te.runtime.utils.StatusHelper;
-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.interfaces.services.IPeerModelRefreshService;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelUpdateService;
-import org.eclipse.tcf.te.tcf.locator.model.Model;
-import org.eclipse.tcf.te.tcf.ui.help.IContextHelpIds;
-import org.eclipse.tcf.te.tcf.ui.nls.Messages;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * Reset peer redirection command handler.
- */
-public class ResetRedirectHandler extends AbstractHandler {
-
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- */
- @Override
- public Object execute(ExecutionEvent event) throws ExecutionException {
- // Determine the peer selected in Target Explorer tree
- ISelection selection = HandlerUtil.getCurrentSelection(event);
- if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
- // Redirect is supporting single selection only
- Object candidate = ((IStructuredSelection)selection).getFirstElement();
- if (candidate instanceof IPeerNode) {
- final IPeerNode peerNode = (IPeerNode)candidate;
-
- Protocol.invokeLater(new Runnable() {
- @Override
- public void run() {
- resetRedirect(peerNode);
- }
- });
- }
- }
-
- return null;
- }
-
- /**
- * Reset the communication redirection for the given peer.
- * <p>
- * The method must be called from within the TCF dispatch thread.
- *
- * @param peerNode The peer to reset. Must not be <code>null</code>.
- */
- public void resetRedirect(IPeerNode peerNode) {
- Assert.isNotNull(peerNode);
- Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
-
- // Get the peer attributes
- Map<String, String> attributes = new HashMap<String, String>();
- attributes.putAll(peerNode.getPeer().getAttributes());
- // Redirection set?
- if (attributes.get(IPeerNodeProperties.PROP_REDIRECT_PROXY) != null) {
- // Remove the redirection
- attributes.remove(IPeerNodeProperties.PROP_REDIRECT_PROXY);
-
- try {
- // Save it
- IURIPersistenceService uRIPersistenceService = ServiceManager.getInstance().getService(IURIPersistenceService.class);
- if (uRIPersistenceService == null) {
- throw new IOException("Persistence service instance unavailable."); //$NON-NLS-1$
- }
- // Create a peer
- IPeer peer = new Peer(attributes);
- uRIPersistenceService.write(peer, null);
-
- // And update the instance
- peerNode.setProperty(IPeerNodeProperties.PROP_INSTANCE, peer);
-
- // Reset proxy (parent) and peer model (child) association
- Model.getModel().getService(IPeerModelUpdateService.class).removeChild(peerNode);
- peerNode.setParent(null);
-
- // Trigger a refresh of the locator model in a later dispatch cycle
- Protocol.invokeLater(new Runnable() {
- @Override
- public void run() {
- Model.getModel().getService(IPeerModelRefreshService.class).refresh(null);
- }
- });
- } catch (IOException e) {
- String template = NLS.bind(Messages.ResetRedirectHandler_error_resetRedirectFailed, Messages.PossibleCause);
- StatusHandlerUtil.handleStatus(StatusHelper.getStatus(e), peerNode, template,
- Messages.ResetRedirectHandler_error_title, IContextHelpIds.MESSAGE_RESET_REDIRECT_FAILED, this, null);
- }
- }
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/adapters/EditorSaveAsAdapter.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/adapters/EditorSaveAsAdapter.java
index 385b24a0a..8b577cf08 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/adapters/EditorSaveAsAdapter.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/adapters/EditorSaveAsAdapter.java
@@ -108,7 +108,7 @@ public class EditorSaveAsAdapter implements IEditorSaveAsAdapter {
@Override
protected void internalDone(Object caller, IStatus status) {
// Get the peer model node from the model and select it in the tree
- IPeerNode peerNode = Model.getModel().getService(IPeerModelLookupService.class).lkupPeerModelById(attrs.get(IPeer.ATTR_ID));
+ IPeerNode peerNode = Model.getPeerModel().getService(IPeerModelLookupService.class).lkupPeerModelById(attrs.get(IPeer.ATTR_ID));
newPeer.set(peerNode);
if (peerNode != null) {
// Refresh the viewer
@@ -125,7 +125,7 @@ public class EditorSaveAsAdapter implements IEditorSaveAsAdapter {
Protocol.invokeLater(new Runnable() {
@Override
public void run() {
- IPeerModelRefreshService service = Model.getModel().getService(IPeerModelRefreshService.class);
+ IPeerModelRefreshService service = Model.getPeerModel().getService(IPeerModelRefreshService.class);
// Refresh the model now (must be executed within the TCF dispatch thread)
if (service != null) {
service.refresh(cb);
@@ -150,7 +150,7 @@ public class EditorSaveAsAdapter implements IEditorSaveAsAdapter {
@Override
public void run() {
// Get all peer model objects
- IPeerNode[] peers = Model.getModel().getPeerNodes();
+ IPeerNode[] peers = Model.getPeerModel().getPeerNodes();
// Loop them and find the ones which are of our handled types
for (IPeerNode peerNode : peers) {
String name = peerNode.getPeer().getName();
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/adapters/PeerNodeFactory.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/adapters/PeerNodeFactory.java
index 6275b7643..5bf7547d2 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/adapters/PeerNodeFactory.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/adapters/PeerNodeFactory.java
@@ -43,7 +43,7 @@ public class PeerNodeFactory implements IElementFactory {
Runnable runnable = new Runnable() {
@Override
public void run() {
- node.set(Model.getModel().getService(IPeerModelLookupService.class).lkupPeerModelById(peerId));
+ node.set(Model.getPeerModel().getService(IPeerModelLookupService.class).lkupPeerModelById(peerId));
}
};
@@ -60,8 +60,8 @@ public class PeerNodeFactory implements IElementFactory {
Runnable runnable2 = new Runnable() {
@Override
public void run() {
- Model.getModel().getService(IPeerModelRefreshService.class).refresh(null);
- node.set(Model.getModel().getService(IPeerModelLookupService.class).lkupPeerModelById(peerId));
+ Model.getPeerModel().getService(IPeerModelRefreshService.class).refresh(null);
+ node.set(Model.getPeerModel().getService(IPeerModelLookupService.class).lkupPeerModelById(peerId));
}
};
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/services/DefaultContextService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/services/DefaultContextService.java
index 159847634..1310fc1cc 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/services/DefaultContextService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/services/DefaultContextService.java
@@ -157,7 +157,7 @@ public class DefaultContextService extends AbstractService implements IDefaultCo
Runnable runnable = new Runnable() {
@Override
public void run() {
- IPeerModel model = Model.getModel();
+ IPeerModel model = Model.getPeerModel();
Assert.isNotNull(model);
peerNode.set(model.getService(IPeerModelLookupService.class).lkupPeerModelById(peerId));
}
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 ac6414ab4..be1ba09b4 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
@@ -25,12 +25,10 @@ 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.ScannerRunnable;
import org.eclipse.tcf.te.tcf.locator.activator.CoreBundleActivator;
import org.eclipse.tcf.te.tcf.locator.interfaces.IModelListener;
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.IPeerNodeProperties;
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;
@@ -70,8 +68,6 @@ public class ContentProvider implements ICommonContentProvider, ITreePathContent
// The locator model listener instance
/* default */ IModelListener modelListener = null;
- // The tree view listener instance
- /* default */ TreeViewerListener treeViewerListener = null;
// Internal map of PeerRedirectorGroupNodes per peer id
private final Map<String, PeerRedirectorGroupNode> roots = new HashMap<String, PeerRedirectorGroupNode>();
@@ -175,12 +171,12 @@ public class ContentProvider implements ICommonContentProvider, ITreePathContent
// If the parent element is a category, than we assume
// the locator model as parent element.
if (parentElement instanceof ICategory) {
- parentElement = Model.getModel();
+ parentElement = Model.getPeerModel();
}
// If the parent element is the root element and "all"
// categories are hidden, assume the locator model as parent element
if (parentElement instanceof IRoot && allHidden) {
- parentElement = Model.getModel();
+ parentElement = Model.getPeerModel();
}
// If it is the locator model, get the peers
@@ -238,32 +234,16 @@ public class ContentProvider implements ICommonContentProvider, ITreePathContent
}
}
else if (IUIConstants.ID_CAT_NEIGHBORHOOD.equals(catID)) {
-// final AtomicReference<IPeer[]> peers = new AtomicReference<IPeer[]>(null);
-//
-// Protocol.invokeAndWait(new Runnable() {
-// @Override
-// public void run() {
-// // Get the locator service
-// ILocator locatorService = Protocol.getLocator();
-// if (locatorService != null) {
-// // Get the map of peers known to the locator service.
-// Map<String, IPeer> peerMap = locatorService.getPeers();
-// peers.set(peerMap.values().toArray(new IPeer[peerMap.size()]));
-// }
-// }
-// });
-//
-// for (IPeer peer : peers.get()) {
-// // Check for filtered nodes (Value-add's and Proxies)
-// if (isFiltered(peer)) {
-// continue;
-// }
-//
-//
-// if (!candidates.contains(peer)) {
-// candidates.add(peer);
-// }
-// }
+ for (IPeer peer : Model.getLocatorModel().getPeers()) {
+ // Check for filtered nodes (Value-add's and Proxies)
+ if (isFiltered(peer)) {
+ continue;
+ }
+
+ if (!candidates.contains(peer)) {
+ candidates.add(peer);
+ }
+ }
}
else if (catID != null) {
for (IPeerNode peer : peerNodes) {
@@ -294,43 +274,6 @@ public class ContentProvider implements ICommonContentProvider, ITreePathContent
children = candidates.toArray(new Object[candidates.size()]);
}
- // If it is a peer model itself, get the child peers
- else if (parentElement instanceof IPeerNode) {
- String parentPeerId = ((IPeerNode)parentElement).getPeerId();
- List<IPeerNode> candidates = Model.getModel().getChildren(parentPeerId);
- if (candidates != null && candidates.size() > 0) {
- PeerRedirectorGroupNode rootNode = roots.get(parentPeerId);
- if (rootNode == null) {
- rootNode = new PeerRedirectorGroupNode(parentPeerId);
- roots.put(parentPeerId, rootNode);
- }
- children = new Object[] { rootNode };
- } else {
- roots.remove(parentPeerId);
- }
- }
- // If it is a remote peer discover root node, return the children
- // for the associated peer id.
- else if (parentElement instanceof PeerRedirectorGroupNode) {
- List<IPeerNode> candidates = Model.getModel().getChildren(((PeerRedirectorGroupNode)parentElement).peerId);
- if (candidates != null && candidates.size() > 0) {
- // Mark all candidates to be included in the scan process and
- // schedule an scan asynchronously
- for (final IPeerNode candidate: candidates) {
- Protocol.invokeLater(new Runnable() {
- @Override
- public void run() {
- candidate.setProperty(IPeerNodeProperties.PROP_SCANNER_EXCLUDE, false);
-
- ScannerRunnable runnable = new ScannerRunnable(null, candidate);
- runnable.run();
- }
- });
- }
-
- children = candidates.toArray();
- }
- }
return children;
}
@@ -377,7 +320,7 @@ public class ContentProvider implements ICommonContentProvider, ITreePathContent
final Runnable runnable = new Runnable() {
@Override
public void run() {
- parent.set(Model.getModel().getService(IPeerModelLookupService.class).lkupPeerModelById(((PeerRedirectorGroupNode)element).peerId));
+ parent.set(Model.getPeerModel().getService(IPeerModelLookupService.class).lkupPeerModelById(((PeerRedirectorGroupNode)element).peerId));
}
};
@@ -469,7 +412,7 @@ public class ContentProvider implements ICommonContentProvider, ITreePathContent
Runnable runnable = new Runnable() {
@Override
public void run() {
- Model.getModel().removeListener(modelListener);
+ Model.getPeerModel().removeListener(modelListener);
}
};
if (Protocol.isDispatchThread()) runnable.run();
@@ -477,11 +420,6 @@ public class ContentProvider implements ICommonContentProvider, ITreePathContent
modelListener = null;
}
- if (treeViewerListener != null) {
- treeViewerListener.dispose();
- treeViewerListener = null;
- }
-
roots.clear();
}
@@ -490,7 +428,7 @@ public class ContentProvider implements ICommonContentProvider, ITreePathContent
*/
@Override
public void inputChanged(final Viewer viewer, Object oldInput, Object newInput) {
- final IPeerModel model = Model.getModel();
+ final IPeerModel model = Model.getPeerModel();
// Create and attach the model listener if not yet done
if (modelListener == null && model != null && viewer instanceof CommonViewer) {
@@ -503,13 +441,6 @@ public class ContentProvider implements ICommonContentProvider, ITreePathContent
});
}
- // Create and attach the tree listener if not yet done
- if (treeViewerListener == null && viewer instanceof CommonViewer) {
- CommonViewer v = (CommonViewer)viewer;
- treeViewerListener = new TreeViewerListener(v);
- v.addTreeListener(treeViewerListener);
- }
-
if (model != null && newInput instanceof IRoot) {
// Refresh the model asynchronously
Protocol.invokeLater(new Runnable() {
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 bac4216d5..5da180b9b 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
@@ -122,7 +122,7 @@ public class PeerLabelProviderDelegate extends LabelProvider implements ILabelDe
Runnable runnable = new Runnable() {
@Override
public void run() {
- count.set(Model.getModel().getService(IPeerModelLookupService.class).lkupPeerModelByName(label).length);
+ count.set(Model.getPeerModel().getService(IPeerModelLookupService.class).lkupPeerModelByName(label).length);
}
};
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/TreeViewerListener.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/TreeViewerListener.java
deleted file mode 100644
index e9de64f33..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/TreeViewerListener.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 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;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.viewers.ITreeViewerListener;
-import org.eclipse.jface.viewers.TreeExpansionEvent;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.runtime.interfaces.IDisposable;
-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.Model;
-import org.eclipse.tcf.te.tcf.ui.navigator.nodes.PeerRedirectorGroupNode;
-import org.eclipse.ui.navigator.CommonViewer;
-
-/**
- * Tree viewer listener implementation.
- */
-public class TreeViewerListener implements ITreeViewerListener, IDisposable {
- private final CommonViewer viewer;
-
- /**
- * Constructor
- *
- * @param viewer The common viewer instance. Must not be <code>null</code>.
- */
- public TreeViewerListener(CommonViewer viewer) {
- Assert.isNotNull(viewer);
- this.viewer = viewer;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.IDisposable#dispose()
- */
- @Override
- public void dispose() {
- viewer.removeTreeListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeViewerListener#treeCollapsed(org.eclipse.jface.viewers.TreeExpansionEvent)
- */
- @Override
- public void treeCollapsed(TreeExpansionEvent event) {
- if (event.getElement() instanceof PeerRedirectorGroupNode) {
- final List<IPeerNode> candidates = Model.getModel().getChildren(((PeerRedirectorGroupNode)event.getElement()).peerId);
- if (candidates != null && candidates.size() > 0) {
- Protocol.invokeLater(new Runnable() {
- @Override
- public void run() {
- // Mark all candidates to be excluded from the scan process
- for (final IPeerNode candidate: candidates) {
- markExcluded(candidate);
- }
- }
- });
- }
- }
- }
-
- /**
- * Mark the given peer model node and it's child nodes to be excluded from the scanner.
- *
- * @param peerNode The peer model node. Must not be <code>null</code>.
- */
- /* default */ void markExcluded(IPeerNode peerNode) {
- Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- Assert.isNotNull(peerNode);
-
- peerNode.setProperty(IPeerNodeProperties.PROP_SCANNER_EXCLUDE, true);
-
- List<IPeerNode> candidates = Model.getModel().getChildren(peerNode.getPeerId());
- if (candidates != null && candidates.size() > 0) {
- for (final IPeerNode candidate: candidates) {
- markExcluded(candidate);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeViewerListener#treeExpanded(org.eclipse.jface.viewers.TreeExpansionEvent)
- */
- @Override
- public void treeExpanded(TreeExpansionEvent event) {
- }
-
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/dnd/CommonDnD.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/dnd/CommonDnD.java
index 3ff41dd16..5b631653a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/dnd/CommonDnD.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/dnd/CommonDnD.java
@@ -178,7 +178,7 @@ public class CommonDnD {
final Object finalElement = elementToSelect;
final IPeer finalNewPeer = (elementToSelect instanceof IPeer) ? (IPeer)elementToSelect : null;
// Trigger a refresh of the model to read in the newly created static peer
- final IPeerModelRefreshService service = Model.getModel().getService(IPeerModelRefreshService.class);
+ final IPeerModelRefreshService service = Model.getPeerModel().getService(IPeerModelRefreshService.class);
if (service != null) {
Runnable runnable = new Runnable() {
@Override
@@ -188,7 +188,7 @@ public class CommonDnD {
protected void internalDone(Object caller, org.eclipse.core.runtime.IStatus status) {
IPeerNode peerNode = null;
if (finalNewPeer != null) {
- IPeerModelLookupService service = Model.getModel().getService(IPeerModelLookupService.class);
+ IPeerModelLookupService service = Model.getPeerModel().getService(IPeerModelLookupService.class);
if (service != null) {
peerNode = service.lkupPeerModelById(finalNewPeer.getID());
}
@@ -380,7 +380,7 @@ public class CommonDnD {
@Override
public void run() {
// Get all peer model objects
- IPeerNode[] peers = Model.getModel().getPeerNodes();
+ IPeerNode[] peers = Model.getPeerModel().getPeerNodes();
// Loop them and find the ones which are of our handled types
for (IPeerNode peerNode : peers) {
String name = peerNode.getPeer().getName();
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/AbstractContextSelectorSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/AbstractContextSelectorSection.java
index 95712e6a2..31adead8a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/AbstractContextSelectorSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/AbstractContextSelectorSection.java
@@ -103,7 +103,7 @@ public abstract class AbstractContextSelectorSection extends org.eclipse.tcf.te.
Protocol.invokeAndWait(new Runnable() {
@Override
public void run() {
- Model.getModel().removeListener(modelListener);
+ Model.getPeerModel().removeListener(modelListener);
}
});
}
@@ -117,7 +117,7 @@ public abstract class AbstractContextSelectorSection extends org.eclipse.tcf.te.
Protocol.invokeLater(new Runnable() {
@Override
public void run() {
- Model.getModel().addListener(modelListener);
+ Model.getPeerModel().addListener(modelListener);
}
});
EventManager.getInstance().addEventListener(eventListener, ChangeEvent.class);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/NewTargetWizard.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/NewTargetWizard.java
index c9d4250ff..b4adf44f4 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/NewTargetWizard.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/NewTargetWizard.java
@@ -128,13 +128,13 @@ public class NewTargetWizard extends AbstractWizard implements INewWizard {
Protocol.invokeLater(new Runnable() {
@Override
public void run() {
- IPeerModelRefreshService service = Model.getModel().getService(IPeerModelRefreshService.class);
+ IPeerModelRefreshService service = Model.getPeerModel().getService(IPeerModelRefreshService.class);
// Refresh the model now (must be executed within the TCF dispatch thread)
if (service != null) service.refresh(new Callback() {
@Override
protected void internalDone(Object caller, IStatus status) {
// Get the peer model node from the model and select it in the tree
- final IPeerNode peerNode = Model.getModel().getService(IPeerModelLookupService.class).lkupPeerModelById(attrs.get(IPeer.ATTR_ID));
+ final IPeerNode peerNode = Model.getPeerModel().getService(IPeerModelLookupService.class).lkupPeerModelById(attrs.get(IPeer.ATTR_ID));
if (peerNode != null) {
// Refresh the viewer
ViewsUtil.refresh(IUIConstants.ID_EXPLORER);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/AbstractConfigWizardPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/AbstractConfigWizardPage.java
index cdf9845f8..df2ce0236 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/AbstractConfigWizardPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/AbstractConfigWizardPage.java
@@ -310,7 +310,7 @@ public abstract class AbstractConfigWizardPage extends AbstractFormsWizardPage i
@Override
public void run() {
// Get all peer model objects
- IPeerNode[] peers = Model.getModel().getPeerNodes();
+ IPeerNode[] peers = Model.getPeerModel().getPeerNodes();
// Loop them and find the ones which are of our handled types
for (IPeerNode peerNode : peers) {
String name = peerNode.getPeer().getName();
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/NewTargetWizardPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/NewTargetWizardPage.java
index d421fa1bf..ea2308879 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/NewTargetWizardPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/NewTargetWizardPage.java
@@ -454,7 +454,7 @@ public class NewTargetWizardPage extends AbstractValidatingWizardPage implements
@Override
public void run() {
// Get all peer model objects
- IPeerNode[] peers = Model.getModel().getPeerNodes();
+ IPeerNode[] peers = Model.getPeerModel().getPeerNodes();
// Loop them and find the ones which are of our handled types
for (IPeerNode peerNode : peers) {
String name = peerNode.getPeer().getName();
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerExportWizardPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerExportWizardPage.java
index abf4d7dd7..21d53115b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerExportWizardPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerExportWizardPage.java
@@ -167,7 +167,7 @@ public class PeerExportWizardPage extends WizardPage {
}
};
fViewer.addCheckStateListener(checkListener);
- fViewer.setInput(Model.getModel());
+ fViewer.setInput(Model.getPeerModel());
// top level group
Composite buttonComposite = new Composite(resourcesGroup, SWT.NONE);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerImportWizardPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerImportWizardPage.java
index 1c8401e59..e4dfdfc6b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerImportWizardPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerImportWizardPage.java
@@ -336,7 +336,7 @@ public class PeerImportWizardPage extends WizardPage {
UIJob importjob = new UIJob(getContainer().getShell().getDisplay(), Messages.PeerImportWizard_title) {
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {
- final IPeerModel model = Model.getModel();
+ final IPeerModel model = Model.getPeerModel();
final IProgressMonitor finalMonitor;
if (monitor == null) {
finalMonitor = new NullProgressMonitor();
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/TcfTestCase.java b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/TcfTestCase.java
index e526eb525..2a96fa147 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/TcfTestCase.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/TcfTestCase.java
@@ -158,7 +158,7 @@ public class TcfTestCase extends CoreTestCase {
final Map<String, String> attrs = new HashMap<String, String>((Map<String, String>)object);
// Lookup the corresponding peer object
- final IPeerModel model = Model.getModel();
+ final IPeerModel model = Model.getPeerModel();
assertNotNull("Failed to access locator model instance.", model); //$NON-NLS-1$
// The expected peer id is "<transport>:<canonical IP>:<port>"

Back to the top