Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2013-12-13 04:22:07 -0500
committerTobias Schwarz2014-01-09 00:51:33 -0500
commit5271285e0ab605e589963b553785fd102d3f70d7 (patch)
tree0f60c5ca03e79c87b46334be251f56df5b4045ab
parent90c9d157577333df9b9fdff9b1ff52ff63d2e813 (diff)
downloadorg.eclipse.tcf-5271285e0ab605e589963b553785fd102d3f70d7.tar.gz
org.eclipse.tcf-5271285e0ab605e589963b553785fd102d3f70d7.tar.xz
org.eclipse.tcf-5271285e0ab605e589963b553785fd102d3f70d7.zip
Target Explorer: rework peer model
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.model/src/org/eclipse/tcf/te/runtime/model/ModelNode.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.model/src/org/eclipse/tcf/te/runtime/model/interfaces/IModelNode.java8
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/interfaces/properties/IPropertiesContainer.java11
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/properties/PropertiesContainer.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/plugin.xml126
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpParsePath.java14
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpUser.java334
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/testers/TargetPropertyTester.java136
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/url/TcfURLConnection.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/model/AbstractTreeNode.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/model/FSModel.java20
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/plugin.xml10
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/controls/FSNavigatorContentProvider.java172
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/controls/NavigatorContentProvider.java14
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/dialogs/FSOpenFileDialog.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/adapters/FSTreeNodeAdapterFactory.java18
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/adapters/FSTreeNodeFactory.java12
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/adapters/PeerNodeViewerInput.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/adapters/PeerModelViewerInput.java)80
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/adapters/ViewerInputAdapterFactory.java162
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/handlers/MoveFilesHandler.java110
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/handlers/RefreshViewerHandler.java92
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/pages/FSExplorerEditorPage.java10
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/tabbed/BasicFolderSection.java10
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/tabbed/LinuxPermissionsSection.java10
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/tabbed/WindowsAttributesCESection.java10
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/tabbed/WindowsAttributesSection.java10
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/tabbed/WindowsFolderAISection.java10
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/NewNodeWizard.java20
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/NewNodeWizardPage.java8
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/TargetPatternFilter.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/TargetSelectionPage.java24
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/plugin.xml462
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/delegates/Launch.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.java18
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/adapters/AttachLaunchConfigAdapter.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/services/ExportPersistenceService.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/services/PathMapService.java8
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/AbstractTcfLaunchStep.java18
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/iterators/AbstractTcfLaunchStepGroupIterator.java18
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.xml14
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/AbstractTcfLaunchTabContainerEditorPage.java66
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/PathMapEditorPage.java14
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/PathMapTab.java10
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/handler/AbstractDiagnosticsCommandHandler.java14
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/launchcontext/AbstractLaunchContextMainTab.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/META-INF/MANIFEST.MF1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml35
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/Scanner.java22
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/ScannerRunnable.java70
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/activator/CoreBundleActivator.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/IModelListener.java8
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/ITracing.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/ILocatorModel.java158
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerModel.java152
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerNode.java59
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerNodeProperties.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerModelProperties.java)60
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerNodeProvider.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerModelProvider.java)52
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IDefaultContextService.java18
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IPeerModelLookupService.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/ILocatorModelLookupService.java)20
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IPeerModelQueryService.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/ILocatorModelPeerNodeQueryService.java)10
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IPeerModelRefreshService.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/ILocatorModelRefreshService.java)6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IPeerModelService.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/ILocatorModelService.java)15
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IPeerModelUpdateService.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/ILocatorModelUpdateService.java)24
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/ModelNodeFactoryDelegate.java129
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/PeerModelPropertyTester.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/LocatorModelPropertyTester.java)38
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/SimulatorPropertyTester.java8
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/adapters/AdapterFactory.java38
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/adapters/PeerNodeStepContext.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/adapters/PeerModelStepContext.java)14
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/adapters/PeerPersistableURIProvider.java218
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/nodes/InvalidPeerModel.java538
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/services/PropertiesAccessService.java24
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/iterators/AbstractPeerNodeStepGroupIterator.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/iterators/AbstractPeerModelStepGroupIterator.java)92
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/iterators/StartDebuggerIterator.java10
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/iterators/StartSimulatorIterator.java100
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/ChannelStateChangeListener.java28
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/LocatorListener.java87
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/ModelAdapter.java8
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/model/Model.java32
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/ConnectablePeerModel.java179
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/LocatorModel.java785
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/PeerModel.java839
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/PeerNode.java405
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/persistence/GsonPeerPersistenceDelegate.java30
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/AbstractPeerModelService.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/AbstractLocatorModelService.java)22
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/AbstractSimulatorService.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelLookupService.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/LocatorModelLookupService.java)85
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelQueryService.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/LocatorModelPeerNodeQueryService.java)40
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelRefreshService.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/LocatorModelRefreshService.java)165
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelUpdateService.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/LocatorModelUpdateService.java)58
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/StepperOperationService.java10
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/selection/RuntimeServiceContextFilter.java16
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/AbstractPeerNodeStep.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/AbstractPeerModelStep.java)90
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/CheckServiceStep.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/SetAsDefaultContextStep.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/SetWaitForReadyStep.java12
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/SignalPeerDisconnectedStep.java12
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StartDebuggerStep.java20
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StartSimulatorStep.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StopDebuggerStep.java110
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StopSimulatorStep.java90
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/WaitForReadyStep.java10
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/utils/SimulatorUtils.java50
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/activator/CoreBundleActivator.java242
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/ModelManager.java26
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/interfaces/runtime/IRuntimeModel.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/listener/ModelListener.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/nodes/ProcessContextNode.java20
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/RuntimeModel.java18
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelChannelService.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/steps/AttachStep.java34
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/steps/DetachStep.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/steps/TerminateStep.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/plugin.xml30
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/editor/ProcessMonitorEditorPage.java10
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/editor/tree/ContentProvider.java12
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/editor/tree/columns/PIDLabelProvider.java8
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/editor/tree/columns/PPIDLabelProvider.java8
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/AttachHandler.java24
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/ConfigIntervalDynamicContribution.java8
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/ConfigRefreshIntervalHandler.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/EditorHandlerDelegate.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/RefreshProcessListHandler.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/TerminateHandler.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/interfaces/IProcessMonitorUIDelegate.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/adapters/AdapterFactory.java10
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/dialogs/IntervalConfigDialog.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/properties/ContextPage.java12
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/properties/GeneralInformationPage.java16
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/BasicContextSection.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/BasicInformationSection.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/ContextIDSection.java14
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/IDSection.java12
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/MemorySection.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/navigator/runtime/ContentProvider.java8
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/navigator/runtime/LabelProviderDelegate.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/search/ProcessSearchable.java18
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.services.contexts/src/org/eclipse/tcf/te/tcf/services/contexts/internal/AdapterFactory.java184
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui/plugin.xml2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui/src/org/eclipse/tcf/te/tcf/terminals/ui/launcher/TerminalsLauncherDelegate.java10
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui/src/org/eclipse/tcf/te/tcf/terminals/ui/launcher/TerminalsMementoHandler.java22
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/ScriptPad.java18
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeerAction.java18
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeersSubMenuAction.java22
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PlayAction.java10
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.xml48
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/actions/AbstractPeerTypeToolbarAction.java64
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java22
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/DefaultContextStatusTrimControl.java14
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/dialogs/PeerSelectionDialog.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/dialogs/AgentSelectionDialog.java)131
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/dialogs/RedirectPeerSelectionDialog.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/dialogs/RedirectAgentSelectionDialog.java)142
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/AbstractConfigurationEditorPage.java19
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/OverviewEditorPage.java23
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/AttributesSection.java50
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/GeneralInformationSection.java57
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/ServicesSection.java30
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/TcpTransportSection.java46
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/TransportSection.java44
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/filter/PeersByCurrentUserFilter.java12
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/filter/RedirectPeersFilter.java96
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/filter/UnreachablePeersFilter.java104
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/AbstractPeerNodeEditorHandlerDelegate.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/AbstractPeerModelEditorHandlerDelegate.java)10
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/DeleteHandler.java120
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RedirectHandler.java46
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RefreshHandler.java24
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RenameHandler.java24
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/ResetRedirectHandler.java36
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/StartDebugCommandHandler.java22
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/help/IContextHelpIds.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/PropertyTester.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/adapters/AdapterFactory.java10
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/adapters/CategorizableAdapter.java33
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/adapters/EditorSaveAsAdapter.java26
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/adapters/PeerNodeFactory.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/adapters/PeerModelFactory.java)22
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/adapters/PersistablePeerNode.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/adapters/PersistablePeerModel.java)23
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/services/DefaultContextService.java70
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/tabbed/PeerGeneralSection.java10
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/tabbed/PeerGeneralSectionContentProvider.java12
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/tabbed/PeerGeneralSectionFilter.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ContentProvider.java150
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ModelListener.java22
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/PeerLabelProviderDelegate.java45
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/TreeViewerListener.java20
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/dnd/CommonDnD.java32
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/events/EventListener.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/filter/GenericFilter.java8
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/images/PeerImageDescriptor.java8
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/AbstractContextSelectorSection.java12
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/SimulatorTypeSelectionSection.java99
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/tabbed/BaseTitledSection.java18
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/AbstractConfigWizard.java26
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/NewTargetWizard.java14
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/AbstractConfigWizardPage.java14
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/NewTargetWizardPage.java10
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerExportWizardPage.java22
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerImportWizardPage.java32
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/TcfTestCase.java22
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/filesystem/FSPeerTestCase.java358
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/filesystem/adapters/AdaptersTests.java48
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/filesystem/adapters/PeerNodeViewerInputTest.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/filesystem/adapters/PeerModelViewerInputTest.java)46
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/filesystem/adapters/ViewerInputAdapterFactoryTest.java42
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/filesystem/testers/TargetPropertyTesterTest.java54
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/launch/TcfLaunchTests.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/processes/model/ProcessModelTestCase.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/tests/TcfStepperTests.java160
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/plugin.xml2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/plugin.xml4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/handler/AbstractEditorCommandHandler.java85
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/handler/AbstractStepperCommandHandler.java9
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/handler/ConnectableCommandHandler.java9
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/nls/Messages.java3
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/nls/Messages.properties4
211 files changed, 4976 insertions, 5947 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.model/src/org/eclipse/tcf/te/runtime/model/ModelNode.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.model/src/org/eclipse/tcf/te/runtime/model/ModelNode.java
index 5e025f0d6..34ba099db 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.model/src/org/eclipse/tcf/te/runtime/model/ModelNode.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.model/src/org/eclipse/tcf/te/runtime/model/ModelNode.java
@@ -120,7 +120,7 @@ public class ModelNode extends PropertiesContainer implements IModelNode, IModel
*/
@Override
public boolean isVisible() {
- return getBooleanProperty(PROPERTY_IS_VISIBLE);
+ return getBooleanProperty(PROPERTY_VISIBLE);
}
/* (non-Javadoc)
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.model/src/org/eclipse/tcf/te/runtime/model/interfaces/IModelNode.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.model/src/org/eclipse/tcf/te/runtime/model/interfaces/IModelNode.java
index 0fb549d40..fac1e816f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.model/src/org/eclipse/tcf/te/runtime/model/interfaces/IModelNode.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.model/src/org/eclipse/tcf/te/runtime/model/interfaces/IModelNode.java
@@ -28,24 +28,24 @@ public interface IModelNode extends IPropertiesContainer, ISchedulingRule {
* It can be identical to the node object instance UUID, but
* can be any other string or might be not even set.
*/
- public static final String PROPERTY_ID = "id"; //$NON-NLS-1$
+ public static final String PROPERTY_ID = "id" + PERSISTENT_PROPERTY; //$NON-NLS-1$
/**
* Property: Model node name. May be used to represent the node
* in UI widgets.
*/
- public static final String PROPERTY_NAME = "name"; //$NON-NLS-1$
+ public static final String PROPERTY_NAME = "name" + PERSISTENT_PROPERTY; //$NON-NLS-1$
/**
* Property: Model node visible state. May be used to hide the node
* in UI widgets like lists, tables or trees.
*/
- public static final String PROPERTY_IS_VISIBLE = "isVisible"; //$NON-NLS-1$
+ public static final String PROPERTY_VISIBLE = "visible" + PERSISTENT_PROPERTY; //$NON-NLS-1$
/**
* Property: Type. May be used to group nodes or set an node type id.
*/
- public static final String PROPERTY_TYPE = "type"; //$NON-NLS-1$
+ public static final String PROPERTY_TYPE = "type" + PERSISTENT_PROPERTY; //$NON-NLS-1$
/**
* Property: Type label. May be used to represent the group or node
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/interfaces/properties/IPropertiesContainer.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/interfaces/properties/IPropertiesContainer.java
index 53d902eb4..de8fe96b6 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/interfaces/properties/IPropertiesContainer.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/interfaces/properties/IPropertiesContainer.java
@@ -20,6 +20,17 @@ import org.eclipse.core.runtime.IAdaptable;
public interface IPropertiesContainer extends IAdaptable {
/**
+ * If a property key ends with ".silent", no change events will be fired.
+ */
+ public static final String SILENT_PROPERTY = ".silent"; //$NON-NLS-1$
+
+ /**
+ * If a property key ends with ".persistent", it should be persisted when the properties container is saved.
+ * This string should always be used at the end of all other property key extensions!
+ */
+ public static final String PERSISTENT_PROPERTY = ""; //$NON-NLS-1$
+
+ /**
* Returns the unique identified of the properties container.
*
* @return The unique identifier.
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/properties/PropertiesContainer.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/properties/PropertiesContainer.java
index 283458491..20b00f4c5 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/properties/PropertiesContainer.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/properties/PropertiesContainer.java
@@ -222,7 +222,7 @@ public class PropertiesContainer extends PlatformObject implements IPropertiesCo
protected boolean dropEvent(Object source, String key, Object oldValue, Object newValue) {
Assert.isNotNull(source);
Assert.isNotNull(key);
- return !changeEventsEnabled || key.endsWith(".silent"); //$NON-NLS-1$
+ return !changeEventsEnabled || key.endsWith(SILENT_PROPERTY);
}
/**
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/plugin.xml
index 21f8b39c8..4bd6a3acf 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/plugin.xml
@@ -1,63 +1,63 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
-
-<!-- Persistence delegate contributions -->
- <extension
- point="org.eclipse.tcf.te.runtime.persistence.delegates">
- <delegate
- class="org.eclipse.tcf.te.tcf.filesystem.core.internal.utils.PersistenceManagerDelegate"
- id="org.eclipse.tcf.te.tcf.filesystem.core.map">
- </delegate>
- </extension>
-
-<!-- Persistence delegate binding contributions -->
- <extension
- point="org.eclipse.tcf.te.runtime.persistence.bindings">
- <binding
- delegateId="org.eclipse.tcf.te.tcf.filesystem.core.map"
- id="org.eclipse.tcf.te.tcf.filesystem.core.map.binding">
- <enablement>
- <with variable="container">
- <instanceof
- value="java.net.URI">
- </instanceof>
- </with>
- <with variable="context">
- <instanceof
- value="org.eclipse.tcf.te.tcf.filesystem.core.internal.utils.PersistenceManager">
- </instanceof>
- </with>
- </enablement>
- </binding>
- </extension>
-
-<!-- Property tester contributions -->
- <extension point="org.eclipse.core.expressions.propertyTesters">
- <propertyTester
- class="org.eclipse.tcf.te.tcf.filesystem.core.internal.testers.FSTreeNodePropertyTester"
- id="org.eclipse.tcf.te.tcf.filesystem.propertytester.treenode"
- namespace="org.eclipse.tcf.te.tcf.filesystem.propertytester.treenode"
- properties="isFile,isDirectory,isBinaryFile,isReadable,isWritable,isExecutable,isRoot,isReadOnly,isHidden,isWindows,testParent,getCacheState,isSystemRoot"
- type="org.eclipse.tcf.te.tcf.filesystem.core.model.FSTreeNode">
- </propertyTester>
- <propertyTester
- class="org.eclipse.tcf.te.tcf.filesystem.core.internal.testers.TargetPropertyTester"
- id="org.eclipse.tcf.te.tcf.filesystem.propertytester.peer"
- namespace="org.eclipse.tcf.te.tcf.filesystem.propertytester.peer"
- properties="isWindows"
- type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
- </propertyTester>
- </extension>
-
-<!-- Launch Step contributions -->
- <extension point="org.eclipse.tcf.te.runtime.stepper.steps">
- <step
- id="org.eclipse.tcf.te.tcf.filesystem.core.fileTransferStep"
- class="org.eclipse.tcf.te.tcf.filesystem.core.steps.FileTransferStep"
- label="%FileTransferStep.name">
- <requires id="org.eclipse.tcf.te.tcf.core.openChannelStep"/>
- </step>
- </extension>
-
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+<!-- Persistence delegate contributions -->
+ <extension
+ point="org.eclipse.tcf.te.runtime.persistence.delegates">
+ <delegate
+ class="org.eclipse.tcf.te.tcf.filesystem.core.internal.utils.PersistenceManagerDelegate"
+ id="org.eclipse.tcf.te.tcf.filesystem.core.map">
+ </delegate>
+ </extension>
+
+<!-- Persistence delegate binding contributions -->
+ <extension
+ point="org.eclipse.tcf.te.runtime.persistence.bindings">
+ <binding
+ delegateId="org.eclipse.tcf.te.tcf.filesystem.core.map"
+ id="org.eclipse.tcf.te.tcf.filesystem.core.map.binding">
+ <enablement>
+ <with variable="container">
+ <instanceof
+ value="java.net.URI">
+ </instanceof>
+ </with>
+ <with variable="context">
+ <instanceof
+ value="org.eclipse.tcf.te.tcf.filesystem.core.internal.utils.PersistenceManager">
+ </instanceof>
+ </with>
+ </enablement>
+ </binding>
+ </extension>
+
+<!-- Property tester contributions -->
+ <extension point="org.eclipse.core.expressions.propertyTesters">
+ <propertyTester
+ class="org.eclipse.tcf.te.tcf.filesystem.core.internal.testers.FSTreeNodePropertyTester"
+ id="org.eclipse.tcf.te.tcf.filesystem.propertytester.treenode"
+ namespace="org.eclipse.tcf.te.tcf.filesystem.propertytester.treenode"
+ properties="isFile,isDirectory,isBinaryFile,isReadable,isWritable,isExecutable,isRoot,isReadOnly,isHidden,isWindows,testParent,getCacheState,isSystemRoot"
+ type="org.eclipse.tcf.te.tcf.filesystem.core.model.FSTreeNode">
+ </propertyTester>
+ <propertyTester
+ class="org.eclipse.tcf.te.tcf.filesystem.core.internal.testers.TargetPropertyTester"
+ id="org.eclipse.tcf.te.tcf.filesystem.propertytester.peer"
+ namespace="org.eclipse.tcf.te.tcf.filesystem.propertytester.peer"
+ properties="isWindows"
+ type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode">
+ </propertyTester>
+ </extension>
+
+<!-- Launch Step contributions -->
+ <extension point="org.eclipse.tcf.te.runtime.stepper.steps">
+ <step
+ id="org.eclipse.tcf.te.tcf.filesystem.core.fileTransferStep"
+ class="org.eclipse.tcf.te.tcf.filesystem.core.steps.FileTransferStep"
+ label="%FileTransferStep.name">
+ <requires id="org.eclipse.tcf.te.tcf.core.openChannelStep"/>
+ </step>
+ </extension>
+
+</plugin>
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 88ad44f73..27b79ea54 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
@@ -26,8 +26,8 @@ import org.eclipse.tcf.te.tcf.filesystem.core.internal.testers.TargetPropertyTes
import org.eclipse.tcf.te.tcf.filesystem.core.internal.utils.CacheManager;
import org.eclipse.tcf.te.tcf.filesystem.core.model.FSModel;
import org.eclipse.tcf.te.tcf.filesystem.core.model.FSTreeNode;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelLookupService;
import org.eclipse.tcf.te.tcf.locator.model.Model;
/**
@@ -35,7 +35,7 @@ import org.eclipse.tcf.te.tcf.locator.model.Model;
*/
public class OpParsePath extends Operation {
// The peer on which the file is located.
- IPeerModel peer;
+ IPeerNode peer;
// The path on the target.
String path;
// The parsing result.
@@ -47,7 +47,7 @@ public class OpParsePath extends Operation {
* @param peer The target peer.
* @param path The path to be parsed.
*/
- public OpParsePath(IPeerModel peer, String path) {
+ public OpParsePath(IPeerNode peer, String path) {
this.peer = peer;
this.path = path;
}
@@ -66,21 +66,21 @@ public class OpParsePath extends Operation {
String peerId = filePath.substring(0, slash);
peerId = peerId.replace(CacheManager.PATH_ESCAPE_CHAR, ':');
- final AtomicReference<IPeerModel> peerModel = new AtomicReference<IPeerModel>();
+ final AtomicReference<IPeerNode> peerNode = new AtomicReference<IPeerNode>();
final String finPeerId = peerId;
Runnable runnable = new Runnable() {
@Override
public void run() {
- peerModel.set(Model.getModel().getService(ILocatorModelLookupService.class).lkupPeerModelById(finPeerId));
+ peerNode.set(Model.getModel().getService(IPeerModelLookupService.class).lkupPeerModelById(finPeerId));
}
};
if (Protocol.isDispatchThread()) runnable.run();
else Protocol.invokeAndWait(runnable);
- this.peer = peerModel.get();
+ this.peer = peerNode.get();
if (peer != null) {
boolean hostWindows = Host.isWindowsHost();
boolean windows = TargetPropertyTester.isWindows(peer);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpUser.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpUser.java
index 1a43504b4..316eb1fcd 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpUser.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpUser.java
@@ -1,167 +1,167 @@
-/*******************************************************************************
- * Copyright (c) 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.filesystem.core.internal.operations;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.tcf.protocol.IChannel;
-import org.eclipse.tcf.protocol.IToken;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.services.IFileSystem;
-import org.eclipse.tcf.services.IFileSystem.DoneUser;
-import org.eclipse.tcf.services.IFileSystem.FileSystemException;
-import org.eclipse.tcf.te.tcf.core.Tcf;
-import org.eclipse.tcf.te.tcf.filesystem.core.activator.CorePlugin;
-import org.eclipse.tcf.te.tcf.filesystem.core.internal.exceptions.TCFException;
-import org.eclipse.tcf.te.tcf.filesystem.core.internal.exceptions.TCFFileSystemException;
-import org.eclipse.tcf.te.tcf.filesystem.core.model.UserAccount;
-import org.eclipse.tcf.te.tcf.filesystem.core.nls.Messages;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-
-/**
- * The operation to get the user account of a specified peer.
- */
-public class OpUser extends Operation {
- // The key to save and retrieve the user account in a peer model.
- /* default */ static final String USER_ACCOUNT_KEY = CorePlugin.getUniqueIdentifier()+".user.account"; //$NON-NLS-1$
-
- // The target peer.
- IPeerModel peerNode;
- // The resulting account.
- UserAccount result;
-
- /**
- * Create an operation using the target peer.
- * @param peerNode The peer whose user account to be checked.
- */
- public OpUser(IPeerModel peerNode) {
- this.peerNode = peerNode;
- }
-
- /**
- * Get the checking result.
- *
- * @return The user account checked.
- */
- public UserAccount getUserAccount() {
- return result;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.filesystem.core.internal.operations.Operation#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- if(peerNode != null) {
- result = getUserFromPeer(peerNode);
- if (result == null) {
- final UserAccount[] accounts = new UserAccount[1];
- IChannel channel = null;
- try {
- channel = Operation.openChannel(peerNode.getPeer());
- if (channel != null) {
- accounts[0] = getUserByChannel(channel);
- if (accounts[0] != null) setUserToPeer(peerNode, accounts[0]);
- }
- }
- catch (TCFException e) {
- throw new InvocationTargetException(e);
- }
- finally {
- if (channel != null) Tcf.getChannelManager().closeChannel(channel);
- }
- result = accounts[0];
- }
- }
- }
-
- /**
- * Get the user account from the peer using the channel connected to the
- * remote target.
- *
- * @param channel
- * The channel connected to the remote target.
- * @return The user account information or null if it fails.
- */
- UserAccount getUserByChannel(final IChannel channel) throws TCFFileSystemException {
- IFileSystem service = Operation.getBlockingFileSystem(channel);
- if (service != null) {
- final TCFFileSystemException[] errors = new TCFFileSystemException[1];
- final UserAccount[] accounts = new UserAccount[1];
- service.user(new DoneUser() {
- @Override
- public void doneUser(IToken token, FileSystemException error, int real_uid, int effective_uid, int real_gid, int effective_gid, String home) {
- if (error == null) {
- accounts[0] = new UserAccount(real_uid, real_gid, effective_uid, effective_gid, home);
- }else {
- errors[0] = newTCFException(IStatus.WARNING, error);
- }
- }
- });
- if (errors[0] != null) {
- throw errors[0];
- }
- return accounts[0];
- }
- String message = NLS.bind(Messages.Operation_NoFileSystemError, channel.getRemotePeer().getID());
- throw new TCFFileSystemException(IStatus.ERROR, message);
- }
-
- /**
- * Get the user account stored in the specified peer model using a key named
- * "user.account" defined by the constant USER_ACCOUNT_KEY.
- *
- * @param peer
- * The peer model from which the user account is retrieved.
- * @return The user account if it exists or null if not.
- */
- private UserAccount getUserFromPeer(final IPeerModel peer) {
- Assert.isNotNull(peer);
- if (Protocol.isDispatchThread()) {
- return (UserAccount) peer.getProperty(USER_ACCOUNT_KEY);
- }
- final UserAccount[] accounts = new UserAccount[1];
- Protocol.invokeAndWait(new Runnable() {
- @Override
- public void run() {
- accounts[0] = (UserAccount) peer.getProperty(USER_ACCOUNT_KEY);
- }
- });
- return accounts[0];
- }
-
- /**
- * Save the user account to the specified peer model using a key named
- * "user.account" defined by the constant USER_ACCOUNT_KEY.
- *
- * @param peer
- * The peer model to which the user account is saved.
- */
- void setUserToPeer(final IPeerModel peer, final UserAccount account) {
- Assert.isNotNull(peer);
- Assert.isNotNull(account);
-
- if (Protocol.isDispatchThread()) {
- peer.setProperty(USER_ACCOUNT_KEY, account);
- } else {
- Protocol.invokeAndWait(new Runnable() {
- @Override
- public void run() {
- peer.setProperty(USER_ACCOUNT_KEY, account);
- }
- });
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 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.filesystem.core.internal.operations;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.tcf.protocol.IChannel;
+import org.eclipse.tcf.protocol.IToken;
+import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.services.IFileSystem;
+import org.eclipse.tcf.services.IFileSystem.DoneUser;
+import org.eclipse.tcf.services.IFileSystem.FileSystemException;
+import org.eclipse.tcf.te.tcf.core.Tcf;
+import org.eclipse.tcf.te.tcf.filesystem.core.activator.CorePlugin;
+import org.eclipse.tcf.te.tcf.filesystem.core.internal.exceptions.TCFException;
+import org.eclipse.tcf.te.tcf.filesystem.core.internal.exceptions.TCFFileSystemException;
+import org.eclipse.tcf.te.tcf.filesystem.core.model.UserAccount;
+import org.eclipse.tcf.te.tcf.filesystem.core.nls.Messages;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
+
+/**
+ * The operation to get the user account of a specified peer.
+ */
+public class OpUser extends Operation {
+ // The key to save and retrieve the user account in a peer model.
+ /* default */ static final String USER_ACCOUNT_KEY = CorePlugin.getUniqueIdentifier()+".user.account"; //$NON-NLS-1$
+
+ // The target peer.
+ IPeerNode peerNode;
+ // The resulting account.
+ UserAccount result;
+
+ /**
+ * Create an operation using the target peer.
+ * @param peerNode The peer whose user account to be checked.
+ */
+ public OpUser(IPeerNode peerNode) {
+ this.peerNode = peerNode;
+ }
+
+ /**
+ * Get the checking result.
+ *
+ * @return The user account checked.
+ */
+ public UserAccount getUserAccount() {
+ return result;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.tcf.te.tcf.filesystem.core.internal.operations.Operation#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ if(peerNode != null) {
+ result = getUserFromPeer(peerNode);
+ if (result == null) {
+ final UserAccount[] accounts = new UserAccount[1];
+ IChannel channel = null;
+ try {
+ channel = Operation.openChannel(peerNode.getPeer());
+ if (channel != null) {
+ accounts[0] = getUserByChannel(channel);
+ if (accounts[0] != null) setUserToPeer(peerNode, accounts[0]);
+ }
+ }
+ catch (TCFException e) {
+ throw new InvocationTargetException(e);
+ }
+ finally {
+ if (channel != null) Tcf.getChannelManager().closeChannel(channel);
+ }
+ result = accounts[0];
+ }
+ }
+ }
+
+ /**
+ * Get the user account from the peer using the channel connected to the
+ * remote target.
+ *
+ * @param channel
+ * The channel connected to the remote target.
+ * @return The user account information or null if it fails.
+ */
+ UserAccount getUserByChannel(final IChannel channel) throws TCFFileSystemException {
+ IFileSystem service = Operation.getBlockingFileSystem(channel);
+ if (service != null) {
+ final TCFFileSystemException[] errors = new TCFFileSystemException[1];
+ final UserAccount[] accounts = new UserAccount[1];
+ service.user(new DoneUser() {
+ @Override
+ public void doneUser(IToken token, FileSystemException error, int real_uid, int effective_uid, int real_gid, int effective_gid, String home) {
+ if (error == null) {
+ accounts[0] = new UserAccount(real_uid, real_gid, effective_uid, effective_gid, home);
+ }else {
+ errors[0] = newTCFException(IStatus.WARNING, error);
+ }
+ }
+ });
+ if (errors[0] != null) {
+ throw errors[0];
+ }
+ return accounts[0];
+ }
+ String message = NLS.bind(Messages.Operation_NoFileSystemError, channel.getRemotePeer().getID());
+ throw new TCFFileSystemException(IStatus.ERROR, message);
+ }
+
+ /**
+ * Get the user account stored in the specified peer model using a key named
+ * "user.account" defined by the constant USER_ACCOUNT_KEY.
+ *
+ * @param peer
+ * The peer model from which the user account is retrieved.
+ * @return The user account if it exists or null if not.
+ */
+ private UserAccount getUserFromPeer(final IPeerNode peer) {
+ Assert.isNotNull(peer);
+ if (Protocol.isDispatchThread()) {
+ return (UserAccount) peer.getProperty(USER_ACCOUNT_KEY);
+ }
+ final UserAccount[] accounts = new UserAccount[1];
+ Protocol.invokeAndWait(new Runnable() {
+ @Override
+ public void run() {
+ accounts[0] = (UserAccount) peer.getProperty(USER_ACCOUNT_KEY);
+ }
+ });
+ return accounts[0];
+ }
+
+ /**
+ * Save the user account to the specified peer model using a key named
+ * "user.account" defined by the constant USER_ACCOUNT_KEY.
+ *
+ * @param peer
+ * The peer model to which the user account is saved.
+ */
+ void setUserToPeer(final IPeerNode peer, final UserAccount account) {
+ Assert.isNotNull(peer);
+ Assert.isNotNull(account);
+
+ if (Protocol.isDispatchThread()) {
+ peer.setProperty(USER_ACCOUNT_KEY, account);
+ } else {
+ Protocol.invokeAndWait(new Runnable() {
+ @Override
+ public void run() {
+ peer.setProperty(USER_ACCOUNT_KEY, account);
+ }
+ });
+ }
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/testers/TargetPropertyTester.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/testers/TargetPropertyTester.java
index c7775f6c6..5f240fce1 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/testers/TargetPropertyTester.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/testers/TargetPropertyTester.java
@@ -1,68 +1,68 @@
-/*******************************************************************************
- * 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.filesystem.core.internal.testers;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-
-/**
- * The property tester to test if the target OS is a Windows OS.
- */
-public class TargetPropertyTester extends PropertyTester {
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
- */
- @Override
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- if(receiver instanceof IPeerModel) {
- final IPeerModel peerModel = (IPeerModel) receiver;
- if(property.equals("isWindows")) { //$NON-NLS-1$
- return isWindows(peerModel);
- }
- }
- return false;
- }
-
- /**
- * Test if the target represented by the peer model is a windows target.
- *
- * @param peerModel The peer model of the target.
- * @return true if it is a windows target.
- */
- public static boolean isWindows(final IPeerModel peerModel) {
- final String osName = getOSName(peerModel);
- return osName == null ? false : (osName.startsWith("Windows")); //$NON-NLS-1$
- }
-
- /**
- * Get the OS name from the peer model.
- *
- * @param peerModel The peer model.
- * @return OS name.
- */
- public static String getOSName(final IPeerModel peerModel) {
- final String[] osName = new String[1];
- if (Protocol.isDispatchThread()) {
- osName[0] = peerModel.getPeer().getOSName();
- }
- else {
- Protocol.invokeAndWait(new Runnable() {
- @Override
- public void run() {
- osName[0] = peerModel.getPeer().getOSName();
- }
- });
- }
- return osName[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.filesystem.core.internal.testers;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
+
+/**
+ * The property tester to test if the target OS is a Windows OS.
+ */
+public class TargetPropertyTester extends PropertyTester {
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
+ */
+ @Override
+ public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+ if(receiver instanceof IPeerNode) {
+ final IPeerNode peerNode = (IPeerNode) receiver;
+ if(property.equals("isWindows")) { //$NON-NLS-1$
+ return isWindows(peerNode);
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Test if the target represented by the peer model is a windows target.
+ *
+ * @param peerNode The peer model of the target.
+ * @return true if it is a windows target.
+ */
+ public static boolean isWindows(final IPeerNode peerNode) {
+ final String osName = getOSName(peerNode);
+ return osName == null ? false : (osName.startsWith("Windows")); //$NON-NLS-1$
+ }
+
+ /**
+ * Get the OS name from the peer model.
+ *
+ * @param peerNode The peer model.
+ * @return OS name.
+ */
+ public static String getOSName(final IPeerNode peerNode) {
+ final String[] osName = new String[1];
+ if (Protocol.isDispatchThread()) {
+ osName[0] = peerNode.getPeer().getOSName();
+ }
+ else {
+ Protocol.invokeAndWait(new Runnable() {
+ @Override
+ public void run() {
+ osName[0] = peerNode.getPeer().getOSName();
+ }
+ });
+ }
+ return osName[0];
+ }
+}
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 33fc6a3f1..fe60d29ad 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
@@ -32,8 +32,8 @@ import org.eclipse.tcf.te.tcf.core.Tcf;
import org.eclipse.tcf.te.tcf.filesystem.core.internal.exceptions.TCFChannelException;
import org.eclipse.tcf.te.tcf.filesystem.core.internal.operations.Operation;
import org.eclipse.tcf.te.tcf.filesystem.core.nls.Messages;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelLookupService;
import org.eclipse.tcf.te.tcf.locator.model.Model;
/**
@@ -117,7 +117,7 @@ public class TcfURLConnection extends URLConnection {
public void run() {
IPeer p = Protocol.getLocator().getPeers().get(peerId);
if (p == null) {
- IPeerModel peerNode = Model.getModel().getService(ILocatorModelLookupService.class).lkupPeerModelById(peerId);
+ IPeerNode peerNode = Model.getModel().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.core/src/org/eclipse/tcf/te/tcf/filesystem/core/model/AbstractTreeNode.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/model/AbstractTreeNode.java
index d0172ba98..9e490d632 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/model/AbstractTreeNode.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/model/AbstractTreeNode.java
@@ -23,7 +23,7 @@ import org.eclipse.tcf.te.tcf.core.Tcf;
import org.eclipse.tcf.te.tcf.core.interfaces.IChannelManager.DoneOpenChannel;
import org.eclipse.tcf.te.tcf.filesystem.core.internal.operations.NullOpExecutor;
import org.eclipse.tcf.te.tcf.filesystem.core.internal.operations.OpUser;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
/**
* The base class of FSTreeNode and ProcessTreeNode which provides base members and methods.
@@ -45,7 +45,7 @@ public abstract class AbstractTreeNode extends PlatformObject {
/**
* The peer node the file system tree node is associated with.
*/
- public IPeerModel peerNode = null;
+ public IPeerNode peerNode = null;
/**
* Flag to mark once the children of the node got queried
@@ -130,7 +130,7 @@ public abstract class AbstractTreeNode extends PlatformObject {
* @param peerNode The peer node of the TCF agent.
* @return The user account that runs the agent.
*/
- protected UserAccount getUserAccount(IPeerModel peerNode) {
+ protected UserAccount getUserAccount(IPeerNode peerNode) {
OpUser user = new OpUser(peerNode);
new NullOpExecutor().execute(user);
return user.getUserAccount();
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/model/FSModel.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/model/FSModel.java
index 1c5229336..890ce3c3a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/model/FSModel.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/model/FSModel.java
@@ -14,7 +14,7 @@ import java.util.concurrent.atomic.AtomicReference;
import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.te.tcf.filesystem.core.activator.CorePlugin;
import org.eclipse.tcf.te.tcf.filesystem.core.nls.Messages;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
/**
* The file system model implementation.
@@ -26,19 +26,19 @@ public final class FSModel implements ITreeNodeModel {
* Get the file system model of the peer model. If it does not
* exist yet, create a new instance and store it.
*
- * @param peerModel The peer model
+ * @param peerNode The peer model
* @return The file system model connected this peer model.
*/
- public static FSModel getFSModel(final IPeerModel peerModel) {
+ public static FSModel getFSModel(final IPeerNode peerNode) {
final AtomicReference<FSModel> model = new AtomicReference<FSModel>();
Runnable runnable = new Runnable() {
@Override
public void run() {
- if (peerModel != null) {
- model.set((FSModel) peerModel.getProperty(FSMODEL_KEY));
+ if (peerNode != null) {
+ model.set((FSModel) peerNode.getProperty(FSMODEL_KEY));
if (model.get() == null) {
- model.set(new FSModel(peerModel));
- peerModel.setProperty(FSMODEL_KEY, model.get());
+ model.set(new FSModel(peerNode));
+ peerNode.setProperty(FSMODEL_KEY, model.get());
}
}
}
@@ -52,11 +52,11 @@ public final class FSModel implements ITreeNodeModel {
// The root node of the peer model
private FSTreeNode root;
- private IPeerModel peerNode;
+ private IPeerNode peerNode;
/**
* Create a File System Model.
*/
- /* default */ FSModel(IPeerModel peerNode) {
+ /* default */ FSModel(IPeerNode peerNode) {
this.peerNode = peerNode;
}
@@ -100,7 +100,7 @@ public final class FSModel implements ITreeNodeModel {
* @param peerNode The peer.
* @return The root file system node.
*/
- public static FSTreeNode createRootNode(IPeerModel peerNode) {
+ public static FSTreeNode createRootNode(IPeerNode peerNode) {
FSTreeNode node = new FSTreeNode();
node.type = "FSRootNode"; //$NON-NLS-1$
node.peerNode = peerNode;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/plugin.xml
index a621432cc..ca4084052 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/plugin.xml
@@ -27,7 +27,7 @@
priority="normal">
<triggerPoints>
<instanceof
- value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode">
</instanceof>
<test
property="org.eclipse.tcf.te.tcf.locator.hasRemoteService"
@@ -112,7 +112,7 @@
pageId="org.eclipse.tcf.te.tcf.filesystem.FSExplorerEditorPage">
<enablement>
<with variable="activeEditorInput">
- <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
+ <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode"/>
<test property="org.eclipse.tcf.te.tcf.locator.hasRemoteService" value="FileSystem"/>
<test
property="org.eclipse.tcf.te.runtime.preference"
@@ -1680,10 +1680,10 @@
<adapter type="org.eclipse.ui.IPersistableElement"/>
<adapter type="org.eclipse.tcf.te.ui.interfaces.ILazyLoader"/>
<adapter type="org.eclipse.tcf.te.ui.interfaces.ISearchable"/>
- <adapter type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider"/>
+ <adapter type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProvider"/>
</factory>
<factory
- adaptableType="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"
+ adaptableType="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode"
class="org.eclipse.tcf.te.tcf.filesystem.ui.internal.adapters.ViewerInputAdapterFactory">
<adapter
type="org.eclipse.tcf.te.core.interfaces.IViewerInput">
@@ -1878,7 +1878,7 @@
visibleInUI="true">
<activation>
<with variable="input">
- <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode">
<test property="org.eclipse.tcf.te.tcf.filesystem.propertytester.peer.isWindows" />
</adapt>
</with>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/controls/FSNavigatorContentProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/controls/FSNavigatorContentProvider.java
index dabcbf046..01f7f9f22 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/controls/FSNavigatorContentProvider.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/controls/FSNavigatorContentProvider.java
@@ -1,86 +1,86 @@
-/*******************************************************************************
- * 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.filesystem.ui.controls;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.tcf.te.tcf.filesystem.core.model.FSModel;
-import org.eclipse.tcf.te.tcf.filesystem.core.model.FSTreeNode;
-import org.eclipse.tcf.te.tcf.filesystem.core.model.ITreeNodeModel;
-import org.eclipse.tcf.te.tcf.filesystem.ui.activator.UIPlugin;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-
-
-/**
- * File system content provider for the common navigator of Target Explorer.
- */
-public class FSNavigatorContentProvider extends NavigatorContentProvider {
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.trees.TreeContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- @Override
- public void inputChanged(final Viewer viewer, Object oldInput, Object newInput) {
- super.inputChanged(viewer, oldInput, newInput);
- UIPlugin.getClipboard().addPropertyChangeListener(commonViewerListener);
- UIPlugin plugin = UIPlugin.getDefault();
- IPreferenceStore preferenceStore = plugin.getPreferenceStore();
- preferenceStore.addPropertyChangeListener(commonViewerListener);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.trees.TreeContentProvider#dispose()
- */
- @Override
- public void dispose() {
- UIPlugin.getClipboard().removePropertyChangeListener(commonViewerListener);
- UIPlugin plugin = UIPlugin.getDefault();
- IPreferenceStore preferenceStore = plugin.getPreferenceStore();
- preferenceStore.removePropertyChangeListener(commonViewerListener);
- super.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
- */
- @Override
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof FSTreeNode) {
- FSTreeNode node = (FSTreeNode)parentElement;
- if (node.isFile()) return NO_ELEMENTS;
- }
- return super.getChildren(parentElement);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.filesystem.ui.controls.NavigatorContentProvider#doGetModel(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel)
- */
- @Override
- protected ITreeNodeModel doGetModel(IPeerModel peerNode) {
- return FSModel.getFSModel(peerNode);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
- */
- @Override
- public boolean hasChildren(final Object element) {
- if (element instanceof FSTreeNode) {
- FSTreeNode node = (FSTreeNode)element;
- if(node.isFile()) {
- return false;
- }
- }
- return super.hasChildren(element);
- }
-}
+/*******************************************************************************
+ * 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.filesystem.ui.controls;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.tcf.te.tcf.filesystem.core.model.FSModel;
+import org.eclipse.tcf.te.tcf.filesystem.core.model.FSTreeNode;
+import org.eclipse.tcf.te.tcf.filesystem.core.model.ITreeNodeModel;
+import org.eclipse.tcf.te.tcf.filesystem.ui.activator.UIPlugin;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
+
+
+/**
+ * File system content provider for the common navigator of Target Explorer.
+ */
+public class FSNavigatorContentProvider extends NavigatorContentProvider {
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.trees.TreeContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public void inputChanged(final Viewer viewer, Object oldInput, Object newInput) {
+ super.inputChanged(viewer, oldInput, newInput);
+ UIPlugin.getClipboard().addPropertyChangeListener(commonViewerListener);
+ UIPlugin plugin = UIPlugin.getDefault();
+ IPreferenceStore preferenceStore = plugin.getPreferenceStore();
+ preferenceStore.addPropertyChangeListener(commonViewerListener);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.trees.TreeContentProvider#dispose()
+ */
+ @Override
+ public void dispose() {
+ UIPlugin.getClipboard().removePropertyChangeListener(commonViewerListener);
+ UIPlugin plugin = UIPlugin.getDefault();
+ IPreferenceStore preferenceStore = plugin.getPreferenceStore();
+ preferenceStore.removePropertyChangeListener(commonViewerListener);
+ super.dispose();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
+ */
+ @Override
+ public Object[] getChildren(Object parentElement) {
+ if (parentElement instanceof FSTreeNode) {
+ FSTreeNode node = (FSTreeNode)parentElement;
+ if (node.isFile()) return NO_ELEMENTS;
+ }
+ return super.getChildren(parentElement);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.tcf.te.tcf.filesystem.ui.controls.NavigatorContentProvider#doGetModel(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode)
+ */
+ @Override
+ protected ITreeNodeModel doGetModel(IPeerNode peerNode) {
+ return FSModel.getFSModel(peerNode);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
+ */
+ @Override
+ public boolean hasChildren(final Object element) {
+ if (element instanceof FSTreeNode) {
+ FSTreeNode node = (FSTreeNode)element;
+ if(node.isFile()) {
+ return false;
+ }
+ }
+ return super.hasChildren(element);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/controls/NavigatorContentProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/controls/NavigatorContentProvider.java
index d6bb7a3fa..2d6f04816 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/controls/NavigatorContentProvider.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/controls/NavigatorContentProvider.java
@@ -18,7 +18,7 @@ import org.eclipse.jface.viewers.TreeExpansionEvent;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.tcf.te.tcf.filesystem.core.model.AbstractTreeNode;
import org.eclipse.tcf.te.tcf.filesystem.core.model.ITreeNodeModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
/**
@@ -96,8 +96,8 @@ public abstract class NavigatorContentProvider extends TreeContentProvider impl
public Object[] getChildren(Object parentElement) {
super.getChildren(parentElement);
- if (parentElement instanceof IPeerModel) {
- final IPeerModel peerNode = (IPeerModel)parentElement;
+ if (parentElement instanceof IPeerNode) {
+ final IPeerNode peerNode = (IPeerNode)parentElement;
ITreeNodeModel model = doGetModel(peerNode);
if (isRootNodeVisible()) {
AbstractTreeNode root = model.getRoot();
@@ -128,7 +128,7 @@ public abstract class NavigatorContentProvider extends TreeContentProvider impl
* @param peerNode The peer node from where to get the model.
* @return The tree node model.
*/
- protected abstract ITreeNodeModel doGetModel(IPeerModel peerNode);
+ protected abstract ITreeNodeModel doGetModel(IPeerNode peerNode);
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
@@ -148,9 +148,9 @@ public abstract class NavigatorContentProvider extends TreeContentProvider impl
hasChildren = !node.childrenQueried || super.hasChildren(element);
}
}
- else if (element instanceof IPeerModel) {
- IPeerModel peerModel = (IPeerModel) element;
- ITreeNodeModel model = doGetModel(peerModel);
+ else if (element instanceof IPeerNode) {
+ IPeerNode peerNode = (IPeerNode) element;
+ ITreeNodeModel model = doGetModel(peerNode);
AbstractTreeNode root = model.getRoot();
hasChildren = root != null ? hasChildren(root) : true;
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/dialogs/FSOpenFileDialog.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/dialogs/FSOpenFileDialog.java
index 23ed94811..c2e51d531 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/dialogs/FSOpenFileDialog.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/dialogs/FSOpenFileDialog.java
@@ -33,7 +33,7 @@ import org.eclipse.tcf.te.tcf.filesystem.ui.controls.FSTreeViewerSorter;
import org.eclipse.tcf.te.tcf.filesystem.ui.interfaces.IFSConstants;
import org.eclipse.tcf.te.tcf.filesystem.ui.internal.columns.FSTreeElementLabelProvider;
import org.eclipse.tcf.te.tcf.filesystem.ui.nls.Messages;
-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.ui.trees.FilterDescriptor;
import org.eclipse.tcf.te.ui.trees.Pending;
import org.eclipse.tcf.te.ui.trees.ViewerStateManager;
@@ -117,9 +117,9 @@ public class FSOpenFileDialog extends ElementTreeSelectionDialog {
if (filterPath != null && !"".equals(filterPath.trim())) { //$NON-NLS-1$
IPath path = new Path(filterPath);
- if (viewer.getInput() instanceof IPeerModel) {
+ if (viewer.getInput() instanceof IPeerNode) {
Object element = null;
- FSModel model = FSModel.getFSModel((IPeerModel)viewer.getInput());
+ FSModel model = FSModel.getFSModel((IPeerNode)viewer.getInput());
if (model != null) {
FSTreeNode root = model.getRoot();
ITreeContentProvider contentProvider = (ITreeContentProvider)viewer.getContentProvider();
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/adapters/FSTreeNodeAdapterFactory.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/adapters/FSTreeNodeAdapterFactory.java
index 5c9c6772e..647c2974c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/adapters/FSTreeNodeAdapterFactory.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/adapters/FSTreeNodeAdapterFactory.java
@@ -21,8 +21,8 @@ import org.eclipse.tcf.te.tcf.filesystem.core.model.FSTreeNode;
import org.eclipse.tcf.te.tcf.filesystem.ui.activator.UIPlugin;
import org.eclipse.tcf.te.tcf.filesystem.ui.internal.columns.FSTreeElementLabelProvider;
import org.eclipse.tcf.te.tcf.filesystem.ui.internal.search.FSTreeNodeSearchable;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProvider;
import org.eclipse.tcf.te.ui.interfaces.ILazyLoader;
import org.eclipse.tcf.te.ui.interfaces.ISearchable;
import org.eclipse.ui.IActionFilter;
@@ -36,13 +36,13 @@ public class FSTreeNodeAdapterFactory implements IAdapterFactory {
// The fFilters map caching fFilters for FS nodes.
private Map<FSTreeNode, NodeStateFilter> filters;
- public static class FSTreeNodePeerModelProvider extends PlatformObject implements IPeerModelProvider {
+ public static class FSTreeNodePeerNodeProvider extends PlatformObject implements IPeerNodeProvider {
private final FSTreeNode node;
/**
* Constructor
*/
- public FSTreeNodePeerModelProvider(FSTreeNode node) {
+ public FSTreeNodePeerNodeProvider(FSTreeNode node) {
Assert.isNotNull(node);
this.node = node;
}
@@ -57,10 +57,10 @@ public class FSTreeNodeAdapterFactory implements IAdapterFactory {
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider#getPeerModel()
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProvider#getPeerModel()
*/
@Override
- public final IPeerModel getPeerModel() {
+ public final IPeerNode getPeerModel() {
return node.peerNode;
}
}
@@ -97,8 +97,8 @@ public class FSTreeNodeAdapterFactory implements IAdapterFactory {
else if (adapterType == ILazyLoader.class) {
return new FSTreeNodeLoader(node);
}
- else if (adapterType == IPeerModelProvider.class) {
- return new FSTreeNodePeerModelProvider(node);
+ else if (adapterType == IPeerNodeProvider.class) {
+ return new FSTreeNodePeerNodeProvider(node);
}
else if (adapterType == ISearchable.class) {
return new FSTreeNodeSearchable(node);
@@ -113,6 +113,6 @@ public class FSTreeNodeAdapterFactory implements IAdapterFactory {
*/
@Override
public Class[] getAdapterList() {
- return new Class[] { IActionFilter.class, ILabelProvider.class, IPersistableElement.class, ILazyLoader.class, ISearchable.class, IPeerModelProvider.class };
+ return new Class[] { IActionFilter.class, ILabelProvider.class, IPersistableElement.class, ILazyLoader.class, ISearchable.class, IPeerNodeProvider.class };
}
}
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 41b2ff90d..28d3a43cd 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
@@ -15,8 +15,8 @@ import org.eclipse.tcf.te.tcf.filesystem.core.internal.operations.IOpExecutor;
import org.eclipse.tcf.te.tcf.filesystem.core.internal.operations.NullOpExecutor;
import org.eclipse.tcf.te.tcf.filesystem.core.internal.operations.OpParsePath;
import org.eclipse.tcf.te.tcf.filesystem.core.model.FSModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelLookupService;
import org.eclipse.tcf.te.tcf.locator.model.Model;
import org.eclipse.ui.IElementFactory;
import org.eclipse.ui.IMemento;
@@ -33,13 +33,13 @@ public class FSTreeNodeFactory implements IElementFactory {
@Override
public IAdaptable createElement(IMemento memento) {
String peerId = memento.getString("peerId"); //$NON-NLS-1$
- IPeerModel peerModel = Model.getModel().getService(ILocatorModelLookupService.class).lkupPeerModelById(peerId);
- if(peerModel != null) {
+ IPeerNode peerNode = Model.getModel().getService(IPeerModelLookupService.class).lkupPeerModelById(peerId);
+ if(peerNode != null) {
String path = memento.getString("path"); //$NON-NLS-1$
if(path == null) {
- return FSModel.getFSModel(peerModel).getRoot();
+ return FSModel.getFSModel(peerNode).getRoot();
}
- OpParsePath op = new OpParsePath(peerModel, path);
+ OpParsePath op = new OpParsePath(peerNode, path);
IOpExecutor executor = new NullOpExecutor();
IStatus status = executor.execute(op);
if(status.isOK()) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/adapters/PeerModelViewerInput.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/adapters/PeerNodeViewerInput.java
index 9647c23c7..119bd25d9 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/adapters/PeerModelViewerInput.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/adapters/PeerNodeViewerInput.java
@@ -1,40 +1,40 @@
-/*******************************************************************************
- * 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.filesystem.ui.internal.adapters;
-
-import org.eclipse.tcf.te.core.interfaces.IViewerInput;
-import org.eclipse.tcf.te.core.utils.PropertyChangeProvider;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-
-/**
- * The viewer input of an IPeerModel instance.
- */
-public class PeerModelViewerInput extends PropertyChangeProvider implements IViewerInput {
- // The peer model.
- private IPeerModel peerModel;
-
- /**
- * Create an instance with a peer model.
- *
- * @param peerModel The peer model.
- */
- public PeerModelViewerInput(IPeerModel peerModel) {
- this.peerModel = peerModel;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.interfaces.IViewerInput#getInputId()
- */
- @Override
- public String getInputId() {
- return peerModel.getPeerId();
- }
-}
+/*******************************************************************************
+ * 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.filesystem.ui.internal.adapters;
+
+import org.eclipse.tcf.te.core.interfaces.IViewerInput;
+import org.eclipse.tcf.te.core.utils.PropertyChangeProvider;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
+
+/**
+ * The viewer input of an IPeerNode instance.
+ */
+public class PeerNodeViewerInput extends PropertyChangeProvider implements IViewerInput {
+ // The peer model.
+ private IPeerNode peerNode;
+
+ /**
+ * Create an instance with a peer model.
+ *
+ * @param peerNode The peer model.
+ */
+ public PeerNodeViewerInput(IPeerNode peerNode) {
+ this.peerNode = peerNode;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.interfaces.IViewerInput#getInputId()
+ */
+ @Override
+ public String getInputId() {
+ return peerNode.getPeerId();
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/adapters/ViewerInputAdapterFactory.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/adapters/ViewerInputAdapterFactory.java
index 9ea010e75..730b93328 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/adapters/ViewerInputAdapterFactory.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/adapters/ViewerInputAdapterFactory.java
@@ -1,81 +1,81 @@
-/*******************************************************************************
- * 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.filesystem.ui.internal.adapters;
-
-import java.util.concurrent.atomic.AtomicReference;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.core.interfaces.IPropertyChangeProvider;
-import org.eclipse.tcf.te.core.interfaces.IViewerInput;
-import org.eclipse.tcf.te.tcf.filesystem.ui.activator.UIPlugin;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-
-/**
- * The adapter factory for IViewerInput.
- */
-public class ViewerInputAdapterFactory implements IAdapterFactory {
- // The key to store and access the the viewer input object.
- private static final String VIEWER_INPUT_KEY = UIPlugin.getUniqueIdentifier()+".peer.viewerInput"; //$NON-NLS-1$
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
- */
- @Override
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if(adaptableObject instanceof IPeerModel) {
- if (IViewerInput.class.equals(adapterType)
- || IPropertyChangeProvider.class.equals(adapterType)) {
- IPeerModel peerModel = (IPeerModel) adaptableObject;
- return getViewerInput(peerModel);
- }
- }
- return null;
- }
-
- /**
- * Get a viewer input from the specified peer model.
- *
- * @param peerModel The peer model to get the viewer input from.
- * @return The peer model's viewer input.
- */
- PeerModelViewerInput getViewerInput(final IPeerModel peerModel) {
- if (peerModel != null) {
- if (Protocol.isDispatchThread()) {
- PeerModelViewerInput model = (PeerModelViewerInput) peerModel.getProperty(VIEWER_INPUT_KEY);
- if (model == null) {
- model = new PeerModelViewerInput(peerModel);
- peerModel.setProperty(VIEWER_INPUT_KEY, model);
- }
- return model;
- }
- final AtomicReference<PeerModelViewerInput> reference = new AtomicReference<PeerModelViewerInput>();
- Protocol.invokeAndWait(new Runnable() {
- @Override
- public void run() {
- reference.set(getViewerInput(peerModel));
- }
- });
- return reference.get();
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
- */
- @Override
- public Class[] getAdapterList() {
- return new Class[] { IViewerInput.class, IPropertyChangeProvider.class };
- }
-
-}
+/*******************************************************************************
+ * 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.filesystem.ui.internal.adapters;
+
+import java.util.concurrent.atomic.AtomicReference;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.te.core.interfaces.IPropertyChangeProvider;
+import org.eclipse.tcf.te.core.interfaces.IViewerInput;
+import org.eclipse.tcf.te.tcf.filesystem.ui.activator.UIPlugin;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
+
+/**
+ * The adapter factory for IViewerInput.
+ */
+public class ViewerInputAdapterFactory implements IAdapterFactory {
+ // The key to store and access the the viewer input object.
+ private static final String VIEWER_INPUT_KEY = UIPlugin.getUniqueIdentifier()+".peer.viewerInput"; //$NON-NLS-1$
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
+ */
+ @Override
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
+ if(adaptableObject instanceof IPeerNode) {
+ if (IViewerInput.class.equals(adapterType)
+ || IPropertyChangeProvider.class.equals(adapterType)) {
+ IPeerNode peerNode = (IPeerNode) adaptableObject;
+ return getViewerInput(peerNode);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Get a viewer input from the specified peer model.
+ *
+ * @param peerNode The peer model to get the viewer input from.
+ * @return The peer model's viewer input.
+ */
+ PeerNodeViewerInput getViewerInput(final IPeerNode peerNode) {
+ if (peerNode != null) {
+ if (Protocol.isDispatchThread()) {
+ PeerNodeViewerInput model = (PeerNodeViewerInput) peerNode.getProperty(VIEWER_INPUT_KEY);
+ if (model == null) {
+ model = new PeerNodeViewerInput(peerNode);
+ peerNode.setProperty(VIEWER_INPUT_KEY, model);
+ }
+ return model;
+ }
+ final AtomicReference<PeerNodeViewerInput> reference = new AtomicReference<PeerNodeViewerInput>();
+ Protocol.invokeAndWait(new Runnable() {
+ @Override
+ public void run() {
+ reference.set(getViewerInput(peerNode));
+ }
+ });
+ return reference.get();
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
+ */
+ @Override
+ public Class[] getAdapterList() {
+ return new Class[] { IViewerInput.class, IPropertyChangeProvider.class };
+ }
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/handlers/MoveFilesHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/handlers/MoveFilesHandler.java
index 8cf95664e..9f8b01d22 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/handlers/MoveFilesHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/handlers/MoveFilesHandler.java
@@ -1,55 +1,55 @@
-/*******************************************************************************
- * 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.filesystem.ui.internal.handlers;
-
-import java.util.List;
-
-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.IStructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.tcf.te.tcf.filesystem.core.internal.operations.IOpExecutor;
-import org.eclipse.tcf.te.tcf.filesystem.core.internal.operations.OpMove;
-import org.eclipse.tcf.te.tcf.filesystem.core.model.FSTreeNode;
-import org.eclipse.tcf.te.tcf.filesystem.ui.dialogs.FSFolderSelectionDialog;
-import org.eclipse.tcf.te.tcf.filesystem.ui.internal.operations.UiExecutor;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.ui.handlers.HandlerUtil;
-/**
- * The handler that moves the selected files or folders to a destination folder.
- */
-public class MoveFilesHandler extends AbstractHandler {
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- */
- @Override
- public Object execute(ExecutionEvent event) throws ExecutionException {
- Shell shell = HandlerUtil.getActiveShellChecked(event);
- FSFolderSelectionDialog dialog = new FSFolderSelectionDialog(shell);
- IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
- List<FSTreeNode> nodes = selection.toList();
- IPeerModel peer = nodes.get(0).peerNode;
- dialog.setInput(peer);
- dialog.setMovedNodes(nodes);
- if (dialog.open() == Window.OK) {
- Object obj = dialog.getFirstResult();
- Assert.isTrue(obj instanceof FSTreeNode);
- FSTreeNode dest = (FSTreeNode) obj;
- IOpExecutor executor = new UiExecutor();
- executor.execute(new OpMove(nodes, dest, new MoveCopyCallback()));
- }
- return null;
- }
-}
+/*******************************************************************************
+ * 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.filesystem.ui.internal.handlers;
+
+import java.util.List;
+
+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.IStructuredSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.tcf.te.tcf.filesystem.core.internal.operations.IOpExecutor;
+import org.eclipse.tcf.te.tcf.filesystem.core.internal.operations.OpMove;
+import org.eclipse.tcf.te.tcf.filesystem.core.model.FSTreeNode;
+import org.eclipse.tcf.te.tcf.filesystem.ui.dialogs.FSFolderSelectionDialog;
+import org.eclipse.tcf.te.tcf.filesystem.ui.internal.operations.UiExecutor;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
+import org.eclipse.ui.handlers.HandlerUtil;
+/**
+ * The handler that moves the selected files or folders to a destination folder.
+ */
+public class MoveFilesHandler extends AbstractHandler {
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ */
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ Shell shell = HandlerUtil.getActiveShellChecked(event);
+ FSFolderSelectionDialog dialog = new FSFolderSelectionDialog(shell);
+ IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+ List<FSTreeNode> nodes = selection.toList();
+ IPeerNode peer = nodes.get(0).peerNode;
+ dialog.setInput(peer);
+ dialog.setMovedNodes(nodes);
+ if (dialog.open() == Window.OK) {
+ Object obj = dialog.getFirstResult();
+ Assert.isTrue(obj instanceof FSTreeNode);
+ FSTreeNode dest = (FSTreeNode) obj;
+ IOpExecutor executor = new UiExecutor();
+ executor.execute(new OpMove(nodes, dest, new MoveCopyCallback()));
+ }
+ return null;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/handlers/RefreshViewerHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/handlers/RefreshViewerHandler.java
index b3ee59200..2cbd52133 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/handlers/RefreshViewerHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/handlers/RefreshViewerHandler.java
@@ -1,46 +1,46 @@
-/*******************************************************************************
- * 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.filesystem.ui.internal.handlers;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.tcf.te.tcf.filesystem.core.internal.operations.IOpExecutor;
-import org.eclipse.tcf.te.tcf.filesystem.core.internal.operations.JobExecutor;
-import org.eclipse.tcf.te.tcf.filesystem.core.internal.operations.OpRefresh;
-import org.eclipse.tcf.te.tcf.filesystem.core.model.FSModel;
-import org.eclipse.tcf.te.tcf.filesystem.core.model.FSTreeNode;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * The action handler to refresh the whole file system tree.
- */
-public class RefreshViewerHandler extends AbstractHandler {
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- */
- @Override
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IEditorInput editorInput = HandlerUtil.getActiveEditorInputChecked(event);
- IPeerModel peer = (IPeerModel) editorInput.getAdapter(IPeerModel.class);
- if (peer != null) {
- FSTreeNode root = FSModel.getFSModel(peer).getRoot();
- if (root != null) {
- IOpExecutor executor = new JobExecutor();
- executor.execute(new OpRefresh(root));
- }
- }
- return null;
- }
-}
+/*******************************************************************************
+ * 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.filesystem.ui.internal.handlers;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.tcf.te.tcf.filesystem.core.internal.operations.IOpExecutor;
+import org.eclipse.tcf.te.tcf.filesystem.core.internal.operations.JobExecutor;
+import org.eclipse.tcf.te.tcf.filesystem.core.internal.operations.OpRefresh;
+import org.eclipse.tcf.te.tcf.filesystem.core.model.FSModel;
+import org.eclipse.tcf.te.tcf.filesystem.core.model.FSTreeNode;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * The action handler to refresh the whole file system tree.
+ */
+public class RefreshViewerHandler extends AbstractHandler {
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ */
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ IEditorInput editorInput = HandlerUtil.getActiveEditorInputChecked(event);
+ IPeerNode peer = (IPeerNode) editorInput.getAdapter(IPeerNode.class);
+ if (peer != null) {
+ FSTreeNode root = FSModel.getFSModel(peer).getRoot();
+ if (root != null) {
+ IOpExecutor executor = new JobExecutor();
+ executor.execute(new OpRefresh(root));
+ }
+ }
+ return null;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/pages/FSExplorerEditorPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/pages/FSExplorerEditorPage.java
index c23c01bbd..81cb41916 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/pages/FSExplorerEditorPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/pages/FSExplorerEditorPage.java
@@ -12,7 +12,7 @@ package org.eclipse.tcf.te.tcf.filesystem.ui.internal.pages;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.tcf.te.tcf.filesystem.core.model.FSModel;
import org.eclipse.tcf.te.tcf.filesystem.ui.nls.Messages;
-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.ui.views.editor.pages.TreeViewerExplorerEditorPage;
/**
* The editor page for the file system explorer.
@@ -62,10 +62,10 @@ public class FSExplorerEditorPage extends TreeViewerExplorerEditorPage {
@Override
protected Object getViewerInput() {
Object element = getEditorInputNode();
- IPeerModel peerModel = element instanceof IPeerModel ? (IPeerModel)element : null;
- if (peerModel == null && element instanceof IAdaptable) {
- peerModel = (IPeerModel)((IAdaptable)element).getAdapter(IPeerModel.class);
+ IPeerNode peerNode = element instanceof IPeerNode ? (IPeerNode)element : null;
+ if (peerNode == null && element instanceof IAdaptable) {
+ peerNode = (IPeerNode)((IAdaptable)element).getAdapter(IPeerNode.class);
}
- return peerModel != null ? FSModel.getFSModel(peerModel).getRoot() : null;
+ return peerNode != null ? FSModel.getFSModel(peerNode).getRoot() : null;
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/tabbed/BasicFolderSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/tabbed/BasicFolderSection.java
index 1376ff9be..9336a1e0c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/tabbed/BasicFolderSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/tabbed/BasicFolderSection.java
@@ -18,9 +18,9 @@ import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
import org.eclipse.tcf.te.tcf.filesystem.core.model.FSTreeNode;
-import org.eclipse.tcf.te.tcf.filesystem.ui.internal.adapters.FSTreeNodeAdapterFactory.FSTreeNodePeerModelProvider;
+import org.eclipse.tcf.te.tcf.filesystem.ui.internal.adapters.FSTreeNodeAdapterFactory.FSTreeNodePeerNodeProvider;
import org.eclipse.tcf.te.tcf.filesystem.ui.nls.Messages;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProvider;
import org.eclipse.tcf.te.tcf.ui.tabbed.BaseTitledSection;
import org.eclipse.tcf.te.ui.swt.SWTControlUtil;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
@@ -63,9 +63,9 @@ public class BasicFolderSection extends BaseTitledSection {
* @see org.eclipse.tcf.te.ui.views.tabbed.BaseTitledSection#updateData(org.eclipse.tcf.te.ui.interfaces.IPropertyChangeProvider)
*/
@Override
- protected void updateInput(IPeerModelProvider input) {
- Assert.isTrue(input instanceof FSTreeNodePeerModelProvider);
- this.node = ((FSTreeNodePeerModelProvider)input).getFSTreeNode();
+ protected void updateInput(IPeerNodeProvider input) {
+ Assert.isTrue(input instanceof FSTreeNodePeerNodeProvider);
+ this.node = ((FSTreeNodePeerNodeProvider)input).getFSTreeNode();
this.clone = (FSTreeNode) node.clone();
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/tabbed/LinuxPermissionsSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/tabbed/LinuxPermissionsSection.java
index 519ecfaa7..f95012413 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/tabbed/LinuxPermissionsSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/tabbed/LinuxPermissionsSection.java
@@ -18,9 +18,9 @@ import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.tcf.te.tcf.filesystem.core.model.FSTreeNode;
-import org.eclipse.tcf.te.tcf.filesystem.ui.internal.adapters.FSTreeNodeAdapterFactory.FSTreeNodePeerModelProvider;
+import org.eclipse.tcf.te.tcf.filesystem.ui.internal.adapters.FSTreeNodeAdapterFactory.FSTreeNodePeerNodeProvider;
import org.eclipse.tcf.te.tcf.filesystem.ui.nls.Messages;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProvider;
import org.eclipse.tcf.te.tcf.ui.tabbed.BaseTitledSection;
import org.eclipse.tcf.te.ui.swt.SWTControlUtil;
import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
@@ -109,9 +109,9 @@ public class LinuxPermissionsSection extends BaseTitledSection {
* @see org.eclipse.tcf.te.ui.views.tabbed.BaseTitledSection#updateData(org.eclipse.tcf.te.ui.interfaces.IPropertyChangeProvider)
*/
@Override
- protected void updateInput(IPeerModelProvider input) {
- Assert.isTrue(input instanceof FSTreeNodePeerModelProvider);
- this.node = ((FSTreeNodePeerModelProvider)input).getFSTreeNode();
+ protected void updateInput(IPeerNodeProvider input) {
+ Assert.isTrue(input instanceof FSTreeNodePeerNodeProvider);
+ this.node = ((FSTreeNodePeerNodeProvider)input).getFSTreeNode();
this.clone = (FSTreeNode) node.clone();
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/tabbed/WindowsAttributesCESection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/tabbed/WindowsAttributesCESection.java
index 2a555f1bb..852bda7d4 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/tabbed/WindowsAttributesCESection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/tabbed/WindowsAttributesCESection.java
@@ -17,9 +17,9 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.tcf.te.tcf.filesystem.core.interfaces.IWindowsFileAttributes;
import org.eclipse.tcf.te.tcf.filesystem.core.model.FSTreeNode;
-import org.eclipse.tcf.te.tcf.filesystem.ui.internal.adapters.FSTreeNodeAdapterFactory.FSTreeNodePeerModelProvider;
+import org.eclipse.tcf.te.tcf.filesystem.ui.internal.adapters.FSTreeNodeAdapterFactory.FSTreeNodePeerNodeProvider;
import org.eclipse.tcf.te.tcf.filesystem.ui.nls.Messages;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProvider;
import org.eclipse.tcf.te.tcf.ui.tabbed.BaseTitledSection;
import org.eclipse.tcf.te.ui.swt.SWTControlUtil;
import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
@@ -66,9 +66,9 @@ public class WindowsAttributesCESection extends BaseTitledSection {
* @see org.eclipse.tcf.te.ui.views.tabbed.BaseTitledSection#updateData(org.eclipse.tcf.te.ui.interfaces.IPropertyChangeProvider)
*/
@Override
- protected void updateInput(IPeerModelProvider input) {
- Assert.isTrue(input instanceof FSTreeNodePeerModelProvider);
- this.node = ((FSTreeNodePeerModelProvider)input).getFSTreeNode();
+ protected void updateInput(IPeerNodeProvider input) {
+ Assert.isTrue(input instanceof FSTreeNodePeerNodeProvider);
+ this.node = ((FSTreeNodePeerNodeProvider)input).getFSTreeNode();
}
/*
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/tabbed/WindowsAttributesSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/tabbed/WindowsAttributesSection.java
index 02298c6d9..cda8af8b4 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/tabbed/WindowsAttributesSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/tabbed/WindowsAttributesSection.java
@@ -16,9 +16,9 @@ import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.tcf.te.tcf.filesystem.core.model.FSTreeNode;
-import org.eclipse.tcf.te.tcf.filesystem.ui.internal.adapters.FSTreeNodeAdapterFactory.FSTreeNodePeerModelProvider;
+import org.eclipse.tcf.te.tcf.filesystem.ui.internal.adapters.FSTreeNodeAdapterFactory.FSTreeNodePeerNodeProvider;
import org.eclipse.tcf.te.tcf.filesystem.ui.nls.Messages;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProvider;
import org.eclipse.tcf.te.tcf.ui.tabbed.BaseTitledSection;
import org.eclipse.tcf.te.ui.swt.SWTControlUtil;
import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
@@ -65,9 +65,9 @@ public class WindowsAttributesSection extends BaseTitledSection {
* @see org.eclipse.tcf.te.ui.views.tabbed.BaseTitledSection#updateData(org.eclipse.tcf.te.ui.interfaces.IPropertyChangeProvider)
*/
@Override
- protected void updateInput(IPeerModelProvider input) {
- Assert.isTrue(input instanceof FSTreeNodePeerModelProvider);
- this.node = ((FSTreeNodePeerModelProvider)input).getFSTreeNode();
+ protected void updateInput(IPeerNodeProvider input) {
+ Assert.isTrue(input instanceof FSTreeNodePeerNodeProvider);
+ this.node = ((FSTreeNodePeerNodeProvider)input).getFSTreeNode();
this.clone = (FSTreeNode) node.clone();
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/tabbed/WindowsFolderAISection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/tabbed/WindowsFolderAISection.java
index a3e421b0e..0ed1f1b0a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/tabbed/WindowsFolderAISection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/tabbed/WindowsFolderAISection.java
@@ -17,9 +17,9 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.tcf.te.tcf.filesystem.core.interfaces.IWindowsFileAttributes;
import org.eclipse.tcf.te.tcf.filesystem.core.model.FSTreeNode;
-import org.eclipse.tcf.te.tcf.filesystem.ui.internal.adapters.FSTreeNodeAdapterFactory.FSTreeNodePeerModelProvider;
+import org.eclipse.tcf.te.tcf.filesystem.ui.internal.adapters.FSTreeNodeAdapterFactory.FSTreeNodePeerNodeProvider;
import org.eclipse.tcf.te.tcf.filesystem.ui.nls.Messages;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProvider;
import org.eclipse.tcf.te.tcf.ui.tabbed.BaseTitledSection;
import org.eclipse.tcf.te.ui.swt.SWTControlUtil;
import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
@@ -86,9 +86,9 @@ public class WindowsFolderAISection extends BaseTitledSection {
* @see org.eclipse.tcf.te.ui.views.tabbed.BaseTitledSection#updateData(org.eclipse.tcf.te.ui.interfaces.IPropertyChangeProvider)
*/
@Override
- protected void updateInput(IPeerModelProvider input) {
- Assert.isTrue(input instanceof FSTreeNodePeerModelProvider);
- this.node = ((FSTreeNodePeerModelProvider)input).getFSTreeNode();
+ protected void updateInput(IPeerNodeProvider input) {
+ Assert.isTrue(input instanceof FSTreeNodePeerNodeProvider);
+ this.node = ((FSTreeNodePeerNodeProvider)input).getFSTreeNode();
}
/*
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/NewNodeWizard.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/NewNodeWizard.java
index 6d9d1031b..68a106cd9 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/NewNodeWizard.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/NewNodeWizard.java
@@ -20,8 +20,8 @@ import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.te.tcf.filesystem.core.internal.operations.OpCreate;
import org.eclipse.tcf.te.tcf.filesystem.core.model.FSTreeNode;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProperties;
+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.ui.views.editor.pages.TreeViewerExplorerEditorPage;
import org.eclipse.tcf.te.ui.wizards.AbstractWizard;
import org.eclipse.ui.INewWizard;
@@ -40,7 +40,7 @@ public abstract class NewNodeWizard extends AbstractWizard implements INewWizard
// The folder in which the new node is created.
private FSTreeNode folder;
// The target peer where the new node is created.
- private IPeerModel peer;
+ private IPeerNode peer;
// The wizard page used to create the new node.
private NewNodeWizardPage newPage;
@@ -70,9 +70,9 @@ public abstract class NewNodeWizard extends AbstractWizard implements INewWizard
}
peer = folder.peerNode;
}
- else if (element instanceof IPeerModel) {
- if(hasFileSystem((IPeerModel) element)) {
- peer = (IPeerModel) element;
+ else if (element instanceof IPeerNode) {
+ if(hasFileSystem((IPeerNode) element)) {
+ peer = (IPeerNode) element;
}
}
}
@@ -84,10 +84,10 @@ public abstract class NewNodeWizard extends AbstractWizard implements INewWizard
* @param peer The target peer.
* @return true if it has a file system service.
*/
- public boolean hasFileSystem(final IPeerModel peer) {
+ public boolean hasFileSystem(final IPeerNode peer) {
if(Protocol.isDispatchThread()) {
String services = null;
- services = peer.getStringProperty(IPeerModelProperties.PROP_REMOTE_SERVICES);
+ services = peer.getStringProperty(IPeerNodeProperties.PROP_REMOTE_SERVICES);
if (services != null) {
// Lookup each service individually
for (String service : services.split(",")) { //$NON-NLS-1$
@@ -225,7 +225,7 @@ public abstract class NewNodeWizard extends AbstractWizard implements INewWizard
*
* @return The target peer selected.
*/
- public IPeerModel getPeer(){
+ public IPeerNode getPeer(){
return peer;
}
@@ -234,7 +234,7 @@ public abstract class NewNodeWizard extends AbstractWizard implements INewWizard
*
* @param peer The newly selected target peer.
*/
- public void setPeer(IPeerModel peer) {
+ public void setPeer(IPeerNode peer) {
this.peer = peer;
newPage.setPeer(peer);
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/NewNodeWizardPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/NewNodeWizardPage.java
index 139f6b07a..7eb07a21a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/NewNodeWizardPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/NewNodeWizardPage.java
@@ -35,7 +35,7 @@ import org.eclipse.tcf.te.tcf.filesystem.ui.help.IContextHelpIds;
import org.eclipse.tcf.te.tcf.filesystem.ui.interfaces.IFSConstants;
import org.eclipse.tcf.te.tcf.filesystem.ui.internal.columns.FSTreeElementLabelProvider;
import org.eclipse.tcf.te.tcf.filesystem.ui.nls.Messages;
-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.ui.controls.BaseEditBrowseTextControl;
import org.eclipse.tcf.te.ui.forms.FormLayoutFactory;
import org.eclipse.tcf.te.ui.trees.FilterDescriptor;
@@ -172,7 +172,7 @@ public abstract class NewNodeWizardPage extends AbstractValidatingWizardPage {
treeViewer.setLabelProvider(createDecoratingLabelProvider(new FSTreeElementLabelProvider()));
treeViewer.setComparator(new FSTreeViewerSorter());
treeViewer.addFilter(new DirectoryFilter());
- IPeerModel peer = wizard.getPeer();
+ IPeerNode peer = wizard.getPeer();
if (peer != null) {
setInput(peer);
}
@@ -276,7 +276,7 @@ public abstract class NewNodeWizardPage extends AbstractValidatingWizardPage {
*
* @param peer The new target peer.
*/
- public void setPeer(IPeerModel peer) {
+ public void setPeer(IPeerNode peer) {
if (peer != null) {
setInput(peer);
}
@@ -345,7 +345,7 @@ public abstract class NewNodeWizardPage extends AbstractValidatingWizardPage {
*/
public FSTreeNode getInputDir() {
NewNodeWizard wizard = getWizard();
- IPeerModel peer = wizard.getPeer();
+ IPeerNode peer = wizard.getPeer();
if (peer == null) return null;
final String text = folderControl.getEditFieldControlText();
if (text != null) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/TargetPatternFilter.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/TargetPatternFilter.java
index 148d55b61..be97de72f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/TargetPatternFilter.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/TargetPatternFilter.java
@@ -11,7 +11,7 @@
package org.eclipse.tcf.te.tcf.filesystem.ui.internal.wizards;
import org.eclipse.jface.viewers.Viewer;
-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.ui.views.navigator.DelegatingLabelProvider;
import org.eclipse.ui.dialogs.PatternFilter;
@@ -37,7 +37,7 @@ public class TargetPatternFilter extends PatternFilter {
*/
@Override
public boolean isElementSelectable(Object element) {
- return element instanceof IPeerModel;
+ return element instanceof IPeerNode;
}
/*
@@ -46,7 +46,7 @@ public class TargetPatternFilter extends PatternFilter {
*/
@Override
protected boolean isLeafMatch(Viewer viewer, Object element) {
- if ( element instanceof IPeerModel) {
+ if ( element instanceof IPeerNode) {
String text = targetLabelProvider.getText(element);
if (wordMatches(text)) {
return true;
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 1bb6c1056..49b36bc30 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
@@ -36,9 +36,9 @@ import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.tcf.te.tcf.filesystem.ui.nls.Messages;
-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.ILocatorModelPeerNodeQueryService;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelQueryService;
import org.eclipse.tcf.te.tcf.locator.model.Model;
import org.eclipse.tcf.te.tcf.ui.navigator.ContentProvider;
import org.eclipse.tcf.te.ui.activator.UIPlugin;
@@ -99,12 +99,12 @@ public class TargetSelectionPage extends AbstractValidatingWizardPage {
*/
private void initialize() {
// Refresh the information of remote services.
- ILocatorModel model = Model.getModel();
+ IPeerModel model = Model.getModel();
Assert.isNotNull(model);
- IPeerModel[] peers = model.getPeers();
+ IPeerNode[] peers = model.getPeers();
if (peers != null) {
- ILocatorModelPeerNodeQueryService service = model.getService(ILocatorModelPeerNodeQueryService.class);
- for (IPeerModel peer : peers) {
+ IPeerModelQueryService service = model.getService(IPeerModelQueryService.class);
+ for (IPeerNode peer : peers) {
service.queryRemoteServices(peer);
}
}
@@ -178,8 +178,8 @@ public class TargetSelectionPage extends AbstractValidatingWizardPage {
ViewerFilter fsPeerFilter = new ViewerFilter() {
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
- if (element instanceof IPeerModel) {
- IPeerModel peer = (IPeerModel) element;
+ if (element instanceof IPeerNode) {
+ IPeerNode peer = (IPeerNode) element;
@@ -204,7 +204,7 @@ public class TargetSelectionPage extends AbstractValidatingWizardPage {
IStructuredSelection selection = (IStructuredSelection) event.getSelection();
// The tree is single selection, so look for the first element only.
Object element = selection.getFirstElement();
- if (element instanceof IPeerModel) {
+ if (element instanceof IPeerNode) {
// Double-click on a connection type is triggering the sub wizard
getWizard().getContainer().showPage(getNextPage());
}
@@ -220,7 +220,7 @@ public class TargetSelectionPage extends AbstractValidatingWizardPage {
treeViewer.setInput(Model.getModel());
NewNodeWizard wizard = getWizard();
- IPeerModel peer = wizard.getPeer();
+ IPeerNode peer = wizard.getPeer();
if (wizard.getPeer() != null) {
treeViewer.setSelection(new StructuredSelection(peer), true);
}
@@ -267,8 +267,8 @@ public class TargetSelectionPage extends AbstractValidatingWizardPage {
IStructuredSelection filteredTreeSelection = (IStructuredSelection) filteredTree
.getViewer().getSelection();
NewNodeWizard wizard = getWizard();
- if (filteredTreeSelection.getFirstElement() instanceof IPeerModel) {
- wizard.setPeer((IPeerModel) filteredTreeSelection.getFirstElement());
+ if (filteredTreeSelection.getFirstElement() instanceof IPeerNode) {
+ wizard.setPeer((IPeerNode) filteredTreeSelection.getFirstElement());
}
else {
wizard.setPeer(null);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/plugin.xml
index b83757d2d..3fbe5db4f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/plugin.xml
@@ -1,231 +1,231 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
-
-<!-- Adapter factory contributions -->
- <extension point="org.eclipse.core.runtime.adapters">
- <factory
- adaptableType="org.eclipse.debug.core.ILaunch"
- class="org.eclipse.tcf.te.tcf.launch.core.internal.adapters.AdapterFactory">
- <adapter type="org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext"/>
- </factory>
- <factory
- adaptableType="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"
- class="org.eclipse.tcf.te.tcf.launch.core.internal.adapters.AdapterFactory">
- <adapter type="org.eclipse.debug.core.ILaunchConfiguration"/>
- <adapter type="org.eclipse.debug.core.ILaunchConfigurationWorkingCopy"/>
- </factory>
- <factory
- adaptableType="org.eclipse.tcf.protocol.IPeer"
- class="org.eclipse.tcf.te.tcf.launch.core.internal.adapters.AdapterFactory">
- <adapter type="org.eclipse.debug.core.ILaunchConfiguration"/>
- <adapter type="org.eclipse.debug.core.ILaunchConfigurationWorkingCopy"/>
- </factory>
- </extension>
-
-<!-- Service contributions -->
- <extension point="org.eclipse.tcf.te.runtime.services.services">
- <service
- id="org.eclipse.tcf.te.tcf.launch.services.persistence.import"
- class="org.eclipse.tcf.te.tcf.launch.core.internal.services.ImportPersistenceService">
- <serviceType class="org.eclipse.tcf.te.tcf.core.interfaces.IImportPersistenceService"/>
- </service>
- <service
- id="org.eclipse.tcf.te.tcf.launch.services.persistence.export"
- class="org.eclipse.tcf.te.tcf.launch.core.internal.services.ExportPersistenceService">
- <serviceType class="org.eclipse.tcf.te.tcf.core.interfaces.IExportPersistenceService"/>
- </service>
- <service
- id="org.eclipse.tcf.te.tcf.launch.services.pathmap"
- class="org.eclipse.tcf.te.tcf.launch.core.internal.services.PathMapService">
- <serviceType class="org.eclipse.tcf.te.tcf.core.interfaces.IPathMapService"/>
- </service>
- </extension>
-
-<!-- Launch Configuration Type contributions -->
- <extension point="org.eclipse.debug.core.launchConfigurationTypes">
- <launchConfigurationType
- id="org.eclipse.tcf.te.tcf.launch.type.remote.app"
- sourceLocatorId="org.eclipse.tcf.debug.SourceLocator"
- sourcePathComputerId="org.eclipse.tcf.te.launch.core.sourcePathComputer"
- delegate="org.eclipse.tcf.te.tcf.launch.core.delegates.LaunchConfigurationDelegate"
- modes="run,debug"
- name="%LaunchType.Remote.App.name"/>
- <launchConfigurationType
- id="org.eclipse.tcf.te.tcf.launch.type.attach"
- public="false"
- sourceLocatorId="org.eclipse.tcf.debug.SourceLocator"
- sourcePathComputerId="org.eclipse.tcf.te.launch.core.sourcePathComputer"
- delegate="org.eclipse.tcf.te.tcf.launch.core.delegates.LaunchConfigurationDelegate"
- modes="debug"
- name="%LaunchType.Attach.name"/>
- </extension>
-
-<!-- Launch Configuration Type Binding contributions -->
- <extension point="org.eclipse.tcf.te.launch.core.launchConfigTypeBindings">
- <launchConfigTypeBinding launchConfigTypeId="org.eclipse.tcf.te.tcf.launch.type.remote.app">
- <launchManagerDelegate
- id="org.eclipse.tcf.te.tcf.launch.type.remote.app.launchManagerDelegate"
- modes="run"/>
- <stepGroup
- id="org.eclipse.tcf.te.tcf.launch.type.remote.app.stepGroup"
- modes="run"/>
- <enablement>
- <with variable="context">
- <or>
- <adapt type="org.eclipse.core.resources.IResource">
- <test property="org.eclipse.core.resources.projectNature" value="org.eclipse.cdt.core.cnature"/>
- </adapt>
- <and>
- <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
- <or>
- <test property="org.eclipse.tcf.te.tcf.locator.hasOfflineService" value="Processes"/>
- <test property="org.eclipse.tcf.te.tcf.locator.hasRemoteService" value="Processes"/>
- </or>
- </and>
- </or>
- </with>
- </enablement>
- </launchConfigTypeBinding>
- <launchConfigTypeBinding launchConfigTypeId="org.eclipse.tcf.te.tcf.launch.type.remote.app">
- <launchManagerDelegate
- id="org.eclipse.tcf.te.tcf.launch.type.remote.app.launchManagerDelegate"
- modes="debug"/>
- <stepGroup
- id="org.eclipse.tcf.te.tcf.launch.type.remote.app.stepGroup"
- modes="debug"/>
- <enablement>
- <with variable="context">
- <or>
- <adapt type="org.eclipse.core.resources.IResource">
- <test property="org.eclipse.core.resources.projectNature" value="org.eclipse.cdt.core.cnature"/>
- </adapt>
- <and>
- <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
- <or>
- <test property="org.eclipse.tcf.te.tcf.locator.hasOfflineService" value="Processes"/>
- <test property="org.eclipse.tcf.te.tcf.locator.hasRemoteService" value="Processes"/>
- </or>
- <or>
- <test property="org.eclipse.tcf.te.tcf.locator.hasOfflineService" value="RunControl"/>
- <test property="org.eclipse.tcf.te.tcf.locator.hasRemoteService" value="RunControl"/>
- </or>
- </and>
- </or>
- </with>
- </enablement>
- </launchConfigTypeBinding>
- <launchConfigTypeBinding launchConfigTypeId="org.eclipse.tcf.te.tcf.launch.type.attach">
- <launchManagerDelegate
- id="org.eclipse.tcf.te.tcf.launch.type.attach.launchManagerDelegate"
- modes="debug"/>
- <stepGroup
- id="org.eclipse.tcf.te.tcf.launch.type.attach.stepGroup"
- modes="debug"/>
- <enablement>
- <with variable="context">
- <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
- </with>
- </enablement>
- </launchConfigTypeBinding>
- </extension>
-
-<!-- Launch Manager Delegate contributions -->
- <extension point="org.eclipse.tcf.te.launch.core.launchManagerDelegates">
- <delegate
- class="org.eclipse.tcf.te.tcf.launch.core.lm.delegates.RemoteAppLaunchManagerDelegate"
- id="org.eclipse.tcf.te.tcf.launch.type.remote.app.launchManagerDelegate"/>
- <delegate
- class="org.eclipse.tcf.te.tcf.launch.core.lm.delegates.AttachLaunchManagerDelegate"
- id="org.eclipse.tcf.te.tcf.launch.type.attach.launchManagerDelegate"/>
- </extension>
-
-<!-- Launch Step Group contributions -->
- <extension point="org.eclipse.tcf.te.runtime.stepper.stepGroups">
- <stepGroup
- id="org.eclipse.tcf.te.tcf.launch.type.remote.app.stepGroup"
- label="%LaunchStepGroup.Remote.App.name"
- iterator="org.eclipse.tcf.te.launch.core.steps.iterators.LaunchContextIterator">
- <references>
- <reference id="org.eclipse.tcf.te.tcf.core.openChannelStep"/>
- <reference id="org.eclipse.tcf.te.tcf.launch.core.fileTransferStepGroup"/>
- <reference id="org.eclipse.tcf.te.tcf.launch.core.launchProcessStepGroup"/>
- <reference id="org.eclipse.tcf.te.tcf.launch.core.attachDebuggerStep">
- <enablement>
- <with variable="context">
- <test property="org.eclipse.tcf.te.launch.core.launchMode" value="debug"/>
- </with>
- </enablement>
- </reference>
- <reference id="org.eclipse.tcf.te.tcf.core.closeChannelStep"/>
- <reference id="org.eclipse.tcf.te.launch.core.removeLaunchStep">
- <enablement>
- <not>
- <test property="org.eclipse.tcf.te.launch.core.launchMode" value="debug"/>
- </not>
- </enablement>
- </reference>
- </references>
- </stepGroup>
- <stepGroup
- id="org.eclipse.tcf.te.tcf.launch.core.launchProcessStepGroup"
- label="%LaunchStepGroup.LaunchProcess.name"
- iterator="org.eclipse.tcf.te.tcf.launch.core.steps.iterators.LaunchProcessIterator">
- <references>
- <reference id="org.eclipse.tcf.te.tcf.locator.checkServiceStep">
- <parameter name="remoteService" value="Processes"/>
- </reference>
- <reference id="org.eclipse.tcf.te.tcf.locator.checkServiceStep">
- <parameter name="remoteService" value="RunControl"/>
- <enablement>
- <test property="org.eclipse.tcf.te.launch.core.launchMode" value="debug"/>
- </enablement>
- </reference>
- <reference id="org.eclipse.tcf.te.tcf.processes.core.launchProcessStep"/>
- <reference id="org.eclipse.tcf.te.tcf.processes.core.resumeProcessStep">
- <enablement>
- <test property="org.eclipse.tcf.te.launch.core.launchMode" value="debug"/>
- </enablement>
- </reference>
- </references>
- </stepGroup>
- <stepGroup
- id="org.eclipse.tcf.te.tcf.launch.core.fileTransferStepGroup"
- label="%LaunchStepGroup.FileTransfer.name"
- iterator="org.eclipse.tcf.te.tcf.launch.core.steps.iterators.FileTransferIterator">
- <references>
- <reference id="org.eclipse.tcf.te.tcf.locator.checkServiceStep">
- <parameter name="remoteService" value="FileSystem"/>
- </reference>
- <reference id="org.eclipse.tcf.te.tcf.filesystem.core.fileTransferStep"/>
- </references>
- </stepGroup>
-
- <stepGroup
- id="org.eclipse.tcf.te.tcf.launch.type.attach.stepGroup"
- label="%LaunchStepGroup.Attach.name"
- iterator="org.eclipse.tcf.te.launch.core.steps.iterators.LaunchContextIterator">
- <references>
- <reference id="org.eclipse.tcf.te.tcf.core.openChannelStep"/>
- <reference id="org.eclipse.tcf.te.tcf.locator.checkServiceStep">
- <parameter name="remoteService" value="RunControl"/>
- </reference>
- <reference id="org.eclipse.tcf.te.tcf.launch.core.attachDebuggerStep">
- <enablement>
- <test property="org.eclipse.tcf.te.launch.core.launchMode" value="debug"/>
- </enablement>
- </reference>
- <reference id="org.eclipse.tcf.te.tcf.core.closeChannelStep"/>
- </references>
- </stepGroup>
- </extension>
-
-<!-- Launch Step contributions -->
- <extension point="org.eclipse.tcf.te.runtime.stepper.steps">
- <step
- id="org.eclipse.tcf.te.tcf.launch.core.attachDebuggerStep"
- class="org.eclipse.tcf.te.tcf.launch.core.steps.AttachDebuggerStep"
- label="%LaunchStep.AttachDebugger.name"/>
- </extension>
-
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+<!-- Adapter factory contributions -->
+ <extension point="org.eclipse.core.runtime.adapters">
+ <factory
+ adaptableType="org.eclipse.debug.core.ILaunch"
+ class="org.eclipse.tcf.te.tcf.launch.core.internal.adapters.AdapterFactory">
+ <adapter type="org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext"/>
+ </factory>
+ <factory
+ adaptableType="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode"
+ class="org.eclipse.tcf.te.tcf.launch.core.internal.adapters.AdapterFactory">
+ <adapter type="org.eclipse.debug.core.ILaunchConfiguration"/>
+ <adapter type="org.eclipse.debug.core.ILaunchConfigurationWorkingCopy"/>
+ </factory>
+ <factory
+ adaptableType="org.eclipse.tcf.protocol.IPeer"
+ class="org.eclipse.tcf.te.tcf.launch.core.internal.adapters.AdapterFactory">
+ <adapter type="org.eclipse.debug.core.ILaunchConfiguration"/>
+ <adapter type="org.eclipse.debug.core.ILaunchConfigurationWorkingCopy"/>
+ </factory>
+ </extension>
+
+<!-- Service contributions -->
+ <extension point="org.eclipse.tcf.te.runtime.services.services">
+ <service
+ id="org.eclipse.tcf.te.tcf.launch.services.persistence.import"
+ class="org.eclipse.tcf.te.tcf.launch.core.internal.services.ImportPersistenceService">
+ <serviceType class="org.eclipse.tcf.te.tcf.core.interfaces.IImportPersistenceService"/>
+ </service>
+ <service
+ id="org.eclipse.tcf.te.tcf.launch.services.persistence.export"
+ class="org.eclipse.tcf.te.tcf.launch.core.internal.services.ExportPersistenceService">
+ <serviceType class="org.eclipse.tcf.te.tcf.core.interfaces.IExportPersistenceService"/>
+ </service>
+ <service
+ id="org.eclipse.tcf.te.tcf.launch.services.pathmap"
+ class="org.eclipse.tcf.te.tcf.launch.core.internal.services.PathMapService">
+ <serviceType class="org.eclipse.tcf.te.tcf.core.interfaces.IPathMapService"/>
+ </service>
+ </extension>
+
+<!-- Launch Configuration Type contributions -->
+ <extension point="org.eclipse.debug.core.launchConfigurationTypes">
+ <launchConfigurationType
+ id="org.eclipse.tcf.te.tcf.launch.type.remote.app"
+ sourceLocatorId="org.eclipse.tcf.debug.SourceLocator"
+ sourcePathComputerId="org.eclipse.tcf.te.launch.core.sourcePathComputer"
+ delegate="org.eclipse.tcf.te.tcf.launch.core.delegates.LaunchConfigurationDelegate"
+ modes="run,debug"
+ name="%LaunchType.Remote.App.name"/>
+ <launchConfigurationType
+ id="org.eclipse.tcf.te.tcf.launch.type.attach"
+ public="false"
+ sourceLocatorId="org.eclipse.tcf.debug.SourceLocator"
+ sourcePathComputerId="org.eclipse.tcf.te.launch.core.sourcePathComputer"
+ delegate="org.eclipse.tcf.te.tcf.launch.core.delegates.LaunchConfigurationDelegate"
+ modes="debug"
+ name="%LaunchType.Attach.name"/>
+ </extension>
+
+<!-- Launch Configuration Type Binding contributions -->
+ <extension point="org.eclipse.tcf.te.launch.core.launchConfigTypeBindings">
+ <launchConfigTypeBinding launchConfigTypeId="org.eclipse.tcf.te.tcf.launch.type.remote.app">
+ <launchManagerDelegate
+ id="org.eclipse.tcf.te.tcf.launch.type.remote.app.launchManagerDelegate"
+ modes="run"/>
+ <stepGroup
+ id="org.eclipse.tcf.te.tcf.launch.type.remote.app.stepGroup"
+ modes="run"/>
+ <enablement>
+ <with variable="context">
+ <or>
+ <adapt type="org.eclipse.core.resources.IResource">
+ <test property="org.eclipse.core.resources.projectNature" value="org.eclipse.cdt.core.cnature"/>
+ </adapt>
+ <and>
+ <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode"/>
+ <or>
+ <test property="org.eclipse.tcf.te.tcf.locator.hasOfflineService" value="Processes"/>
+ <test property="org.eclipse.tcf.te.tcf.locator.hasRemoteService" value="Processes"/>
+ </or>
+ </and>
+ </or>
+ </with>
+ </enablement>
+ </launchConfigTypeBinding>
+ <launchConfigTypeBinding launchConfigTypeId="org.eclipse.tcf.te.tcf.launch.type.remote.app">
+ <launchManagerDelegate
+ id="org.eclipse.tcf.te.tcf.launch.type.remote.app.launchManagerDelegate"
+ modes="debug"/>
+ <stepGroup
+ id="org.eclipse.tcf.te.tcf.launch.type.remote.app.stepGroup"
+ modes="debug"/>
+ <enablement>
+ <with variable="context">
+ <or>
+ <adapt type="org.eclipse.core.resources.IResource">
+ <test property="org.eclipse.core.resources.projectNature" value="org.eclipse.cdt.core.cnature"/>
+ </adapt>
+ <and>
+ <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode"/>
+ <or>
+ <test property="org.eclipse.tcf.te.tcf.locator.hasOfflineService" value="Processes"/>
+ <test property="org.eclipse.tcf.te.tcf.locator.hasRemoteService" value="Processes"/>
+ </or>
+ <or>
+ <test property="org.eclipse.tcf.te.tcf.locator.hasOfflineService" value="RunControl"/>
+ <test property="org.eclipse.tcf.te.tcf.locator.hasRemoteService" value="RunControl"/>
+ </or>
+ </and>
+ </or>
+ </with>
+ </enablement>
+ </launchConfigTypeBinding>
+ <launchConfigTypeBinding launchConfigTypeId="org.eclipse.tcf.te.tcf.launch.type.attach">
+ <launchManagerDelegate
+ id="org.eclipse.tcf.te.tcf.launch.type.attach.launchManagerDelegate"
+ modes="debug"/>
+ <stepGroup
+ id="org.eclipse.tcf.te.tcf.launch.type.attach.stepGroup"
+ modes="debug"/>
+ <enablement>
+ <with variable="context">
+ <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode"/>
+ </with>
+ </enablement>
+ </launchConfigTypeBinding>
+ </extension>
+
+<!-- Launch Manager Delegate contributions -->
+ <extension point="org.eclipse.tcf.te.launch.core.launchManagerDelegates">
+ <delegate
+ class="org.eclipse.tcf.te.tcf.launch.core.lm.delegates.RemoteAppLaunchManagerDelegate"
+ id="org.eclipse.tcf.te.tcf.launch.type.remote.app.launchManagerDelegate"/>
+ <delegate
+ class="org.eclipse.tcf.te.tcf.launch.core.lm.delegates.AttachLaunchManagerDelegate"
+ id="org.eclipse.tcf.te.tcf.launch.type.attach.launchManagerDelegate"/>
+ </extension>
+
+<!-- Launch Step Group contributions -->
+ <extension point="org.eclipse.tcf.te.runtime.stepper.stepGroups">
+ <stepGroup
+ id="org.eclipse.tcf.te.tcf.launch.type.remote.app.stepGroup"
+ label="%LaunchStepGroup.Remote.App.name"
+ iterator="org.eclipse.tcf.te.launch.core.steps.iterators.LaunchContextIterator">
+ <references>
+ <reference id="org.eclipse.tcf.te.tcf.core.openChannelStep"/>
+ <reference id="org.eclipse.tcf.te.tcf.launch.core.fileTransferStepGroup"/>
+ <reference id="org.eclipse.tcf.te.tcf.launch.core.launchProcessStepGroup"/>
+ <reference id="org.eclipse.tcf.te.tcf.launch.core.attachDebuggerStep">
+ <enablement>
+ <with variable="context">
+ <test property="org.eclipse.tcf.te.launch.core.launchMode" value="debug"/>
+ </with>
+ </enablement>
+ </reference>
+ <reference id="org.eclipse.tcf.te.tcf.core.closeChannelStep"/>
+ <reference id="org.eclipse.tcf.te.launch.core.removeLaunchStep">
+ <enablement>
+ <not>
+ <test property="org.eclipse.tcf.te.launch.core.launchMode" value="debug"/>
+ </not>
+ </enablement>
+ </reference>
+ </references>
+ </stepGroup>
+ <stepGroup
+ id="org.eclipse.tcf.te.tcf.launch.core.launchProcessStepGroup"
+ label="%LaunchStepGroup.LaunchProcess.name"
+ iterator="org.eclipse.tcf.te.tcf.launch.core.steps.iterators.LaunchProcessIterator">
+ <references>
+ <reference id="org.eclipse.tcf.te.tcf.locator.checkServiceStep">
+ <parameter name="remoteService" value="Processes"/>
+ </reference>
+ <reference id="org.eclipse.tcf.te.tcf.locator.checkServiceStep">
+ <parameter name="remoteService" value="RunControl"/>
+ <enablement>
+ <test property="org.eclipse.tcf.te.launch.core.launchMode" value="debug"/>
+ </enablement>
+ </reference>
+ <reference id="org.eclipse.tcf.te.tcf.processes.core.launchProcessStep"/>
+ <reference id="org.eclipse.tcf.te.tcf.processes.core.resumeProcessStep">
+ <enablement>
+ <test property="org.eclipse.tcf.te.launch.core.launchMode" value="debug"/>
+ </enablement>
+ </reference>
+ </references>
+ </stepGroup>
+ <stepGroup
+ id="org.eclipse.tcf.te.tcf.launch.core.fileTransferStepGroup"
+ label="%LaunchStepGroup.FileTransfer.name"
+ iterator="org.eclipse.tcf.te.tcf.launch.core.steps.iterators.FileTransferIterator">
+ <references>
+ <reference id="org.eclipse.tcf.te.tcf.locator.checkServiceStep">
+ <parameter name="remoteService" value="FileSystem"/>
+ </reference>
+ <reference id="org.eclipse.tcf.te.tcf.filesystem.core.fileTransferStep"/>
+ </references>
+ </stepGroup>
+
+ <stepGroup
+ id="org.eclipse.tcf.te.tcf.launch.type.attach.stepGroup"
+ label="%LaunchStepGroup.Attach.name"
+ iterator="org.eclipse.tcf.te.launch.core.steps.iterators.LaunchContextIterator">
+ <references>
+ <reference id="org.eclipse.tcf.te.tcf.core.openChannelStep"/>
+ <reference id="org.eclipse.tcf.te.tcf.locator.checkServiceStep">
+ <parameter name="remoteService" value="RunControl"/>
+ </reference>
+ <reference id="org.eclipse.tcf.te.tcf.launch.core.attachDebuggerStep">
+ <enablement>
+ <test property="org.eclipse.tcf.te.launch.core.launchMode" value="debug"/>
+ </enablement>
+ </reference>
+ <reference id="org.eclipse.tcf.te.tcf.core.closeChannelStep"/>
+ </references>
+ </stepGroup>
+ </extension>
+
+<!-- Launch Step contributions -->
+ <extension point="org.eclipse.tcf.te.runtime.stepper.steps">
+ <step
+ id="org.eclipse.tcf.te.tcf.launch.core.attachDebuggerStep"
+ class="org.eclipse.tcf.te.tcf.launch.core.steps.AttachDebuggerStep"
+ label="%LaunchStep.AttachDebugger.name"/>
+ </extension>
+
+</plugin>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/delegates/Launch.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/delegates/Launch.java
index d48ec0682..e69a77847 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/delegates/Launch.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/delegates/Launch.java
@@ -32,7 +32,7 @@ import org.eclipse.tcf.te.runtime.services.ServiceManager;
import org.eclipse.tcf.te.tcf.core.Tcf;
import org.eclipse.tcf.te.tcf.core.interfaces.IChannelManager;
import org.eclipse.tcf.te.tcf.core.interfaces.IPathMapGeneratorService;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
/**
* Default tcf launch implementation.
@@ -70,7 +70,7 @@ public final class Launch extends TCFLaunch {
*
* @param node The peer model node. Must not be <code>null</code>.
*/
- public void attachDebugger(IPeerModel node) {
+ public void attachDebugger(IPeerNode node) {
Assert.isNotNull(node);
final String name = node.getPeer().getName();
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 e8c6849ba..3db3549ff 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
@@ -23,8 +23,8 @@ import org.eclipse.tcf.protocol.IPeer;
import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.te.runtime.interfaces.IDisposable;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelLookupService;
import org.eclipse.tcf.te.tcf.locator.model.Model;
/**
@@ -97,12 +97,12 @@ public class AdapterFactory implements IAdapterFactory {
return adapter;
}
}
- else if (adaptableObject instanceof IPeerModel) {
+ else if (adaptableObject instanceof IPeerNode) {
if (ILaunchConfiguration.class.equals(adapterType)) {
- return attachLaunchConfigAdapter.getAttachLaunchConfig((IPeerModel)adaptableObject);
+ return attachLaunchConfigAdapter.getAttachLaunchConfig((IPeerNode)adaptableObject);
}
if (ILaunchConfigurationWorkingCopy.class.equals(adapterType)) {
- ILaunchConfiguration launchConfig = attachLaunchConfigAdapter.getAttachLaunchConfig((IPeerModel)adaptableObject);
+ ILaunchConfiguration launchConfig = attachLaunchConfigAdapter.getAttachLaunchConfig((IPeerNode)adaptableObject);
try {
return launchConfig.getWorkingCopy();
}
@@ -112,21 +112,21 @@ public class AdapterFactory implements IAdapterFactory {
}
}
else if (adaptableObject instanceof IPeer) {
- final ILocatorModelLookupService service = Model.getModel().getService(ILocatorModelLookupService.class);
- final AtomicReference<IPeerModel> peerModel = new AtomicReference<IPeerModel>();
+ final IPeerModelLookupService service = Model.getModel().getService(IPeerModelLookupService.class);
+ final AtomicReference<IPeerNode> peerNode = new AtomicReference<IPeerNode>();
if (service != null) {
Runnable runnable = new Runnable() {
@Override
public void run() {
- peerModel.set(service.lkupPeerModelById(((IPeer)adaptableObject).getID()));
+ peerNode.set(service.lkupPeerModelById(((IPeer)adaptableObject).getID()));
}
};
if (Protocol.isDispatchThread()) runnable.run();
else Protocol.invokeAndWait(runnable);
}
- if (peerModel.get() != null) return getAdapter(peerModel.get(), adapterType);
+ if (peerNode.get() != null) return getAdapter(peerNode.get(), adapterType);
}
return null;
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/adapters/AttachLaunchConfigAdapter.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/adapters/AttachLaunchConfigAdapter.java
index cdf6b882c..a6dd5ae42 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/adapters/AttachLaunchConfigAdapter.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/adapters/AttachLaunchConfigAdapter.java
@@ -21,14 +21,14 @@ import org.eclipse.tcf.te.launch.core.selection.LaunchSelection;
import org.eclipse.tcf.te.launch.core.selection.RemoteSelectionContext;
import org.eclipse.tcf.te.launch.core.selection.interfaces.ILaunchSelection;
import org.eclipse.tcf.te.tcf.launch.core.interfaces.ILaunchTypes;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
/**
* AttachLaunchConfigAdapter
*/
public class AttachLaunchConfigAdapter {
- public ILaunchConfiguration getAttachLaunchConfig(IPeerModel peer) {
+ public ILaunchConfiguration getAttachLaunchConfig(IPeerNode peer) {
ILaunchConfigurationType launchConfigType = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(ILaunchTypes.ATTACH);
ILaunchSelection launchSelection = new LaunchSelection(ILaunchManager.DEBUG_MODE, new RemoteSelectionContext(peer, true));
ILaunchManagerDelegate delegate = LaunchManager.getInstance().getLaunchManagerDelegate(launchConfigType, ILaunchManager.DEBUG_MODE);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/services/ExportPersistenceService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/services/ExportPersistenceService.java
index ea67e28fa..6cd0d6476 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/services/ExportPersistenceService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/services/ExportPersistenceService.java
@@ -23,7 +23,7 @@ import org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistenceDelegate;
import org.eclipse.tcf.te.runtime.persistence.services.URIPersistenceService;
import org.eclipse.tcf.te.tcf.core.interfaces.IExportPersistenceService;
import org.eclipse.tcf.te.tcf.launch.core.interfaces.ILaunchTypes;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
/**
* Persistence service implementation for import/export.
@@ -46,8 +46,8 @@ public class ExportPersistenceService extends URIPersistenceService implements I
throw new IOException("The persistence delegate for context '" + context.getClass().getName() + "' cannot be determined."); //$NON-NLS-1$ //$NON-NLS-2$
}
- if (context instanceof IPeerModel) {
- final IPeerModel node = (IPeerModel)context;
+ if (context instanceof IPeerNode) {
+ final IPeerNode node = (IPeerNode)context;
ILaunchConfiguration launchConfig = (ILaunchConfiguration)Platform.getAdapterManager().getAdapter(node, ILaunchConfiguration.class);
if (launchConfig != null) {
IPersistenceDelegate launchDelegate = PersistenceManager.getInstance().getDelegate(launchConfig, String.class);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/services/PathMapService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/services/PathMapService.java
index 353ff01ed..c79c4bf52 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/services/PathMapService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/services/PathMapService.java
@@ -41,8 +41,8 @@ import org.eclipse.tcf.te.tcf.core.Tcf;
import org.eclipse.tcf.te.tcf.core.interfaces.IPathMapGeneratorService;
import org.eclipse.tcf.te.tcf.core.interfaces.IPathMapService;
import org.eclipse.tcf.te.tcf.launch.core.activator.CoreBundleActivator;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProvider;
/**
* Path map service implementation.
@@ -307,8 +307,8 @@ public class PathMapService extends AbstractService implements IPathMapService {
Assert.isNotNull(callback);
IPeer peer = context instanceof IPeer ? (IPeer)context : null;
- if (peer == null && context instanceof IPeerModel) peer = ((IPeerModel)context).getPeer();
- if (peer == null && context instanceof IPeerModelProvider && ((IPeerModelProvider)context).getPeerModel() != null) peer = ((IPeerModelProvider)context).getPeerModel().getPeer();
+ if (peer == null && context instanceof IPeerNode) peer = ((IPeerNode)context).getPeer();
+ if (peer == null && context instanceof IPeerNodeProvider && ((IPeerNodeProvider)context).getPeerModel() != null) peer = ((IPeerNodeProvider)context).getPeerModel().getPeer();
if (peer != null) {
final IChannel channel = Tcf.getChannelManager().getChannel(peer);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/AbstractTcfLaunchStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/AbstractTcfLaunchStep.java
index 9b5b73147..0dfa6691b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/AbstractTcfLaunchStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/AbstractTcfLaunchStep.java
@@ -15,7 +15,7 @@ import org.eclipse.tcf.te.launch.core.steps.AbstractLaunchStep;
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.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
/**
* Abstract TCF launch step implementation.
@@ -30,16 +30,16 @@ public abstract class AbstractTcfLaunchStep extends AbstractLaunchStep {
* @param fullQualifiedId The full qualfied id for this step. Must not be <code>null</code>.
* @return The active peer model context.
*/
- protected IPeerModel getActivePeerModelContext(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId) {
+ protected IPeerNode getActivePeerModelContext(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId) {
Object activeContext = getActiveContext(context, data, fullQualifiedId);
- IPeerModel peerModel = null;
- if (activeContext instanceof IPeerModel)
- return (IPeerModel)activeContext;
+ IPeerNode peerNode = null;
+ if (activeContext instanceof IPeerNode)
+ return (IPeerNode)activeContext;
if (activeContext instanceof IAdaptable)
- peerModel = (IPeerModel)((IAdaptable)activeContext).getAdapter(IPeerModel.class);
- if (peerModel == null)
- peerModel = (IPeerModel)Platform.getAdapterManager().getAdapter(activeContext, IPeerModel.class);
+ peerNode = (IPeerNode)((IAdaptable)activeContext).getAdapter(IPeerNode.class);
+ if (peerNode == null)
+ peerNode = (IPeerNode)Platform.getAdapterManager().getAdapter(activeContext, IPeerNode.class);
- return peerModel;
+ return peerNode;
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/iterators/AbstractTcfLaunchStepGroupIterator.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/iterators/AbstractTcfLaunchStepGroupIterator.java
index 6f0a8b272..10bc9d76e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/iterators/AbstractTcfLaunchStepGroupIterator.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/iterators/AbstractTcfLaunchStepGroupIterator.java
@@ -16,7 +16,7 @@ import org.eclipse.tcf.te.launch.core.steps.iterators.AbstractLaunchStepGroupIte
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.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
/**
* Abstract TCF launch step group iterator.
@@ -31,16 +31,16 @@ public abstract class AbstractTcfLaunchStepGroupIterator extends AbstractLaunchS
* @param fullQualifiedId The full qualfied id for this step. Must not be <code>null</code>.
* @return The active peer model context.
*/
- protected IPeerModel getActivePeerModelContext(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId) {
+ protected IPeerNode getActivePeerModelContext(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId) {
Object activeContext = getActiveContext(context, data, fullQualifiedId);
- IPeerModel peerModel = null;
- if (activeContext instanceof IPeerModel)
- return (IPeerModel)activeContext;
+ IPeerNode peerNode = null;
+ if (activeContext instanceof IPeerNode)
+ return (IPeerNode)activeContext;
if (activeContext instanceof IAdaptable)
- peerModel = (IPeerModel)((IAdaptable)activeContext).getAdapter(IPeerModel.class);
- if (peerModel == null)
- peerModel = (IPeerModel)Platform.getAdapterManager().getAdapter(activeContext, IPeerModel.class);
+ peerNode = (IPeerNode)((IAdaptable)activeContext).getAdapter(IPeerNode.class);
+ if (peerNode == null)
+ peerNode = (IPeerNode)Platform.getAdapterManager().getAdapter(activeContext, IPeerNode.class);
- return peerModel;
+ return peerNode;
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.xml
index 3a15b2b39..1a2c49a1e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.xml
@@ -11,7 +11,7 @@
bundleId="org.eclipse.tcf.te.runtime.services"
class="org.eclipse.tcf.te.runtime.services.interfaces.IDebugService"/>
<enablement>
- <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
+ <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode"/>
</enablement>
</service>
</extension>
@@ -117,7 +117,7 @@
insertAfter="last">
<enablement>
<with variable="activeEditorInput">
- <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode">
<test property="org.eclipse.tcf.te.tcf.locator.hasRemoteService" value="Processes"/>
</adapt>
</with>
@@ -129,7 +129,7 @@
insertBefore="org.eclipse.tcf.te.launch.ui.LaunchEditorPage">
<enablement>
<with variable="activeEditorInput">
- <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode">
<test property="org.eclipse.tcf.te.core.canAdaptTo" value="org.eclipse.debug.core.ILaunchConfiguration" args="forceAdapterLoad"/>
</adapt>
</with>
@@ -141,7 +141,7 @@
insertBefore="org.eclipse.tcf.te.launch.ui.SourceLookupEditorPage,org.eclipse.tcf.te.launch.ui.LaunchEditorPage">
<enablement>
<with variable="activeEditorInput">
- <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode">
<test property="org.eclipse.tcf.te.tcf.locator.hasRemoteService" value="PathMap"/>
</adapt>
</with>
@@ -153,7 +153,7 @@
insertBefore="org.eclipse.tcf.te.tcf.launch.ui.PathMapEditorPage,org.eclipse.tcf.te.launch.ui.SourceLookupEditorPage,org.eclipse.tcf.te.launch.ui.LaunchEditorPage">
<enablement>
<with variable="activeEditorInput">
- <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode">
<test property="org.eclipse.tcf.te.tcf.locator.hasRemoteService" value="MemoryMap"/>
</adapt>
</with>
@@ -183,7 +183,7 @@
labelProvider="org.eclipse.tcf.te.launch.ui.viewer.LaunchTreeLabelProvider"
priority="lowest">
<triggerPoints>
- <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
+ <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode"/>
</triggerPoints>
<possibleChildren>
<instanceof value="org.eclipse.tcf.te.launch.ui.model.LaunchNode"/>
@@ -218,7 +218,7 @@
<with variable="selection">
<count value="1"/>
<iterate operator="and" ifEmpty="false">
- <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode">
<and>
<test property="org.eclipse.tcf.te.tcf.locator.hasRemoteService" value="Diagnostics"/>
<or>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/AbstractTcfLaunchTabContainerEditorPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/AbstractTcfLaunchTabContainerEditorPage.java
index de8dee592..f8cc02c90 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/AbstractTcfLaunchTabContainerEditorPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/AbstractTcfLaunchTabContainerEditorPage.java
@@ -23,7 +23,7 @@ import org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistenceDelegate;
import org.eclipse.tcf.te.runtime.services.ServiceManager;
import org.eclipse.tcf.te.runtime.services.interfaces.IPropertiesAccessService;
import org.eclipse.tcf.te.tcf.launch.ui.activator.UIPlugin;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
/**
* TCF launch configuration tab container page implementation.
@@ -41,8 +41,8 @@ public abstract class AbstractTcfLaunchTabContainerEditorPage extends AbstractLa
* @param input The editor input.
* @return The peer model.
*/
- public IPeerModel getPeerModel(Object input) {
- return (IPeerModel) ((IAdaptable) input).getAdapter(IPeerModel.class);
+ public IPeerNode getPeerModel(Object input) {
+ return (IPeerNode) ((IAdaptable) input).getAdapter(IPeerNode.class);
}
/* (non-Javadoc)
@@ -61,24 +61,24 @@ public abstract class AbstractTcfLaunchTabContainerEditorPage extends AbstractLa
/**
* Get the launch configuration from the peer model.
*
- * @param peerModel The peer model.
+ * @param peerNode The peer model.
* @return The launch configuration.
*/
- public static ILaunchConfigurationWorkingCopy getLaunchConfig(final IPeerModel peerModel) {
+ public static ILaunchConfigurationWorkingCopy getLaunchConfig(final IPeerNode peerNode) {
ILaunchConfigurationWorkingCopy wc = null;
- if (peerModel != null) {
- IPropertiesAccessService service = ServiceManager.getInstance().getService(peerModel, IPropertiesAccessService.class);
+ if (peerNode != null) {
+ IPropertiesAccessService service = ServiceManager.getInstance().getService(peerNode, IPropertiesAccessService.class);
Assert.isNotNull(service);
- if (service.getProperty(peerModel, PROP_LAUNCH_CONFIG_WC) instanceof ILaunchConfigurationWorkingCopy) {
- wc = (ILaunchConfigurationWorkingCopy) service.getProperty(peerModel, PROP_LAUNCH_CONFIG_WC);
+ if (service.getProperty(peerNode, PROP_LAUNCH_CONFIG_WC) instanceof ILaunchConfigurationWorkingCopy) {
+ wc = (ILaunchConfigurationWorkingCopy) service.getProperty(peerNode, PROP_LAUNCH_CONFIG_WC);
}
else {
- wc = (ILaunchConfigurationWorkingCopy) Platform.getAdapterManager().getAdapter(peerModel, ILaunchConfigurationWorkingCopy.class);
+ wc = (ILaunchConfigurationWorkingCopy) Platform.getAdapterManager().getAdapter(peerNode, ILaunchConfigurationWorkingCopy.class);
if (wc == null) {
- wc = (ILaunchConfigurationWorkingCopy) Platform.getAdapterManager().loadAdapter(peerModel, "org.eclipse.debug.core.ILaunchConfigurationWorkingCopy"); //$NON-NLS-1$
+ wc = (ILaunchConfigurationWorkingCopy) Platform.getAdapterManager().loadAdapter(peerNode, "org.eclipse.debug.core.ILaunchConfigurationWorkingCopy"); //$NON-NLS-1$
}
Assert.isNotNull(wc);
- service.setProperty(peerModel, PROP_LAUNCH_CONFIG_WC, wc);
+ service.setProperty(peerNode, PROP_LAUNCH_CONFIG_WC, wc);
IPersistenceDelegate delegate = PersistenceManager.getInstance().getDelegate(wc, String.class);
String launchConfigAttributes = null;
try {
@@ -87,7 +87,7 @@ public abstract class AbstractTcfLaunchTabContainerEditorPage extends AbstractLa
catch (Exception e) {
/* ignored on purpose */
}
- service.setProperty(peerModel, PROP_ORIGINAL_LAUNCH_CONFIG_ATTRIBUTES, launchConfigAttributes);
+ service.setProperty(peerNode, PROP_ORIGINAL_LAUNCH_CONFIG_ATTRIBUTES, launchConfigAttributes);
}
}
return wc;
@@ -119,10 +119,10 @@ public abstract class AbstractTcfLaunchTabContainerEditorPage extends AbstractLa
if (wc != null && checkLaunchConfigDirty()) {
getLaunchConfigurationTab().performApply(wc);
try {
- IPeerModel peerModel = getPeerModel(getEditorInput());
- IPropertiesAccessService service = ServiceManager.getInstance().getService(peerModel, IPropertiesAccessService.class);
+ IPeerNode peerNode = getPeerModel(getEditorInput());
+ IPropertiesAccessService service = ServiceManager.getInstance().getService(peerNode, IPropertiesAccessService.class);
Assert.isNotNull(service);
- service.setProperty(peerModel, PROP_LAUNCH_CONFIG_WC, null);
+ service.setProperty(peerNode, PROP_LAUNCH_CONFIG_WC, null);
wc.doSave();
onPostSave(wc);
checkLaunchConfigDirty();
@@ -141,13 +141,13 @@ public abstract class AbstractTcfLaunchTabContainerEditorPage extends AbstractLa
*/
public boolean checkLaunchConfigDirty() {
boolean dirty = false;
- IPeerModel peerModel = getPeerModel(getEditorInput());
- IPropertiesAccessService service = ServiceManager.getInstance().getService(peerModel, IPropertiesAccessService.class);
- String oldLaunchConfigAttributes = (String) service.getProperty(peerModel, PROP_ORIGINAL_LAUNCH_CONFIG_ATTRIBUTES);
- IPersistenceDelegate delegate = PersistenceManager.getInstance().getDelegate(getLaunchConfig(peerModel), String.class);
+ IPeerNode peerNode = getPeerModel(getEditorInput());
+ IPropertiesAccessService service = ServiceManager.getInstance().getService(peerNode, IPropertiesAccessService.class);
+ String oldLaunchConfigAttributes = (String) service.getProperty(peerNode, PROP_ORIGINAL_LAUNCH_CONFIG_ATTRIBUTES);
+ IPersistenceDelegate delegate = PersistenceManager.getInstance().getDelegate(getLaunchConfig(peerNode), String.class);
String launchConfigAttributes = null;
try {
- launchConfigAttributes = (String) delegate.write(getLaunchConfig(peerModel), String.class);
+ launchConfigAttributes = (String) delegate.write(getLaunchConfig(peerNode), String.class);
dirty = !launchConfigAttributes.equals(oldLaunchConfigAttributes);
}
catch (Exception e) {
@@ -164,9 +164,9 @@ public abstract class AbstractTcfLaunchTabContainerEditorPage extends AbstractLa
if (isAutoSave()) {
final ILaunchConfigurationWorkingCopy wc = getLaunchConfig(getPeerModel(getEditorInput()));
if (wc != null && dirty) {
- IPeerModel peerModel = getPeerModel(getEditorInput());
- IPropertiesAccessService service = ServiceManager.getInstance().getService(peerModel, IPropertiesAccessService.class);
- service.setProperty(peerModel, PROP_LAUNCH_CONFIG_WC, null);
+ IPeerNode peerNode = getPeerModel(getEditorInput());
+ IPropertiesAccessService service = ServiceManager.getInstance().getService(peerNode, IPropertiesAccessService.class);
+ service.setProperty(peerNode, PROP_LAUNCH_CONFIG_WC, null);
try {
wc.doSave();
onPostSave(wc);
@@ -213,10 +213,10 @@ public abstract class AbstractTcfLaunchTabContainerEditorPage extends AbstractLa
@Override
public void dispose() {
super.dispose();
- IPeerModel peerModel = getPeerModel(getEditorInput());
- IPropertiesAccessService service = ServiceManager.getInstance().getService(peerModel, IPropertiesAccessService.class);
- service.setProperty(peerModel, PROP_ORIGINAL_LAUNCH_CONFIG_ATTRIBUTES, null);
- service.setProperty(peerModel, PROP_LAUNCH_CONFIG_WC, null);
+ IPeerNode peerNode = getPeerModel(getEditorInput());
+ IPropertiesAccessService service = ServiceManager.getInstance().getService(peerNode, IPropertiesAccessService.class);
+ service.setProperty(peerNode, PROP_ORIGINAL_LAUNCH_CONFIG_ATTRIBUTES, null);
+ service.setProperty(peerNode, PROP_LAUNCH_CONFIG_WC, null);
DebugPlugin.getDefault().getLaunchManager().removeLaunchConfigurationListener(this);
launchConfigListener = null;
}
@@ -241,12 +241,12 @@ public abstract class AbstractTcfLaunchTabContainerEditorPage extends AbstractLa
@Override
public void launchConfigurationChanged(ILaunchConfiguration configuration) {
if (!(configuration instanceof ILaunchConfigurationWorkingCopy)) {
- IPeerModel peerModel = getPeerModel(getEditorInput());
- IPropertiesAccessService service = ServiceManager.getInstance().getService(peerModel, IPropertiesAccessService.class);
- ILaunchConfigurationWorkingCopy wc = (ILaunchConfigurationWorkingCopy) service.getProperty(peerModel, PROP_LAUNCH_CONFIG_WC);
+ IPeerNode peerNode = getPeerModel(getEditorInput());
+ IPropertiesAccessService service = ServiceManager.getInstance().getService(peerNode, IPropertiesAccessService.class);
+ ILaunchConfigurationWorkingCopy wc = (ILaunchConfigurationWorkingCopy) service.getProperty(peerNode, PROP_LAUNCH_CONFIG_WC);
if (wc != null && configuration.getName().equals(wc.getName())) {
- service.setProperty(peerModel, PROP_ORIGINAL_LAUNCH_CONFIG_ATTRIBUTES, null);
- service.setProperty(peerModel, PROP_LAUNCH_CONFIG_WC, null);
+ service.setProperty(peerNode, PROP_ORIGINAL_LAUNCH_CONFIG_ATTRIBUTES, null);
+ service.setProperty(peerNode, PROP_LAUNCH_CONFIG_WC, null);
ExecutorsUtil.executeInUI(new Runnable() {
@Override
public void run() {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/PathMapEditorPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/PathMapEditorPage.java
index e44294b28..4835b086f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/PathMapEditorPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/PathMapEditorPage.java
@@ -27,7 +27,7 @@ import org.eclipse.tcf.te.tcf.launch.ui.activator.UIPlugin;
import org.eclipse.tcf.te.tcf.launch.ui.editor.tabs.PathMapTab;
import org.eclipse.tcf.te.tcf.launch.ui.help.IContextHelpIds;
import org.eclipse.tcf.te.tcf.launch.ui.nls.Messages;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
/**
* TCF path map launch configuration tab container page implementation.
@@ -49,18 +49,18 @@ public class PathMapEditorPage extends AbstractTcfLaunchTabContainerEditorPage {
protected void onPostSave(ILaunchConfiguration config) {
Assert.isNotNull(config);
- final IPeerModel peerModel = getPeerModel(getEditorInput());
- if (peerModel != null && peerModel.getPeer() != null) {
- IPathMapService service = ServiceManager.getInstance().getService(peerModel.getPeer(), IPathMapService.class);
+ final IPeerNode peerNode = getPeerModel(getEditorInput());
+ if (peerNode != null && peerNode.getPeer() != null) {
+ IPathMapService service = ServiceManager.getInstance().getService(peerNode.getPeer(), IPathMapService.class);
if (service != null) {
- service.applyPathMap(peerModel.getPeer(), new Callback() {
+ service.applyPathMap(peerNode.getPeer(), new Callback() {
@Override
protected void internalDone(Object caller, IStatus status) {
if (status != null && status.getSeverity() == IStatus.ERROR) {
IStatus status2 = new Status(IStatus.ERROR, UIPlugin.getUniqueIdentifier(),
- NLS.bind(Messages.PathMapEditorPage_error_apply, peerModel.getName(), status.getMessage()),
+ NLS.bind(Messages.PathMapEditorPage_error_apply, peerNode.getName(), status.getMessage()),
status.getException());
- IStatusHandler[] handlers = StatusHandlerManager.getInstance().getHandler(peerModel);
+ IStatusHandler[] handlers = StatusHandlerManager.getInstance().getHandler(peerNode);
if (handlers.length > 0) {
IPropertiesContainer data = new PropertiesContainer();
data.setProperty(IStatusHandlerConstants.PROPERTY_TITLE, Messages.PathMapEditorPage_error_title);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/PathMapTab.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/PathMapTab.java
index 679cd1c42..d7f0bda3a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/PathMapTab.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/PathMapTab.java
@@ -20,7 +20,7 @@ import org.eclipse.tcf.te.runtime.services.ServiceManager;
import org.eclipse.tcf.te.tcf.core.interfaces.IPathMapGeneratorService;
import org.eclipse.tcf.te.tcf.launch.ui.editor.AbstractTcfLaunchTabContainerEditorPage;
import org.eclipse.tcf.te.tcf.launch.ui.nls.Messages;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
/**
* Customized TCF path map launch configuration tab implementation to work better
@@ -92,11 +92,11 @@ public class PathMapTab extends TCFPathMapTab {
super.initializePathMap(map, config);
IModelNode context = LaunchContextsPersistenceDelegate.getFirstLaunchContext(config);
- if (context instanceof IPeerModel) {
- IPeerModel peerModel = (IPeerModel)context;
- IPathMapGeneratorService service = ServiceManager.getInstance().getService(peerModel, IPathMapGeneratorService.class);
+ if (context instanceof IPeerNode) {
+ IPeerNode peerNode = (IPeerNode)context;
+ IPathMapGeneratorService service = ServiceManager.getInstance().getService(peerNode, IPathMapGeneratorService.class);
if (service != null) {
- IPathMap.PathMapRule[] rules = service.getPathMap(peerModel);
+ IPathMap.PathMapRule[] rules = service.getPathMap(peerNode);
if (rules != null && rules.length > 0) {
for (IPathMap.PathMapRule rule : rules) {
rule.getProperties().put(PROP_GENERATED, Boolean.TRUE);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/handler/AbstractDiagnosticsCommandHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/handler/AbstractDiagnosticsCommandHandler.java
index 323554aac..0bbec8e6c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/handler/AbstractDiagnosticsCommandHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/handler/AbstractDiagnosticsCommandHandler.java
@@ -47,8 +47,8 @@ import org.eclipse.tcf.services.IMemoryMap;
import org.eclipse.tcf.services.IPathMap;
import org.eclipse.tcf.te.tcf.launch.ui.editor.AbstractTcfLaunchTabContainerEditorPage;
import org.eclipse.tcf.te.tcf.launch.ui.nls.Messages;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelPeerNodeQueryService;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelQueryService;
import org.eclipse.ui.handlers.HandlerUtil;
/**
@@ -71,11 +71,11 @@ public abstract class AbstractDiagnosticsCommandHandler extends AbstractHandler
while (iterator.hasNext()) {
Object element = iterator.next();
- // The selected element must be of type IPeerModel
- if (element instanceof IPeerModel) {
- final IPeerModel node = (IPeerModel)element;
+ // The selected element must be of type IPeerNode
+ if (element instanceof IPeerNode) {
+ final IPeerNode node = (IPeerNode)element;
- ILocatorModelPeerNodeQueryService service = node.getModel().getService(ILocatorModelPeerNodeQueryService.class);
+ IPeerModelQueryService service = node.getModel().getService(IPeerModelQueryService.class);
String remoteServices = service != null ? service.queryRemoteServices(node) : null;
if (remoteServices != null && remoteServices.contains(IDiagnostics.NAME)) {
@@ -101,7 +101,7 @@ public abstract class AbstractDiagnosticsCommandHandler extends AbstractHandler
* @param peer The peer. Must not be <code>null</code>.
* @param parentShell The parent shell. Must not be <code>null</code>.
*/
- /* default */ void runDiagnostics(IPeerModel node, Shell parentShell) {
+ /* default */ void runDiagnostics(IPeerNode node, Shell parentShell) {
Assert.isNotNull(node);
Assert.isNotNull(parentShell);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/launchcontext/AbstractLaunchContextMainTab.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/launchcontext/AbstractLaunchContextMainTab.java
index 0de7224f1..020e38bbe 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/launchcontext/AbstractLaunchContextMainTab.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/launchcontext/AbstractLaunchContextMainTab.java
@@ -28,7 +28,7 @@ import org.eclipse.tcf.te.launch.core.selection.RemoteSelectionContext;
import org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart;
import org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorTab;
import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
-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.ui.controls.ContextSelectorSectionControl;
import org.eclipse.tcf.te.tcf.ui.sections.AbstractContextSelectorSection;
import org.eclipse.tcf.te.ui.views.controls.AbstractContextSelectorControl;
@@ -51,7 +51,7 @@ public abstract class AbstractLaunchContextMainTab extends AbstractContextSelect
*/
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
- if (element instanceof IPeerModel) {
+ if (element instanceof IPeerNode) {
String typeId = null;
if (configuration != null) {
try {
@@ -63,7 +63,7 @@ public abstract class AbstractLaunchContextMainTab extends AbstractContextSelect
String mode = getLaunchConfigurationDialog().getMode();
if (typeId != null && mode != null) {
- return LaunchConfigTypeBindingsManager.getInstance().isValidLaunchConfigType(typeId, mode, new RemoteSelectionContext((IPeerModel)element, true));
+ return LaunchConfigTypeBindingsManager.getInstance().isValidLaunchConfigType(typeId, mode, new RemoteSelectionContext((IPeerNode)element, true));
}
}
return true;
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 837d3df41..deffea96f 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
@@ -29,7 +29,6 @@ Export-Package: org.eclipse.tcf.te.tcf.locator,
org.eclipse.tcf.te.tcf.locator.interfaces.services,
org.eclipse.tcf.te.tcf.locator.internal;x-internal:=true,
org.eclipse.tcf.te.tcf.locator.internal.adapters;x-internal:=true,
- org.eclipse.tcf.te.tcf.locator.internal.nodes;x-internal:=true,
org.eclipse.tcf.te.tcf.locator.internal.preferences,
org.eclipse.tcf.te.tcf.locator.internal.services;x-internal:=true,
org.eclipse.tcf.te.tcf.locator.iterators,
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 c4582a6d0..71ce90d21 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
@@ -13,23 +13,23 @@
<!-- Adapter factory contributions -->
<extension point="org.eclipse.core.runtime.adapters">
<factory
- adaptableType="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"
+ adaptableType="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode"
class="org.eclipse.tcf.te.tcf.locator.internal.adapters.AdapterFactory">
<adapter type="org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistableURIProvider"/>
<adapter type="org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext"/>
- <adapter type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel"/>
+ <adapter type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
</factory>
<factory
adaptableType="org.eclipse.tcf.protocol.IPeer"
class="org.eclipse.tcf.te.tcf.locator.internal.adapters.AdapterFactory">
<adapter type="org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistableURIProvider"/>
- <adapter type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
+ <adapter type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode"/>
</factory>
<factory
- adaptableType="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider"
+ adaptableType="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProvider"
class="org.eclipse.tcf.te.tcf.locator.internal.adapters.AdapterFactory">
<adapter type="org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistableURIProvider"/>
- <adapter type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
+ <adapter type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode"/>
</factory>
</extension>
@@ -43,22 +43,22 @@
<delegate
class="org.eclipse.tcf.te.tcf.locator.internal.ModelNodeFactoryDelegate"
id="org.eclipse.tcf.te.tcf.locator.model.factory.delegate">
- <nodeType class="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
+ <nodeType class="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode"/>
</delegate>
</extension>
<!-- Eclipse core expressions property tester -->
<extension point="org.eclipse.core.expressions.propertyTesters">
<propertyTester
- class="org.eclipse.tcf.te.tcf.locator.internal.LocatorModelPropertyTester"
+ 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"
- type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode">
</propertyTester>
<propertyTester
- class="org.eclipse.tcf.te.tcf.locator.internal.LocatorModelPropertyTester"
+ 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"
@@ -70,7 +70,7 @@
id="org.eclipse.tcf.te.tcf.locator.SimulatorPropertyTester"
namespace="org.eclipse.tcf.te.tcf.locator"
properties="isSimulatorState,canStartSimulator"
- type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode">
</propertyTester>
</extension>
@@ -104,8 +104,8 @@
<with variable="context">
<or>
<instanceof value="org.eclipse.tcf.protocol.IPeer"/>
- <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
- <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider"/>
+ <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode"/>
+ <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProvider"/>
<and>
<instanceof value="java.lang.Class"/>
<with variable="contextClass">
@@ -127,7 +127,10 @@
bundleId="org.eclipse.tcf.te.runtime.services"
class="org.eclipse.tcf.te.runtime.services.interfaces.IPropertiesAccessService"/>
<enablement>
- <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
+ <or>
+ <instanceof value="org.eclipse.tcf.protocol.IPeer"/>
+ <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode"/>
+ </or>
</enablement>
</service>
<service
@@ -138,7 +141,7 @@
class="org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperOperationService">
</serviceType>
<enablement>
- <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
+ <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>
@@ -267,7 +270,7 @@
is adaptable to IPeerModel and has a simulator service
-->
<definition id="te.expressions.peerModel.hasSimulatorService">
- <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode">
<test property="org.eclipse.tcf.te.runtime.services.hasService"
value="org.eclipse.tcf.te.runtime.services.interfaces.ISimulatorService"/>
<test property="org.eclipse.tcf.te.tcf.locator.isAttribute"
@@ -300,7 +303,7 @@
is adaptable to IPeerModel and has remote or offline run control
-->
<definition id="te.expressions.peerModel.hasRunControl">
- <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode">
<or>
<test property="org.eclipse.tcf.te.tcf.locator.hasRemoteService" value="RunControl"/>
<test property="org.eclipse.tcf.te.tcf.locator.hasOfflineService" value="RunControl"/>
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
index 24f488c10..a0adeaa52 100644
--- 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
@@ -29,9 +29,9 @@ 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.ILocatorModel;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProperties;
+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;
@@ -40,7 +40,7 @@ import org.eclipse.tcf.te.tcf.locator.model.Model;
*/
public class Scanner extends Job implements IScanner {
// Reference to the parent model instance.
- private final ILocatorModel parentModel;
+ private final IPeerModel parentModel;
// Reference to the scanner configuration
private final Map<String, Object> configuration = new HashMap<String, Object>();
@@ -53,7 +53,7 @@ public class Scanner extends Job implements IScanner {
*
* @param parentModel The parent model instance. Must not be <code>null</code>.
*/
- public Scanner(ILocatorModel parentModel) {
+ public Scanner(IPeerModel parentModel) {
super(Scanner.class.getName());
Assert.isNotNull(parentModel);
this.parentModel = parentModel;
@@ -68,7 +68,7 @@ public class Scanner extends Job implements IScanner {
*
* @return The parent model instance.
*/
- protected ILocatorModel getParentModel() {
+ protected IPeerModel getParentModel() {
return parentModel;
}
@@ -98,7 +98,7 @@ public class Scanner extends Job implements IScanner {
if (monitor == null) monitor = new NullProgressMonitor();
// Get the current list of peers known to the parent model
- IPeerModel[] peers = getParentModel().getPeers();
+ IPeerNode[] peers = getParentModel().getPeers();
// Do we have something to scan at all
if (peers.length > 0) {
try {
@@ -131,7 +131,7 @@ public class Scanner extends Job implements IScanner {
}, new CallbackInvocationDelegate());
// Loop the nodes and try to get an channel
- for (IPeerModel peer : peers) {
+ for (IPeerNode peer : peers) {
// Check for the progress monitor getting canceled
if (monitor.isCanceled() || isTerminated()) break;
// Scan the peer
@@ -155,7 +155,7 @@ public class Scanner extends Job implements IScanner {
* @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 IPeerModel peer, final AsyncCallbackCollector collector, final IProgressMonitor monitor) {
+ /* default */ void doScan(final IPeerNode peer, final AsyncCallbackCollector collector, final IProgressMonitor monitor) {
Assert.isNotNull(peer);
Assert.isNotNull(collector);
Assert.isNotNull(monitor);
@@ -174,7 +174,7 @@ public class Scanner extends Job implements IScanner {
@Override
public void run() {
- isExcluded.set(peer.getBooleanProperty(IPeerModelProperties.PROP_SCANNER_EXCLUDE));
+ isExcluded.set(peer.getBooleanProperty(IPeerNodeProperties.PROP_SCANNER_EXCLUDE));
}
};
@@ -191,9 +191,9 @@ public class Scanner extends Job implements IScanner {
if (!monitor.isCanceled() && !isTerminated()) {
// Get the children of the scanned peer model and make sure
// they are scanned too if not excluded
- List<IPeerModel> candidates = Model.getModel().getChildren(peer.getPeerId());
+ List<IPeerNode> candidates = Model.getModel().getChildren(peer.getPeerId());
if (candidates != null && candidates.size() > 0) {
- for (IPeerModel candidate : candidates) {
+ for (IPeerNode candidate : candidates) {
doScan(candidate, collector, monitor);
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/ScannerRunnable.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/ScannerRunnable.java
index 51fd51b7c..926d67494 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/ScannerRunnable.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/ScannerRunnable.java
@@ -37,12 +37,12 @@ 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.ILocatorModel;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProperties;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelUpdateService;
-import org.eclipse.tcf.te.tcf.locator.nodes.PeerModel;
+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;
@@ -55,7 +55,7 @@ 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 IPeerModel peerNode;
+ /* default */ final IPeerNode peerNode;
// Reference to the channel
/* default */ IChannel channel = null;
// Mark if the used channel is a shared channel instance
@@ -70,7 +70,7 @@ public class ScannerRunnable implements Runnable, IChannel.IChannelListener {
* @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, IPeerModel peerNode) {
+ public ScannerRunnable(IScanner scanner, IPeerNode peerNode) {
this(scanner, peerNode, null);
}
@@ -81,7 +81,7 @@ public class ScannerRunnable implements Runnable, IChannel.IChannelListener {
* @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, IPeerModel peerNode, ICallback callback) {
+ public ScannerRunnable(IScanner scanner, IPeerNode peerNode, ICallback callback) {
super();
parentScanner = scanner;
@@ -193,19 +193,19 @@ public class ScannerRunnable implements Runnable, IChannel.IChannelListener {
final boolean changed = peerNode.setChangeEventsEnabled(false);
// Set the peer state property
- int counter = peerNode.getIntProperty(IPeerModelProperties.PROP_CHANNEL_REF_COUNTER);
- if (!peerNode.isProperty(IPeerModelProperties.PROP_STATE, IPeerModelProperties.STATE_WAITING_FOR_READY)) {
- peerNode.setProperty(IPeerModelProperties.PROP_STATE, counter > 0 ? IPeerModelProperties.STATE_CONNECTED : IPeerModelProperties.STATE_REACHABLE);
- peerNode.setProperty(IPeerModelProperties.PROP_LAST_SCANNER_ERROR, null);
+ int counter = peerNode.getIntProperty(IPeerNodeProperties.PROP_CHANNEL_REF_COUNTER);
+ if (!peerNode.isProperty(IPeerNodeProperties.PROP_STATE, IPeerNodeProperties.STATE_WAITING_FOR_READY)) {
+ peerNode.setProperty(IPeerNodeProperties.PROP_STATE, counter > 0 ? IPeerNodeProperties.STATE_CONNECTED : IPeerNodeProperties.STATE_REACHABLE);
+ peerNode.setProperty(IPeerNodeProperties.PROP_LAST_SCANNER_ERROR, null);
}
// Get the parent model from the model mode
- final ILocatorModel model = (ILocatorModel)peerNode.getAdapter(ILocatorModel.class);
+ final IPeerModel model = (IPeerModel)peerNode.getAdapter(IPeerModel.class);
if (channel != null && channel.getState() == IChannel.STATE_OPEN) {
// Update the services lists
- ILocatorModelUpdateService updateService = model != null ? model.getService(ILocatorModelUpdateService.class) : null;
+ IPeerModelUpdateService updateService = model != null ? model.getService(IPeerModelUpdateService.class) : null;
if (updateService != null) {
Collection<String> localServices = channel.getLocalServices();
Collection<String> remoteServices = channel.getRemoteServices();
@@ -294,7 +294,7 @@ public class ScannerRunnable implements Runnable, IChannel.IChannelListener {
// Update the peer attributes
Map<String, String> attrs = new HashMap<String, String>(channel.getRemotePeer().getAttributes());
attrs.put(IPeer.ATTR_AGENT_ID, agentID);
- peerNode.setProperty(IPeerModelProperties.PROP_INSTANCE, new Peer(attrs));
+ peerNode.setProperty(IPeerNodeProperties.PROP_INSTANCE, new Peer(attrs));
}
if (isGetPeersAllowed(channel)) {
@@ -367,7 +367,7 @@ public class ScannerRunnable implements Runnable, IChannel.IChannelListener {
* @param callback The callback. Must not be <code>null</code>.
*/
@SuppressWarnings("unused")
- protected void getPeers(final IChannel channel, final ILocatorModel model, final String ip, final ICallback callback) {
+ protected void getPeers(final IChannel channel, final IPeerModel model, final String ip, final ICallback callback) {
Assert.isNotNull(channel);
Assert.isNotNull(model);
Assert.isNotNull(callback);
@@ -404,7 +404,7 @@ public class ScannerRunnable implements Runnable, IChannel.IChannelListener {
// Get the parent peer
IPeer parentPeer = channel.getRemotePeer();
// Get the old child list
- List<IPeerModel> oldChildren = new ArrayList<IPeerModel>(model.getChildren(parentPeer.getID()));
+ List<IPeerNode> oldChildren = new ArrayList<IPeerNode>(model.getChildren(parentPeer.getID()));
// "getPeers" returns a collection of peer attribute maps
@SuppressWarnings("unchecked")
@@ -428,37 +428,27 @@ public class ScannerRunnable implements Runnable, IChannel.IChannelListener {
// Create a peer instance
IPeer peer = new PeerRedirector(parentPeer, attributes);
// Try to find an existing peer node first
- IPeerModel peerNode = model.getService(ILocatorModelLookupService.class).lkupPeerModelById(parentPeer.getID(), peerId);
+ IPeerNode peerNode = model.getService(IPeerModelLookupService.class).lkupPeerModelById(parentPeer.getID(), peerId);
if (peerNode == null) {
// Not yet known -> add it
- peerNode = new PeerModel(model, peer);
+ peerNode = new PeerNode(model, peer);
peerNode.setParent(ScannerRunnable.this.peerNode);
- peerNode.setProperty(IPeerModelProperties.PROP_SCANNER_EXCLUDE, true);
+ 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(ILocatorModelUpdateService.class).addChild(peerNode);
+ model.getService(IPeerModelUpdateService.class).addChild(peerNode);
}
} else {
// The parent node should be set and match
- Assert.isTrue(peerNode.getParent(IPeerModel.class) != null && peerNode.getParent(IPeerModel.class).equals(ScannerRunnable.this.peerNode));
+ Assert.isTrue(peerNode.getParent(IPeerNode.class) != null && peerNode.getParent(IPeerNode.class).equals(ScannerRunnable.this.peerNode));
// Peer node found, update the peer instance
- peerNode.setProperty(IPeerModelProperties.PROP_INSTANCE, peer);
+ peerNode.setProperty(IPeerNodeProperties.PROP_INSTANCE, peer);
// And remove it from the old child list
oldChildren.remove(peerNode);
}
}
-
- // Everything left in the old child list is not longer known to the remote peer
- // However, the child list may include manual redirected static peers. Do not
- // remove them here.
- for (IPeerModel child : oldChildren) {
- if (!child.isStatic()) {
- // Remove the child peer node from the model
- model.getService(ILocatorModelUpdateService.class).removeChild(child);
- }
- }
}
// Once everything is processed, close the channel
@@ -500,17 +490,17 @@ public class ScannerRunnable implements Runnable, IChannel.IChannelListener {
// Turn off change notifications temporarily
boolean changed = peerNode.setChangeEventsEnabled(false);
- peerNode.setProperty(IPeerModelProperties.PROP_CHANNEL_REF_COUNTER, null);
- if (!peerNode.isProperty(IPeerModelProperties.PROP_STATE, IPeerModelProperties.STATE_WAITING_FOR_READY)) {
+ peerNode.setProperty(IPeerNodeProperties.PROP_CHANNEL_REF_COUNTER, null);
+ if (!peerNode.isProperty(IPeerNodeProperties.PROP_STATE, IPeerNodeProperties.STATE_WAITING_FOR_READY)) {
boolean timeout = error instanceof SocketTimeoutException || (error instanceof ConnectException && error.getMessage() != null && error.getMessage().startsWith("Connection timed out:")); //$NON-NLS-1$
- peerNode.setProperty(IPeerModelProperties.PROP_STATE, timeout ? IPeerModelProperties.STATE_NOT_REACHABLE : IPeerModelProperties.STATE_ERROR);
- peerNode.setProperty(IPeerModelProperties.PROP_LAST_SCANNER_ERROR, error instanceof SocketTimeoutException ? null : error);
+ peerNode.setProperty(IPeerNodeProperties.PROP_STATE, timeout ? IPeerNodeProperties.STATE_NOT_REACHABLE : IPeerNodeProperties.STATE_ERROR);
+ peerNode.setProperty(IPeerNodeProperties.PROP_LAST_SCANNER_ERROR, error instanceof SocketTimeoutException ? null : error);
}
// Clear out previously determined services
- ILocatorModel model = (ILocatorModel)peerNode.getAdapter(ILocatorModel.class);
+ IPeerModel model = (IPeerModel)peerNode.getAdapter(IPeerModel.class);
if (model != null) {
- ILocatorModelUpdateService updateService = model.getService(ILocatorModelUpdateService.class);
+ IPeerModelUpdateService updateService = model.getService(IPeerModelUpdateService.class);
updateService.updatePeerServices(peerNode, null, null);
// Clean out possible child nodes
@@ -534,7 +524,7 @@ public class ScannerRunnable implements Runnable, IChannel.IChannelListener {
* @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(IPeerModel node, boolean changed) {
+ protected void onDone(IPeerNode node, boolean changed) {
Assert.isNotNull(node);
// Reset the scanner runnable marker
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 9b25bd98b..5584d8615 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
@@ -13,7 +13,7 @@ import org.eclipse.core.runtime.Plugin;
import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.te.runtime.preferences.ScopedEclipsePreferences;
import org.eclipse.tcf.te.runtime.tracing.TraceHandler;
-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.model.Model;
import org.osgi.framework.BundleContext;
@@ -87,7 +87,7 @@ public class CoreBundleActivator extends Plugin {
plugin = null;
// Dispose the locator model
- final ILocatorModel model = Model.getModel(true);
+ final IPeerModel model = Model.getModel(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/IModelListener.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/IModelListener.java
index c592f5362..18fea6a2d 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/IModelListener.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/IModelListener.java
@@ -9,8 +9,8 @@
*******************************************************************************/
package org.eclipse.tcf.te.tcf.locator.interfaces;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
/**
* Interface for clients to implement that wishes to listen to changes to the locator model.
@@ -21,15 +21,15 @@ public interface IModelListener {
* Invoked if a peer is added or removed to/from the locator model.
*
* @param model The changed locator model.
- * @param peerModel The added/removed peer model node.
+ * @param peerNode The added/removed peer model node.
* @param added <code>True</code> if the peer model node got added, <code>false</code> if it got removed.
*/
- public void locatorModelChanged(ILocatorModel model, IPeerModel peerModel, boolean added);
+ public void locatorModelChanged(IPeerModel model, IPeerNode peerNode, boolean added);
/**
* Invoked if the locator model is disposed.
*
* @param model The disposed locator model.
*/
- public void locatorModelDisposed(ILocatorModel model);
+ public void locatorModelDisposed(IPeerModel model);
}
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 b131fbb3b..b8475fb93 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
@@ -18,7 +18,7 @@ public interface ITracing {
/**
* If enabled, prints information about locator model method invocations.
*/
- public static String ID_TRACE_LOCATOR_MODEL = "trace/locatorModel"; //$NON-NLS-1$
+ public static String ID_TRACE_LOCATOR_MODEL = "trace/peerModel"; //$NON-NLS-1$
/**
* If enabled, prints information about locator listener method invocations.
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
deleted file mode 100644
index 7c89b9d54..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/ILocatorModel.java
+++ /dev/null
@@ -1,158 +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.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.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 {
-
- /**
- * Adds the specified listener to the list of model listener.
- * If the same listener has been added before, the listener will
- * not be added again.
- *
- * @param listener The listener. Must not be <code>null</code>.
- */
- public void addListener(IModelListener listener);
-
- /**
- * Removes the specified listener from the list of model listener.
- *
- * @param listener The listener. Must not be <code>null</code>.
- */
- public void removeListener(IModelListener listener);
-
- /**
- * Returns the list of registered model listeners.
- *
- * @return The list of registered model listeners or an empty list.
- */
- public IModelListener[] getListener();
-
- /**
- * 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 IPeerModel[] 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<IPeerModel> 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<IPeerModel> 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.
- *
- * @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);
-
- /**
- * Validate the given peer.
- * <p>
- * If the peer is for local host, than only the peer using the loopback address is valid.
- *
- * @param peer The peer. Must not be <code>null</code>.
- * @return The peer if the peer is valid, or <code>null</code> if not.
- */
- 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 IPeerModel validatePeerNodeForAdd(IPeerModel 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 IPeerModel#getParentNode()}.
- * The call has to return a non-null value, otherwise {@link #validateChildPeerNodeForAdd(IPeerModel)}
- * 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 IPeerModel validateChildPeerNodeForAdd(IPeerModel node);
-
-}
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 310dd1b5d..832f225e7 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,80 +9,150 @@
*******************************************************************************/
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.te.core.interfaces.IDecoratable;
-import org.eclipse.tcf.te.runtime.model.interfaces.IContainerModelNode;
+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;
+
/**
- * The peer model is an extension to the TCF peer representation, implementing the {@link IPeer}
- * interface. The peer model provides an offline cache for a peers known list of local and remote
- * services and is the merge point of peer attributes from custom data storages.
+ * 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> Read and write access to the peer model must happen within the TCF dispatch thread.
+ * <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 IPeerModel extends IContainerModelNode, IDecoratable {
+public interface IPeerModel extends IAdaptable {
/**
- * Returns the parent locator model instance.
- * <p>
- * This method may be called from any thread.
+ * Adds the specified listener to the list of model listener.
+ * If the same listener has been added before, the listener will
+ * not be added again.
*
- * @return The parent locator model instance.
+ * @param listener The listener. Must not be <code>null</code>.
*/
- public ILocatorModel getModel();
+ public void addListener(IModelListener listener);
/**
- * Returns the native {@link IPeer} object.
- * <p>
- * This method may be called from any thread.
+ * Removes the specified listener from the list of model listener.
*
- * @return The native {@link IPeer} instance.
+ * @param listener The listener. Must not be <code>null</code>.
*/
- public IPeer getPeer();
+ public void removeListener(IModelListener listener);
/**
- * Returns the peer id.
- * <p>
- * This method may be called from any thread.
+ * Returns the list of registered model listeners.
*
- * @return The peer id.
+ * @return The list of registered model listeners or an empty list.
*/
- public String getPeerId();
+ public IModelListener[] getListener();
/**
- * Returns the peer id of the remote peer.
- * <p>
- * For dynamically discovered peers, {@link #getPeerId()} and {@link #getRemotePeerId()} are identical.
- * <p>
- * For static peers, {@link #getRemotePeerId()} will return <code>null</code> if the static peer is not
- * associated with an agent. Otherwise it will return the id of the associated agent.
+ * 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 remote peer id or <code>null</code>.
+ * @return The list of known peers or an empty list.
*/
- public String getRemotePeerId();
+ public IPeerNode[] getPeers();
/**
- * Returns if or if not the peer attributes are complete to open a channel to it.
+ * Returns an unmodifiable list of known children for the given parent peer.
*
- * @return <code>True</code> if the peer attributes are complete, <code>false</code> otherwise.
+ * @param parentPeerID The parent peer id. Must not be <code>null</code>.
+ * @return The child list.
*/
- public boolean isComplete();
+ public List<IPeerNode> getChildren(String parentPeerID);
/**
- * Returns if or if not the peer model node represents a static peer.
+ * 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.
+ *
+ * @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 IPeerModelService> V getService(Class<V> serviceInterface);
+
+ /**
+ * Validate the given peer.
* <p>
- * <b>Note:</b> A peer model node can be both static and remote at the same time.
+ * If the peer is for local host, than only the peer using the loopback address is valid.
*
- * @return <code>True</code> if the node represents a static peer, <code>false</code> otherwise.
+ * @param peer The peer. Must not be <code>null</code>.
+ * @return The peer if the peer is valid, or <code>null</code> if not.
*/
- public boolean isStatic();
+ public IPeer validatePeer(IPeer peer);
/**
- * Returns if or if not the peer model node represents a remote/discovered 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> A peer model node can be both static and remote at the same time.
+ * <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.
*
- * @return <code>True</code> if the node represents a remote peer, <code>false</code> otherwise.
+ * @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 boolean isRemote();
+ 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/nodes/IPeerNode.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerNode.java
new file mode 100644
index 000000000..7b8f877a4
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerNode.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * 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 org.eclipse.tcf.protocol.IPeer;
+import org.eclipse.tcf.te.core.interfaces.IConnectable;
+import org.eclipse.tcf.te.core.interfaces.IDecoratable;
+import org.eclipse.tcf.te.runtime.model.interfaces.IContainerModelNode;
+
+/**
+ * The peer model is an extension to the TCF peer representation, implementing the {@link IPeer}
+ * interface. The peer model provides an offline cache for a peers known list of local and remote
+ * services and is the merge point of peer attributes from custom data storages.
+ * <p>
+ * <b>Note:</b> Read and write access to the peer model must happen within the TCF dispatch thread.
+ */
+public interface IPeerNode extends IContainerModelNode, IDecoratable, IConnectable {
+
+ /**
+ * Returns the parent locator model instance.
+ * <p>
+ * This method may be called from any thread.
+ *
+ * @return The parent locator model instance.
+ */
+ public IPeerModel getModel();
+
+ /**
+ * Returns the native {@link IPeer} object.
+ * <p>
+ * This method may be called from any thread.
+ *
+ * @return The native {@link IPeer} instance.
+ */
+ public IPeer getPeer();
+
+ /**
+ * Returns the peer id.
+ * <p>
+ * This method may be called from any thread.
+ *
+ * @return The peer id.
+ */
+ public String getPeerId();
+
+ /**
+ * Returns if or if not the peer attributes are complete to open a channel to it.
+ *
+ * @return <code>True</code> if the peer attributes are complete, <code>false</code> otherwise.
+ */
+ public boolean isComplete();
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerModelProperties.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerNodeProperties.java
index d20d9ce0e..3e5491003 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerModelProperties.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerNodeProperties.java
@@ -10,11 +10,17 @@
package org.eclipse.tcf.te.tcf.locator.interfaces.nodes;
import org.eclipse.tcf.protocol.IPeer;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
/**
- * Default set of custom peer properties.
+ * Default set of peer node properties.
*/
-public interface IPeerModelProperties {
+public interface IPeerNodeProperties {
+
+ /**
+ * Property: The peer node connect state.
+ */
+ public static final String PROP_CONNECT_STATE = "connectState"; //$NON-NLS-1$
/**
* Property: The peer instance. Object stored here must be
@@ -73,63 +79,63 @@ public interface IPeerModelProperties {
public static final int STATE_WAITING_FOR_READY = 4;
/**
- * Property: The peer type.
+ * Property: Reference counter tracking the active channels for this peer.
*/
- public static final String PROP_TYPE = "Type"; //$NON-NLS-1$
+ public static String PROP_CHANNEL_REF_COUNTER = "channelRefCounter.silent"; //$NON-NLS-1$
/**
- * Property: List of TCF services the peer would have when it goes online (comma separated list).
+ * Property: Discovered target for a static peer
*/
- public static final String PROP_OFFLINE_SERVICES = "OfflineServices"; //$NON-NLS-1$
+ public static final String PROP_TARGET = "Target"; //$NON-NLS-1$
/**
- * Property: The peer visible state.
+ * Property: Exclude from scanner process. If set to <code>true</code>, the node will not be scanned
+ * by the scanner.
*/
- public static final String PROP_VISIBLE = "Visible"; //$NON-NLS-1$
+ public static String PROP_SCANNER_EXCLUDE = "scanner.exclude.silent"; //$NON-NLS-1$
/**
- * Property: Reference counter tracking the active channels for this peer.
+ * Property: The last error the scanner encounter trying to open a channel to this peer.
*/
- public static String PROP_CHANNEL_REF_COUNTER = "channelRefCounter.silent"; //$NON-NLS-1$
+ public static String PROP_LAST_SCANNER_ERROR = "lastScannerError"; //$NON-NLS-1$
/**
- * Property: The last error the scanner encounter trying to open a channel to this peer.
+ * Property: The peer type.
*/
- public static String PROP_LAST_SCANNER_ERROR = "lastScannerError"; //$NON-NLS-1$
+ public static final String PROP_TYPE = "Type" + IPropertiesContainer.PERSISTENT_PROPERTY; //$NON-NLS-1$
/**
- * Property: Launch simulator
+ * Property: List of TCF services the peer would have when it goes online (comma separated list).
*/
- public static final String PROP_SIM_ENABLED = "SimulatorEnabled"; //$NON-NLS-1$
+ public static final String PROP_OFFLINE_SERVICES = "OfflineServices" + IPropertiesContainer.PERSISTENT_PROPERTY; //$NON-NLS-1$
/**
- * Property: Simulator properties
+ * Property: The peer visible state.
*/
- public static final String PROP_SIM_PROPERTIES = "SimulatorProperties"; //$NON-NLS-1$
+ public static final String PROP_VISIBLE = "Visible" + IPropertiesContainer.PERSISTENT_PROPERTY; //$NON-NLS-1$
/**
- * Property: Last selected simulator type
+ * Property: Launch simulator
*/
- public static final String PROP_SIM_TYPE = "SimulatorType"; //$NON-NLS-1$
+ public static final String PROP_SIM_ENABLED = "SimulatorEnabled" + IPropertiesContainer.PERSISTENT_PROPERTY; //$NON-NLS-1$
/**
- * Property: Discovered target for a static peer
+ * Property: Simulator properties
*/
- public static final String PROP_TARGET = "Target"; //$NON-NLS-1$
+ public static final String PROP_SIM_PROPERTIES = "SimulatorProperties" + IPropertiesContainer.PERSISTENT_PROPERTY; //$NON-NLS-1$
/**
- * Property: Auto-start the debugger after the agent launch.
+ * Property: Last selected simulator type
*/
- public static final String PROP_AUTO_START_DEBUGGER = "autoStartDebugger"; //$NON-NLS-1$
+ public static final String PROP_SIM_TYPE = "SimulatorType" + IPropertiesContainer.PERSISTENT_PROPERTY; //$NON-NLS-1$
/**
- * Property: Connect after the configuration has been created.
+ * Property: Auto-start the debugger after the agent launch.
*/
- public static final String PROP_AUTO_CONNECT = "autoConnect"; //$NON-NLS-1$
+ public static final String PROP_AUTO_START_DEBUGGER = "autoStartDebugger" + IPropertiesContainer.PERSISTENT_PROPERTY; //$NON-NLS-1$
/**
- * Property: Exclude from scanner process. If set to <code>true</code>, the node will not be scanned
- * by the scanner.
+ * Property: Connect after the configuration has been created.
*/
- public static String PROP_SCANNER_EXCLUDE = "scanner.exclude.silent"; //$NON-NLS-1$
+ public static final String PROP_AUTO_CONNECT = "autoConnect"; //$NON-NLS-1$
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerModelProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerNodeProvider.java
index f2174b990..82838e8d5 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerModelProvider.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerNodeProvider.java
@@ -1,26 +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.nodes;
-
-import org.eclipse.core.runtime.IAdaptable;
-
-/**
- * Interface to be implemented by nodes providing access to an peer
- * model object instance without being a peer model object itself.
- */
-public interface IPeerModelProvider extends IAdaptable {
-
- /**
- * Returns the associated peer model object.
- *
- * @return The peer model object instance or <code>null</code>.
- */
- public IPeerModel getPeerModel();
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.tcf.locator.interfaces.nodes;
+
+import org.eclipse.core.runtime.IAdaptable;
+
+/**
+ * Interface to be implemented by nodes providing access to an peer
+ * model object instance without being a peer model object itself.
+ */
+public interface IPeerNodeProvider extends IAdaptable {
+
+ /**
+ * Returns the associated peer model object.
+ *
+ * @return The peer model object instance or <code>null</code>.
+ */
+ public IPeerNode getPeerModel();
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IDefaultContextService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IDefaultContextService.java
index 4c9b33b4e..939490c63 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IDefaultContextService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IDefaultContextService.java
@@ -10,12 +10,12 @@
package org.eclipse.tcf.te.tcf.locator.interfaces.services;
import org.eclipse.tcf.te.runtime.services.interfaces.IService;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
/**
* Interface to implement by services providing a default context for others.
* <p>
- * The context type of the service is {@link IPeerModel}.
+ * The context type of the service is {@link IPeerNode}.
*/
public interface IDefaultContextService extends IService {
@@ -32,17 +32,17 @@ public interface IDefaultContextService extends IService {
* If the filter is matched, the peer model node is added to the list
* of possible contexts.
*
- * @param peerModel The peer model node. Must not be <code>null</code>.
+ * @param peerNode The peer model node. Must not be <code>null</code>.
* @return <code>true</code> if the given peer model node is a possible candidate.
*/
- public boolean select(IPeerModel peerModel);
+ public boolean select(IPeerNode peerNode);
}
/**
* Return a list of possible candidates matching the given filter.
* <p>
* If a selection is given and the filter applies, the selection will be added first to the
- * resulting array of candidates. Otherwise, if a default selection was set using {@link #setDefaultContext(IPeerModel)},
+ * resulting array of candidates. Otherwise, if a default selection was set using {@link #setDefaultContext(IPeerNode)},
* and the filter applies, the default selection will added first to the resulting array of
* candidates.
* <p>
@@ -54,16 +54,16 @@ public interface IDefaultContextService extends IService {
*
* @return An array of peer model nodes or an empty array.
*/
- public IPeerModel[] getCandidates(Object selection, IContextFilter filter);
+ public IPeerNode[] getCandidates(Object selection, IContextFilter filter);
/**
* Sets the given peer model node as new default context.
* <p>
* If the given peer model node is <code>null</code>, the default context is reseted.
*
- * @param peerModel The peer model node or <code>null</code>.
+ * @param peerNode The peer model node or <code>null</code>.
*/
- public void setDefaultContext(IPeerModel peerModel);
+ public void setDefaultContext(IPeerNode peerNode);
/**
* Returns the default context matching the given context filter.
@@ -71,5 +71,5 @@ public interface IDefaultContextService extends IService {
* @param filter The context filter or <code>null</code>
* @return The default context if set and the filter applies, <code>null</code> otherwise.
*/
- public IPeerModel getDefaultContext(IContextFilter filter);
+ public IPeerNode getDefaultContext(IContextFilter filter);
}
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/IPeerModelLookupService.java
index 97e425baa..63121f94d 100644
--- 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/IPeerModelLookupService.java
@@ -10,12 +10,12 @@
package org.eclipse.tcf.te.tcf.locator.interfaces.services;
import org.eclipse.tcf.protocol.IPeer;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
/**
* The service to lookup/search in the parent locator model.
*/
-public interface ILocatorModelLookupService extends ILocatorModelService {
+public interface IPeerModelLookupService extends IPeerModelService {
/**
* Lookup the peer model for the given peer id.
@@ -23,7 +23,7 @@ public interface ILocatorModelLookupService extends ILocatorModelService {
* @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 IPeerModel lkupPeerModelById(String id);
+ public IPeerNode lkupPeerModelById(String id);
/**
* Lookup the peer model for the given peer id from the peers child list of
@@ -33,7 +33,7 @@ public interface ILocatorModelLookupService extends ILocatorModelService {
* @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 IPeerModel lkupPeerModelById(String parentId, String id);
+ public IPeerNode lkupPeerModelById(String parentId, String id);
/**
* Lookup the matching peer model instances for the given agent id.
@@ -41,7 +41,7 @@ public interface ILocatorModelLookupService extends ILocatorModelService {
* @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 IPeerModel[] lkupPeerModelByAgentId(String agentId);
+ public IPeerNode[] lkupPeerModelByAgentId(String agentId);
/**
* Lookup the matching peer model instances for the given agent id.
@@ -50,7 +50,7 @@ public interface ILocatorModelLookupService extends ILocatorModelService {
* @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 IPeerModel[] lkupPeerModelByAgentId(String parentId, String agentId);
+ public IPeerNode[] lkupPeerModelByAgentId(String parentId, String agentId);
/**
* Lookup matching peer model instances for the given name.
@@ -58,7 +58,7 @@ public interface ILocatorModelLookupService extends ILocatorModelService {
* @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.
*/
- public IPeerModel[] lkupPeerModelByName(String name);
+ public IPeerNode[] lkupPeerModelByName(String name);
/**
* Lookup matching peer model instances which supports the listed local and remote services.
@@ -70,7 +70,7 @@ public interface ILocatorModelLookupService extends ILocatorModelService {
*
* @return The peer model instances, or an empty list if the listed services are not supported by any of the peers.
*/
- public IPeerModel[] lkupPeerModelBySupportedServices(String[] expectedLocalServices, String[] expectedRemoteServices);
+ public IPeerNode[] lkupPeerModelBySupportedServices(String[] expectedLocalServices, String[] expectedRemoteServices);
/**
* Lookup the matching static peer model instances for the given peer model node.
@@ -78,7 +78,7 @@ public interface ILocatorModelLookupService extends ILocatorModelService {
* @param peerNode The peer model node. Must not be <code>null</code>.
* @return The matching peer model instances or an empty list.
*/
- public IPeerModel[] lkupMatchingStaticPeerModels(IPeerModel peerNode);
+ public IPeerNode[] lkupMatchingStaticPeerModels(IPeerNode peerNode);
/**
* Lookup the matching static peer model instances for the given peer.
@@ -86,5 +86,5 @@ public interface ILocatorModelLookupService extends ILocatorModelService {
* @param peer The peer or <code>null</code>.
* @return The matching peer model instances or an empty list.
*/
- public IPeerModel[] lkupMatchingStaticPeerModels(IPeer peer);
+ 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/ILocatorModelPeerNodeQueryService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IPeerModelQueryService.java
index 75a5982e3..70c937814 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/ILocatorModelPeerNodeQueryService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IPeerModelQueryService.java
@@ -9,12 +9,12 @@
*******************************************************************************/
package org.eclipse.tcf.te.tcf.locator.interfaces.services;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
/**
* The service to query asynchronous properties of peers.
*/
-public interface ILocatorModelPeerNodeQueryService extends ILocatorModelService {
+public interface IPeerModelQueryService extends IPeerModelService {
/**
* Query the list of available local services for the given peer.
@@ -27,7 +27,7 @@ public interface ILocatorModelPeerNodeQueryService extends ILocatorModelService
* @param node The peer node. Must not be <code>null</code>.
* @param done The client callback. Must not be <code>null</code>.
*/
- public String queryLocalServices(IPeerModel node);
+ public String queryLocalServices(IPeerNode node);
/**
* Query the list of available remote services for the given peer.
@@ -40,7 +40,7 @@ public interface ILocatorModelPeerNodeQueryService extends ILocatorModelService
* @param node The peer node. Must not be <code>null</code>.
* @param done The client callback. Must not be <code>null</code>.
*/
- public String queryRemoteServices(IPeerModel node);
+ public String queryRemoteServices(IPeerNode node);
/**
* Client call back interface for queryServicesAsync(...).
@@ -62,6 +62,6 @@ public interface ILocatorModelPeerNodeQueryService extends ILocatorModelService
* @param node The peer node. Must not be <code>null</code>.
* @param done The client callback. Must not be <code>null</code>.
*/
- public void queryServicesAsync(IPeerModel node, DoneQueryServices done);
+ public void queryServicesAsync(IPeerNode node, DoneQueryServices done);
}
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/IPeerModelRefreshService.java
index 85e655f97..dc683ea76 100644
--- 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/IPeerModelRefreshService.java
@@ -10,12 +10,12 @@
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.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
/**
* The service to refresh the parent locator model from remote.
*/
-public interface ILocatorModelRefreshService extends ILocatorModelService {
+public interface IPeerModelRefreshService extends IPeerModelService {
/**
* Refreshes the list of known peers from the local locator service
@@ -37,5 +37,5 @@ public interface ILocatorModelRefreshService extends ILocatorModelService {
* @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(IPeerModel[] nodes, ICallback callback);
+ 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/ILocatorModelService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/IPeerModelService.java
index 2cb869948..553c7f986 100644
--- 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/IPeerModelService.java
@@ -3,25 +3,24 @@
* 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;
-
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
/**
- * Common parent interface for locator model services.
+ * Common parent interface for peer model services.
*/
-public interface ILocatorModelService extends IAdaptable {
+public interface IPeerModelService extends IAdaptable {
/**
- * Returns the parent locator model.
+ * Returns the parent peer model.
*
- * @return The parent locator model.
+ * @return The parent peer model.
*/
- public ILocatorModel getLocatorModel();
+ public IPeerModel getPeerModel();
}
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/IPeerModelUpdateService.java
index 7b564ce90..ca2734a98 100644
--- 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/IPeerModelUpdateService.java
@@ -12,13 +12,13 @@ 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.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
/**
* The service to update the properties of given locator model nodes.
*/
-public interface ILocatorModelUpdateService extends ILocatorModelService {
+public interface IPeerModelUpdateService extends IPeerModelService {
/**
* Adds the given peer to the list of know peers.
@@ -27,14 +27,14 @@ public interface ILocatorModelUpdateService extends ILocatorModelService {
*
* @param peer The peer model object. Must not be <code>null</code>.
*/
- public void add(IPeerModel peer);
+ public void add(IPeerNode peer);
/**
* Removes the given peer from the list of known peers.
*
* @param peer The peer model object. Must not be <code>null</code.
*/
- public void remove(IPeerModel peer);
+ public void remove(IPeerNode peer);
/**
* Update the service nodes of the given peer node with the new set of
@@ -44,31 +44,31 @@ public interface ILocatorModelUpdateService extends ILocatorModelService {
* @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(IPeerModel peerNode, Collection<String> localServices, Collection<String> remoteServices);
+ 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 IPeerModel#getParentNode()}.
- * The call has to return a non-null value, otherwise {@link #addChild(IPeerModel)}
+ * <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(IPeerModel child);
+ 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 IPeerModel#getParentNode()}.
- * The call has to return a non-null value, otherwise {@link #removeChild(IPeerModel)}
+ * <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(IPeerModel child);
+ public void removeChild(IPeerNode child);
/**
* Merge user defined peer attributes from the given peer into the given peer node.
@@ -77,5 +77,5 @@ public interface ILocatorModelUpdateService extends ILocatorModelService {
* @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(IPeerModel node, IPeer peer, boolean force);
+ 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/ModelNodeFactoryDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/ModelNodeFactoryDelegate.java
index cfc145c60..142c4efed 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/ModelNodeFactoryDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/ModelNodeFactoryDelegate.java
@@ -1,68 +1,61 @@
-/*******************************************************************************
- * Copyright (c) 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.internal;
-
-import java.util.concurrent.atomic.AtomicReference;
-
-import org.eclipse.tcf.protocol.IPeer;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.runtime.model.factory.AbstractFactoryDelegate2;
-import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
-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.internal.nodes.InvalidPeerModel;
-import org.eclipse.tcf.te.tcf.locator.nodes.PeerModel;
-
-/**
- * Locator model node factory delegate implementation.
- */
-public class ModelNodeFactoryDelegate extends AbstractFactoryDelegate2 {
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.model.interfaces.factory.IFactoryDelegate#newInstance(java.lang.Class)
- */
- @SuppressWarnings("unchecked")
- @Override
- public <V extends IModelNode> V newInstance(Class<V> nodeInterface) {
- if (IPeerModel.class.equals(nodeInterface)) {
- return (V) new InvalidPeerModel();
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.model.interfaces.factory.IFactoryDelegate2#newInstance(java.lang.Class, java.lang.Object[])
- */
- @SuppressWarnings("unchecked")
- @Override
- public <V extends IModelNode> V newInstance(final Class<V> nodeInterface, final Object[] args) {
- if (args == null) return newInstance(nodeInterface);
-
- if (IPeerModel.class.equals(nodeInterface)) {
- // Peer model constructor has 2 arguments, ILocatorModel and IPeer
- if (args.length == 2 && args[0] instanceof ILocatorModel && args[1] instanceof IPeer) {
- final AtomicReference<V> node = new AtomicReference<V>();
-
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- node.set((V) new PeerModel((ILocatorModel)args[0], (IPeer)args[1]));
- }
- };
- if (Protocol.isDispatchThread()) runnable.run();
- else Protocol.invokeAndWait(runnable);
-
- return node.get();
- }
- }
-
- return null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 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.internal;
+
+import java.util.concurrent.atomic.AtomicReference;
+
+import org.eclipse.tcf.protocol.IPeer;
+import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.te.runtime.model.factory.AbstractFactoryDelegate2;
+import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
+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.nodes.PeerNode;
+
+/**
+ * Locator model node factory delegate implementation.
+ */
+public class ModelNodeFactoryDelegate extends AbstractFactoryDelegate2 {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.model.interfaces.factory.IFactoryDelegate#newInstance(java.lang.Class)
+ */
+ @Override
+ public <V extends IModelNode> V newInstance(Class<V> nodeInterface) {
+ return newInstance(nodeInterface, new Object[0]);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.model.interfaces.factory.IFactoryDelegate2#newInstance(java.lang.Class, java.lang.Object[])
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public <V extends IModelNode> V newInstance(final Class<V> nodeInterface, final Object[] args) {
+ if (IPeerNode.class.equals(nodeInterface)) {
+ // Peer model constructor has 2 arguments, IPeerModel and IPeer
+ if (args != null && args.length == 2 && args[0] instanceof IPeerModel && args[1] instanceof IPeer) {
+ final AtomicReference<V> node = new AtomicReference<V>();
+
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ node.set((V) new PeerNode((IPeerModel)args[0], (IPeer)args[1]));
+ }
+ };
+ if (Protocol.isDispatchThread()) runnable.run();
+ else Protocol.invokeAndWait(runnable);
+
+ return node.get();
+ }
+ }
+
+ return null;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/LocatorModelPropertyTester.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/PeerModelPropertyTester.java
index 2ea867dfa..572fd793e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/LocatorModelPropertyTester.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/PeerModelPropertyTester.java
@@ -21,16 +21,16 @@ 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.ILocatorModel;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProperties;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelPeerNodeQueryService;
+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;
/**
* Locator model property tester.
*/
-public class LocatorModelPropertyTester extends PropertyTester {
+public class PeerModelPropertyTester extends PropertyTester {
/* (non-Javadoc)
* @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
@@ -38,25 +38,25 @@ public class LocatorModelPropertyTester extends PropertyTester {
@Override
public boolean test(Object receiver, final String property, final Object[] args, final Object expectedValue) {
if (receiver instanceof IPeer) {
- receiver = Platform.getAdapterManager().getAdapter(receiver, IPeerModel.class);
+ receiver = Platform.getAdapterManager().getAdapter(receiver, IPeerNode.class);
}
// The receiver is expected to be a peer model node or a peer
- if (receiver instanceof IPeerModel) {
- final IPeerModel peerModel = (IPeerModel)receiver;
+ if (receiver instanceof IPeerNode) {
+ 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(peerModel, property, args, expectedValue));
+ result.set(testServices(peerNode, property, args, expectedValue));
}
}
else {
Runnable runnable = new Runnable() {
@Override
public void run() {
- result.set(testPeerModel(peerModel, property, args, expectedValue));
+ result.set(testPeerModel(peerNode, property, args, expectedValue));
}
};
@@ -84,11 +84,11 @@ public class LocatorModelPropertyTester extends PropertyTester {
* @return <code>True</code> if the property to test has the expected value, <code>false</code>
* otherwise.
*/
- protected boolean testPeerModel(IPeerModel peerModel, String property, Object[] args, Object expectedValue) {
- Assert.isNotNull(peerModel);
+ protected boolean testPeerModel(IPeerNode peerNode, String property, Object[] args, Object expectedValue) {
+ Assert.isNotNull(peerNode);
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- IPeer peer = peerModel.getPeer();
+ IPeer peer = peerNode.getPeer();
if ("name".equals(property)) { //$NON-NLS-1$
if (peer.getName() != null && peer.getName().equals(expectedValue)) {
@@ -145,7 +145,7 @@ public class LocatorModelPropertyTester extends PropertyTester {
}
if ("isOfType".equals(property)) { //$NON-NLS-1$
- String value = peer.getAttributes().get(IPeerModelProperties.PROP_TYPE);
+ String value = peer.getAttributes().get(IPeerNodeProperties.PROP_TYPE);
if (expectedValue instanceof String) {
return value != null ? ((String)expectedValue).equals(value) : ((String)expectedValue).equalsIgnoreCase("null"); //$NON-NLS-1$
}
@@ -168,8 +168,8 @@ public class LocatorModelPropertyTester extends PropertyTester {
}
if ("hasOfflineService".equals(property)) { //$NON-NLS-1$
- String offlineServices = peer.getAttributes().get(IPeerModelProperties.PROP_OFFLINE_SERVICES);
- String remoteServices = peerModel.getStringProperty(IPeerModelProperties.PROP_REMOTE_SERVICES);
+ String offlineServices = peer.getAttributes().get(IPeerNodeProperties.PROP_OFFLINE_SERVICES);
+ String remoteServices = peerNode.getStringProperty(IPeerNodeProperties.PROP_REMOTE_SERVICES);
List<String> offline = offlineServices != null ? Arrays.asList(offlineServices.split(",\\s*")) : Collections.EMPTY_LIST; //$NON-NLS-1$
List<String> remote = remoteServices != null ? Arrays.asList(remoteServices.split(",\\s*")) : null; //$NON-NLS-1$
boolean hasOfflineService = (remote == null) ? offline.contains(expectedValue) : remote.contains(expectedValue);
@@ -195,14 +195,14 @@ public class LocatorModelPropertyTester extends PropertyTester {
* @return <code>True</code> if the property to test has the expected value, <code>false</code>
* otherwise.
*/
- protected boolean testServices(final IPeerModel node, final String property, final Object[] args, final Object expectedValue) {
+ 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;
- ILocatorModel model = node.getModel();
- ILocatorModelPeerNodeQueryService queryService = model.getService(ILocatorModelPeerNodeQueryService.class);
+ IPeerModel model = node.getModel();
+ IPeerModelQueryService queryService = model.getService(IPeerModelQueryService.class);
if ("hasLocalService".equals(property)) { //$NON-NLS-1$
services = queryService.queryLocalServices(node);
} else {
@@ -211,7 +211,7 @@ public class LocatorModelPropertyTester extends PropertyTester {
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, LocatorModelPropertyTester.this);
+ ITracing.ID_TRACE_PROPERTY_TESTER, PeerModelPropertyTester.this);
}
if (services != null) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/SimulatorPropertyTester.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/SimulatorPropertyTester.java
index 75cfbfb82..55a11c9c0 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/SimulatorPropertyTester.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/SimulatorPropertyTester.java
@@ -11,7 +11,7 @@
package org.eclipse.tcf.te.tcf.locator.internal;
import org.eclipse.tcf.te.runtime.services.interfaces.ISimulatorService.State;
-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.utils.SimulatorUtils;
import org.eclipse.tcf.te.tcf.locator.utils.SimulatorUtils.Result;
@@ -27,9 +27,9 @@ public class SimulatorPropertyTester extends org.eclipse.core.expressions.Proper
*/
@Override
public boolean test(final Object receiver, String property, Object[] args, Object expectedValue) {
- if (receiver instanceof IPeerModel) {
- final IPeerModel peerModel = (IPeerModel) receiver;
- Result result = SimulatorUtils.getSimulatorService(peerModel);
+ if (receiver instanceof IPeerNode) {
+ final IPeerNode peerNode = (IPeerNode) receiver;
+ Result result = SimulatorUtils.getSimulatorService(peerNode);
if (result.service != null) {
if ("isSimulatorState".equals(property) && expectedValue instanceof String) { //$NON-NLS-1$
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 5f698a49d..cdbede25b 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
@@ -20,10 +20,10 @@ import org.eclipse.tcf.te.core.interfaces.IConnectable;
import org.eclipse.tcf.te.runtime.model.factory.Factory;
import org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistableURIProvider;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProvider;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelLookupService;
import org.eclipse.tcf.te.tcf.locator.model.Model;
/**
@@ -34,7 +34,7 @@ public class AdapterFactory implements IAdapterFactory {
private final IPersistableURIProvider peerModelPersistableURIProvider = new PeerPersistableURIProvider();
private static final Class<?>[] CLASSES = new Class[] {
- IPersistableURIProvider.class, IPeerModel.class, IConnectable.class, ILocatorModel.class
+ IPersistableURIProvider.class, IPeerNode.class, IConnectable.class, IPeerModel.class
};
/* (non-Javadoc)
@@ -52,30 +52,30 @@ public class AdapterFactory implements IAdapterFactory {
return adaptableObject;
}
}
- if (ILocatorModel.class.isAssignableFrom(adapterType)) {
- if (adaptableObject instanceof IPeerModel) {
- return ((IPeerModel)adaptableObject).getModel();
+ if (IPeerModel.class.isAssignableFrom(adapterType)) {
+ if (adaptableObject instanceof IPeerNode) {
+ return ((IPeerNode)adaptableObject).getModel();
}
}
- if (adaptableObject instanceof IPeerModel || adaptableObject instanceof IPeer || adaptableObject instanceof IPeerModelProvider) {
+ if (adaptableObject instanceof IPeerNode || adaptableObject instanceof IPeer || adaptableObject instanceof IPeerNodeProvider) {
if (IPersistableURIProvider.class.equals(adapterType)) {
return peerModelPersistableURIProvider;
}
- if (IPeerModel.class.equals(adapterType)) {
+ if (IPeerNode.class.equals(adapterType)) {
if (adaptableObject instanceof IPeer) {
- final AtomicReference<IPeerModel> node = new AtomicReference<IPeerModel>();
+ final AtomicReference<IPeerNode> node = new AtomicReference<IPeerNode>();
final IPeer peer = (IPeer)adaptableObject;
Runnable runnable = new Runnable() {
@Override
public void run() {
String id = peer.getID();
- ILocatorModel model = Model.getModel();
+ IPeerModel model = Model.getModel();
Assert.isNotNull(model);
- IPeerModel candidate = model.getService(ILocatorModelLookupService.class).lkupPeerModelById(id);
+ IPeerNode candidate = model.getService(IPeerModelLookupService.class).lkupPeerModelById(id);
if (candidate != null) node.set(candidate);
else {
- candidate = Factory.getInstance().newInstance(IPeerModel.class, new Object[] { model, peer });
+ candidate = Factory.getInstance().newInstance(IPeerNode.class, new Object[] { model, peer });
if (candidate != null) node.set(candidate);
}
}
@@ -86,12 +86,12 @@ public class AdapterFactory implements IAdapterFactory {
return node.get();
}
- else if (adaptableObject instanceof IPeerModel) {
+ else if (adaptableObject instanceof IPeerNode) {
return adaptableObject;
}
- else if (adaptableObject instanceof IPeerModelProvider) {
- final AtomicReference<IPeerModel> node = new AtomicReference<IPeerModel>();
- final IPeerModelProvider provider = (IPeerModelProvider)adaptableObject;
+ else if (adaptableObject instanceof IPeerNodeProvider) {
+ final AtomicReference<IPeerNode> node = new AtomicReference<IPeerNode>();
+ final IPeerNodeProvider provider = (IPeerNodeProvider)adaptableObject;
Runnable runnable = new Runnable() {
@Override
@@ -107,8 +107,8 @@ public class AdapterFactory implements IAdapterFactory {
}
}
if (IStepContext.class.equals(adapterType)) {
- if (adaptableObject instanceof IPeerModel) {
- return new PeerModelStepContext((IPeerModel)adaptableObject);
+ if (adaptableObject instanceof IPeerNode) {
+ return new PeerNodeStepContext((IPeerNode)adaptableObject);
}
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/adapters/PeerModelStepContext.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/adapters/PeerNodeStepContext.java
index 440760606..f73e853fd 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/adapters/PeerModelStepContext.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/adapters/PeerNodeStepContext.java
@@ -11,26 +11,26 @@ package org.eclipse.tcf.te.tcf.locator.internal.adapters;
import org.eclipse.tcf.protocol.IPeer;
import org.eclipse.tcf.te.runtime.stepper.context.AbstractStepContext;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
/**
* Peer model step context implementation.
*/
-public class PeerModelStepContext extends AbstractStepContext {
+public class PeerNodeStepContext extends AbstractStepContext {
/**
* Constructor
*/
- public PeerModelStepContext(IPeerModel peerModel) {
- super(peerModel);
+ public PeerNodeStepContext(IPeerNode peerNode) {
+ super(peerNode);
}
/**
* Returns the peer model.
* @return The peer model.
*/
- public IPeerModel getPeerModel() {
- return (IPeerModel)getContextObject();
+ public IPeerNode getPeerModel() {
+ return (IPeerNode)getContextObject();
}
/* (non-Javadoc)
@@ -54,7 +54,7 @@ public class PeerModelStepContext extends AbstractStepContext {
*/
@Override
public Object getAdapter(final Class adapter) {
- if (IPeerModel.class.equals(adapter)) {
+ if (IPeerNode.class.equals(adapter)) {
return getPeerModel();
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/adapters/PeerPersistableURIProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/adapters/PeerPersistableURIProvider.java
index eaad3b69a..2ecb42a3f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/adapters/PeerPersistableURIProvider.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/adapters/PeerPersistableURIProvider.java
@@ -1,109 +1,109 @@
-/*******************************************************************************
- * 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.internal.adapters;
-
-import java.net.URI;
-import java.util.concurrent.atomic.AtomicReference;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.tcf.protocol.IPeer;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.core.adapters.ModelNodePersistableURIProvider;
-import org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistableNodeProperties;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider;
-import org.eclipse.tcf.te.tcf.locator.model.ModelLocationUtil;
-
-/**
- * Persistable implementation handling peer attributes.
- */
-public class PeerPersistableURIProvider extends ModelNodePersistableURIProvider {
-
- /**
- * Determine the peer from the given context object.
- *
- * @param context The context object or <code>null</code>.
- * @return The peer or <code>null</code>.
- */
- private IPeer getPeer(Object context) {
- IPeer peer = null;
-
- if (context instanceof IPeer) {
- peer = (IPeer)context;
- }
- else if (context instanceof IPeerModel) {
- peer = ((IPeerModel)context).getPeer();
- }
- else if (context instanceof IPeerModelProvider) {
- peer = ((IPeerModelProvider)context).getPeerModel().getPeer();
- }
-
- return peer;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistableURIProvider#getURI(java.lang.Object)
- */
- @Override
- public URI getURI(final Object context) {
- Assert.isNotNull(context);
-
- URI uri = null;
- final IPeer peer = getPeer(context);
-
- if (peer != null) {
- // Get the URI the peer model has been created from
- final AtomicReference<URI> nodeURI = new AtomicReference<URI>();
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- String value = peer.getAttributes().get(IPersistableNodeProperties.PROPERTY_URI);
- if (value != null && !"".equals(value.trim())) { //$NON-NLS-1$
- nodeURI.set(URI.create(value.trim()));
- }
- }
- };
- if (Protocol.isDispatchThread()) {
- runnable.run();
- }
- else {
- Protocol.invokeAndWait(runnable);
- }
-
- if (nodeURI.get() != null) {
- uri = nodeURI.get();
- }
-
- if (uri == null) {
- String name = peer.getName();
- if (name == null) {
- name = peer.getID();
- }
- name = makeValidFileSystemName(name);
- // Get the URI from the name
- uri = getRoot().append(name).toFile().toURI();
-
- }
- }
-
- return uri;
- }
-
- /**
- * Returns the root location of the peers storage.
- *
- * @return The root location or <code>null</code> if it cannot be determined.
- */
- @Override
- public IPath getRoot() {
- return ModelLocationUtil.getStaticPeersRootLocation();
- }
-}
+/*******************************************************************************
+ * 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.internal.adapters;
+
+import java.net.URI;
+import java.util.concurrent.atomic.AtomicReference;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.tcf.protocol.IPeer;
+import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.te.core.adapters.ModelNodePersistableURIProvider;
+import org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistableNodeProperties;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProvider;
+import org.eclipse.tcf.te.tcf.locator.model.ModelLocationUtil;
+
+/**
+ * Persistable implementation handling peer attributes.
+ */
+public class PeerPersistableURIProvider extends ModelNodePersistableURIProvider {
+
+ /**
+ * Determine the peer from the given context object.
+ *
+ * @param context The context object or <code>null</code>.
+ * @return The peer or <code>null</code>.
+ */
+ private IPeer getPeer(Object context) {
+ IPeer peer = null;
+
+ if (context instanceof IPeer) {
+ peer = (IPeer)context;
+ }
+ else if (context instanceof IPeerNode) {
+ peer = ((IPeerNode)context).getPeer();
+ }
+ else if (context instanceof IPeerNodeProvider) {
+ peer = ((IPeerNodeProvider)context).getPeerModel().getPeer();
+ }
+
+ return peer;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistableURIProvider#getURI(java.lang.Object)
+ */
+ @Override
+ public URI getURI(final Object context) {
+ Assert.isNotNull(context);
+
+ URI uri = null;
+ final IPeer peer = getPeer(context);
+
+ if (peer != null) {
+ // Get the URI the peer model has been created from
+ final AtomicReference<URI> nodeURI = new AtomicReference<URI>();
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ String value = peer.getAttributes().get(IPersistableNodeProperties.PROPERTY_URI);
+ if (value != null && !"".equals(value.trim())) { //$NON-NLS-1$
+ nodeURI.set(URI.create(value.trim()));
+ }
+ }
+ };
+ if (Protocol.isDispatchThread()) {
+ runnable.run();
+ }
+ else {
+ Protocol.invokeAndWait(runnable);
+ }
+
+ if (nodeURI.get() != null) {
+ uri = nodeURI.get();
+ }
+
+ if (uri == null) {
+ String name = peer.getName();
+ if (name == null) {
+ name = peer.getID();
+ }
+ name = makeValidFileSystemName(name);
+ // Get the URI from the name
+ uri = getRoot().append(name).toFile().toURI();
+
+ }
+ }
+
+ return uri;
+ }
+
+ /**
+ * Returns the root location of the peers storage.
+ *
+ * @return The root location or <code>null</code> if it cannot be determined.
+ */
+ @Override
+ public IPath getRoot() {
+ return ModelLocationUtil.getStaticPeersRootLocation();
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/nodes/InvalidPeerModel.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/nodes/InvalidPeerModel.java
deleted file mode 100644
index 431592035..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/nodes/InvalidPeerModel.java
+++ /dev/null
@@ -1,538 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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.internal.nodes;
-
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.tcf.protocol.IPeer;
-import org.eclipse.tcf.te.runtime.model.interfaces.IContainerModelNode;
-import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
-import org.eclipse.tcf.te.runtime.model.interfaces.factory.IFactoryDelegate;
-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.internal.ModelNodeFactoryDelegate;
-
-/**
- * Invalid peer model node implementation. All methods does throw an {@link IllegalStateException}.
- * <p>
- * Objects of this class are returned by the {@link ModelNodeFactoryDelegate} if calling
- * {@link IFactoryDelegate#newInstance(Class)}. All what objects of this class can be used for is
- * loading adapters.
- */
-public final class InvalidPeerModel implements IPeerModel {
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.model.interfaces.IContainerModelNode#add(org.eclipse.tcf.te.runtime.model.interfaces.IModelNode)
- */
- @Override
- public boolean add(IModelNode child) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.model.interfaces.IContainerModelNode#remove(org.eclipse.tcf.te.runtime.model.interfaces.IModelNode, boolean)
- */
- @Override
- public boolean remove(IModelNode node, boolean recursive) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.model.interfaces.IContainerModelNode#clear()
- */
- @Override
- public boolean clear() {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.model.interfaces.IContainerModelNode#removeAll(java.lang.Class)
- */
- @Override
- public <T> boolean removeAll(Class<T> nodeType) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.model.interfaces.IContainerModelNode#getChildren()
- */
- @Override
- public IModelNode[] getChildren() {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.model.interfaces.IContainerModelNode#getChildren(java.lang.Class)
- */
- @Override
- public <T> List<T> getChildren(Class<T> nodeType) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.model.interfaces.IContainerModelNode#hasChildren()
- */
- @Override
- public boolean hasChildren() {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.model.interfaces.IContainerModelNode#size()
- */
- @Override
- public int size() {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.model.interfaces.IContainerModelNode#contains(org.eclipse.tcf.te.runtime.model.interfaces.IModelNode)
- */
- @Override
- public boolean contains(IModelNode node) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.model.interfaces.IModelNode#getParent()
- */
- @Override
- public IContainerModelNode getParent() {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.model.interfaces.IModelNode#getParent(java.lang.Class)
- */
- @Override
- public <V extends IContainerModelNode> V getParent(Class<V> nodeType) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.model.interfaces.IModelNode#setParent(org.eclipse.tcf.te.runtime.model.interfaces.IContainerModelNode)
- */
- @Override
- public void setParent(IContainerModelNode parent) throws IllegalStateException {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.model.interfaces.IModelNode#move(org.eclipse.tcf.te.runtime.model.interfaces.IContainerModelNode)
- */
- @Override
- public void move(IContainerModelNode newParent) throws IllegalStateException {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.model.interfaces.IModelNode#isVisible()
- */
- @Override
- public boolean isVisible() {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.model.interfaces.IModelNode#getName()
- */
- @Override
- public String getName() {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.model.interfaces.IModelNode#getImageId()
- */
- @Override
- public String getImageId() {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.model.interfaces.IModelNode#getError()
- */
- @Override
- public String getError() {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.model.interfaces.IModelNode#getDescription()
- */
- @Override
- public String[] getDescription() {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.model.interfaces.IModelNode#setDirty(boolean)
- */
- @Override
- public void setDirty(boolean dirty) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.model.interfaces.IModelNode#isDirty()
- */
- @Override
- public boolean isDirty() {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.model.interfaces.IModelNode#setPending(boolean)
- */
- @Override
- public void setPending(boolean pending) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.model.interfaces.IModelNode#isPending()
- */
- @Override
- public boolean isPending() {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.model.interfaces.IModelNode#find(java.util.UUID)
- */
- @Override
- public IModelNode find(UUID uuid) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#getUUID()
- */
- @Override
- public UUID getUUID() {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#setChangeEventsEnabled(boolean)
- */
- @Override
- public boolean setChangeEventsEnabled(boolean enabled) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#changeEventsEnabled()
- */
- @Override
- public boolean changeEventsEnabled() {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#fireChangeEvent(java.lang.String, java.lang.Object, java.lang.Object)
- */
- @Override
- public void fireChangeEvent(String key, Object oldValue, Object newValue) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#setProperties(java.util.Map)
- */
- @Override
- public void setProperties(Map<String, Object> properties) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#setProperty(java.lang.String, java.lang.Object)
- */
- @Override
- public boolean setProperty(String key, Object value) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#setProperty(java.lang.String, long)
- */
- @Override
- public boolean setProperty(String key, long value) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#setProperty(java.lang.String, int)
- */
- @Override
- public boolean setProperty(String key, int value) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#setProperty(java.lang.String, boolean)
- */
- @Override
- public boolean setProperty(String key, boolean value) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#setProperty(java.lang.String, float)
- */
- @Override
- public boolean setProperty(String key, float value) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#setProperty(java.lang.String, double)
- */
- @Override
- public boolean setProperty(String key, double value) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#getProperties()
- */
- @Override
- public Map<String, Object> getProperties() {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#getProperty(java.lang.String)
- */
- @Override
- public Object getProperty(String key) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#getStringProperty(java.lang.String)
- */
- @Override
- public String getStringProperty(String key) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#getLongProperty(java.lang.String)
- */
- @Override
- public long getLongProperty(String key) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#getIntProperty(java.lang.String)
- */
- @Override
- public int getIntProperty(String key) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#getBooleanProperty(java.lang.String)
- */
- @Override
- public boolean getBooleanProperty(String key) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#getFloatProperty(java.lang.String)
- */
- @Override
- public float getFloatProperty(String key) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#getDoubleProperty(java.lang.String)
- */
- @Override
- public double getDoubleProperty(String key) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#clearProperties()
- */
- @Override
- public void clearProperties() {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#isEmpty()
- */
- @Override
- public boolean isEmpty() {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#isPropertyIgnoreCase(java.lang.String, java.lang.String)
- */
- @Override
- public boolean isPropertyIgnoreCase(String key, String value) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#isProperty(java.lang.String, java.lang.Object)
- */
- @Override
- public boolean isProperty(String key, Object value) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#isProperty(java.lang.String, long)
- */
- @Override
- public boolean isProperty(String key, long value) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#isProperty(java.lang.String, int)
- */
- @Override
- public boolean isProperty(String key, int value) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#isProperty(java.lang.String, boolean)
- */
- @Override
- public boolean isProperty(String key, boolean value) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#isProperty(java.lang.String, float)
- */
- @Override
- public boolean isProperty(String key, float value) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#isProperty(java.lang.String, double)
- */
- @Override
- public boolean isProperty(String key, double value) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- @Override
- public Object getAdapter(Class adapter) {
- return Platform.getAdapterManager().getAdapter(this, adapter);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.ISchedulingRule#contains(org.eclipse.core.runtime.jobs.ISchedulingRule)
- */
- @Override
- public boolean contains(ISchedulingRule rule) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.ISchedulingRule#isConflicting(org.eclipse.core.runtime.jobs.ISchedulingRule)
- */
- @Override
- public boolean isConflicting(ISchedulingRule rule) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel#getModel()
- */
- @Override
- public ILocatorModel getModel() {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel#getPeer()
- */
- @Override
- public IPeer getPeer() {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel#getPeerId()
- */
- @Override
- public String getPeerId() {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel#getRemotePeerId()
- */
- @Override
- public String getRemotePeerId() {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel#isComplete()
- */
- @Override
- public boolean isComplete() {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel#isStatic()
- */
- @Override
- public boolean isStatic() {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel#isRemote()
- */
- @Override
- public boolean isRemote() {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#addProperties(java.util.Map)
- */
- @Override
- public void addProperties(Map<String, ?> properties) {
- throw new IllegalStateException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#containsKey(java.lang.String)
- */
- @Override
- public boolean containsKey(String key) {
- throw new IllegalStateException();
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/services/PropertiesAccessService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/services/PropertiesAccessService.java
index f7020a334..9af952156 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/services/PropertiesAccessService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/services/PropertiesAccessService.java
@@ -16,7 +16,7 @@ import java.util.Map;
import org.eclipse.tcf.protocol.IPeer;
import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.te.runtime.services.interfaces.constants.IPropertiesAccessServiceConstants;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
/**
* Peer model properties access service implementation.
@@ -30,13 +30,22 @@ public class PropertiesAccessService extends org.eclipse.tcf.te.tcf.core.model.s
public Map<String, String> getTargetAddress(Object context) {
final Map<String, String> result = new HashMap<String, String>();
- if (context instanceof IPeerModel) {
- final IPeerModel peerModel = (IPeerModel) context;
+ final IPeer peer;
+ if (context instanceof IPeer) {
+ peer = (IPeer)context;
+ }
+ else if (context instanceof IPeerNode) {
+ peer = ((IPeerNode)context).getPeer();
+ }
+ else {
+ peer = null;
+ }
- Runnable runnable = new Runnable() {
+ if (peer != null) {
+ Protocol.invokeAndWait(new Runnable() {
@Override
public void run() {
- Map<String, String> attributes = peerModel.getPeer().getAttributes();
+ Map<String, String> attributes = peer.getAttributes();
String value = attributes.get(IPeer.ATTR_NAME);
if (value != null && !"".equals(value.trim())) { //$NON-NLS-1$
@@ -52,10 +61,7 @@ public class PropertiesAccessService extends org.eclipse.tcf.te.tcf.core.model.s
result.put(IPropertiesAccessServiceConstants.PROP_PORT, value);
}
}
- };
-
- if (Protocol.isDispatchThread()) runnable.run();
- else Protocol.invokeAndWait(runnable);
+ });
}
return !result.isEmpty() ? Collections.unmodifiableMap(result) : null;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/iterators/AbstractPeerModelStepGroupIterator.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/iterators/AbstractPeerNodeStepGroupIterator.java
index 52e840308..254e83209 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/iterators/AbstractPeerModelStepGroupIterator.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/iterators/AbstractPeerNodeStepGroupIterator.java
@@ -1,46 +1,46 @@
-/*******************************************************************************
- * 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.iterators;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-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.core.iterators.AbstractPeerStepGroupIterator;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-
-/**
- * Abstract launch stepgroup iterator.
- */
-public abstract class AbstractPeerModelStepGroupIterator extends AbstractPeerStepGroupIterator {
-
- /**
- * Returns the active peer model context that is currently used.
- *
- * @param context The step context. Must not be <code>null</code>.
- * @param data The data giving object. Must not be <code>null</code>.
- * @param fullQualifiedId The full qualfied id for this step. Must not be <code>null</code>.
- * @return The active peer model context.
- */
- protected IPeerModel getActivePeerModelContext(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId) {
- Object activeContext = getActiveContext(context, data, fullQualifiedId);
- IPeerModel peerModel = null;
- if (activeContext instanceof IPeerModel)
- return (IPeerModel)activeContext;
- if (activeContext instanceof IAdaptable)
- peerModel = (IPeerModel)((IAdaptable)activeContext).getAdapter(IPeerModel.class);
- if (peerModel == null)
- peerModel = (IPeerModel)Platform.getAdapterManager().getAdapter(activeContext, IPeerModel.class);
-
- return peerModel;
- }
-}
+/*******************************************************************************
+ * 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.iterators;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.Platform;
+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.core.iterators.AbstractPeerStepGroupIterator;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
+
+/**
+ * Abstract launch stepgroup iterator.
+ */
+public abstract class AbstractPeerNodeStepGroupIterator extends AbstractPeerStepGroupIterator {
+
+ /**
+ * Returns the active peer model context that is currently used.
+ *
+ * @param context The step context. Must not be <code>null</code>.
+ * @param data The data giving object. Must not be <code>null</code>.
+ * @param fullQualifiedId The full qualfied id for this step. Must not be <code>null</code>.
+ * @return The active peer model context.
+ */
+ protected IPeerNode getActivePeerModelContext(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId) {
+ Object activeContext = getActiveContext(context, data, fullQualifiedId);
+ IPeerNode peerNode = null;
+ if (activeContext instanceof IPeerNode)
+ return (IPeerNode)activeContext;
+ if (activeContext instanceof IAdaptable)
+ peerNode = (IPeerNode)((IAdaptable)activeContext).getAdapter(IPeerNode.class);
+ if (peerNode == null)
+ peerNode = (IPeerNode)Platform.getAdapterManager().getAdapter(activeContext, IPeerNode.class);
+
+ return peerNode;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/iterators/StartDebuggerIterator.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/iterators/StartDebuggerIterator.java
index 2d789a7ce..0acc3cacc 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/iterators/StartDebuggerIterator.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/iterators/StartDebuggerIterator.java
@@ -20,13 +20,13 @@ import org.eclipse.tcf.te.runtime.stepper.StepperAttributeUtil;
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.IStepAttributes;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProperties;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties;
/**
* Step group iterator for debugger attach.
*/
-public class StartDebuggerIterator extends AbstractPeerModelStepGroupIterator {
+public class StartDebuggerIterator extends AbstractPeerNodeStepGroupIterator {
/**
* Constructor.
@@ -44,11 +44,11 @@ public class StartDebuggerIterator extends AbstractPeerModelStepGroupIterator {
final AtomicBoolean autoStartDbg = new AtomicBoolean(false);
- final IPeerModel node = getActivePeerModelContext(context, data, fullQualifiedId);
+ final IPeerNode node = getActivePeerModelContext(context, data, fullQualifiedId);
Runnable runnable = new Runnable() {
@Override
public void run() {
- String value = node.getPeer().getAttributes().get(IPeerModelProperties.PROP_AUTO_START_DEBUGGER);
+ String value = node.getPeer().getAttributes().get(IPeerNodeProperties.PROP_AUTO_START_DEBUGGER);
autoStartDbg.set(value != null ? Boolean.parseBoolean(value) : false);
}
};
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/iterators/StartSimulatorIterator.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/iterators/StartSimulatorIterator.java
index 19188f5bb..945c3de8d 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/iterators/StartSimulatorIterator.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/iterators/StartSimulatorIterator.java
@@ -1,50 +1,50 @@
-/*******************************************************************************
- * 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.iterators;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-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.utils.SimulatorUtils;
-
-/**
- * Step group iterator for simulator start.
- */
-public class StartSimulatorIterator extends AbstractPeerModelStepGroupIterator {
-
- /**
- * Constructor.
- */
- public StartSimulatorIterator() {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.iterators.AbstractStepGroupIterator#initialize(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 initialize(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
- super.initialize(context, data, fullQualifiedId, monitor);
-
- SimulatorUtils.Result result = SimulatorUtils.getSimulatorService(getActivePeerModelContext(context, data, fullQualifiedId));
-
- setIterations(result != null ? 1 : 0);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.iterators.AbstractStepGroupIterator#internalNext(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 internalNext(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
- }
-}
+/*******************************************************************************
+ * 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.iterators;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+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.utils.SimulatorUtils;
+
+/**
+ * Step group iterator for simulator start.
+ */
+public class StartSimulatorIterator extends AbstractPeerNodeStepGroupIterator {
+
+ /**
+ * Constructor.
+ */
+ public StartSimulatorIterator() {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.iterators.AbstractStepGroupIterator#initialize(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 initialize(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
+ super.initialize(context, data, fullQualifiedId, monitor);
+
+ SimulatorUtils.Result result = SimulatorUtils.getSimulatorService(getActivePeerModelContext(context, data, fullQualifiedId));
+
+ setIterations(result != null ? 1 : 0);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.iterators.AbstractStepGroupIterator#internalNext(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 internalNext(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
+ }
+}
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
index afc433394..6a06ca132 100644
--- 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
@@ -16,10 +16,10 @@ 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.ILocatorModel;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProperties;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService;
+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;
/**
@@ -27,14 +27,14 @@ import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupSer
*/
public class ChannelStateChangeListener implements IChannelStateChangeListener {
// Reference to the parent model
- private final ILocatorModel model;
+ private final IPeerModel model;
/**
* Constructor.
*
* @param model The parent locator model. Must not be <code>null</code>.
*/
- public ChannelStateChangeListener(ILocatorModel model) {
+ public ChannelStateChangeListener(IPeerModel model) {
Assert.isNotNull(model);
this.model = model;
}
@@ -57,14 +57,14 @@ public class ChannelStateChangeListener implements IChannelStateChangeListener {
IPeer peer = channel.getRemotePeer();
if (peer != null && peer.getID() != null) {
// Find the corresponding model node
- IPeerModel node = model.getService(ILocatorModelLookupService.class).lkupPeerModelById(peer.getID());
+ IPeerNode node = model.getService(IPeerModelLookupService.class).lkupPeerModelById(peer.getID());
if (node != null) {
// Increase the channel reference counter by 1
- int counter = node.getIntProperty(IPeerModelProperties.PROP_CHANNEL_REF_COUNTER);
+ int counter = node.getIntProperty(IPeerNodeProperties.PROP_CHANNEL_REF_COUNTER);
if (counter < 0) counter = 0;
counter++;
- node.setProperty(IPeerModelProperties.PROP_CHANNEL_REF_COUNTER, counter);
- if (counter > 0) node.setProperty(IPeerModelProperties.PROP_STATE, IPeerModelProperties.STATE_CONNECTED);
+ node.setProperty(IPeerNodeProperties.PROP_CHANNEL_REF_COUNTER, counter);
+ if (counter > 0) node.setProperty(IPeerNodeProperties.PROP_STATE, IPeerNodeProperties.STATE_CONNECTED);
}
}
break;
@@ -72,15 +72,15 @@ public class ChannelStateChangeListener implements IChannelStateChangeListener {
peer = channel.getRemotePeer();
if (peer != null && peer.getID() != null) {
// Find the corresponding model node
- IPeerModel node = model.getService(ILocatorModelLookupService.class).lkupPeerModelById(peer.getID());
+ IPeerNode node = model.getService(IPeerModelLookupService.class).lkupPeerModelById(peer.getID());
if (node != null) {
// Decrease the channel reference counter by 1
- int counter = node.getIntProperty(IPeerModelProperties.PROP_CHANNEL_REF_COUNTER);
+ int counter = node.getIntProperty(IPeerNodeProperties.PROP_CHANNEL_REF_COUNTER);
counter--;
if (counter < 0) counter = 0;
- node.setProperty(IPeerModelProperties.PROP_CHANNEL_REF_COUNTER, counter);
- if (counter == 0 && node.isProperty(IPeerModelProperties.PROP_STATE, IPeerModelProperties.STATE_CONNECTED)) {
- node.setProperty(IPeerModelProperties.PROP_STATE, IPeerModelProperties.STATE_REACHABLE);
+ node.setProperty(IPeerNodeProperties.PROP_CHANNEL_REF_COUNTER, counter);
+ if (counter == 0 && node.isProperty(IPeerNodeProperties.PROP_STATE, IPeerNodeProperties.STATE_CONNECTED)) {
+ node.setProperty(IPeerNodeProperties.PROP_STATE, IPeerNodeProperties.STATE_REACHABLE);
}
}
}
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 42476448b..27ba6659f 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
@@ -29,13 +29,13 @@ 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.ILocatorModel;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProperties;
-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;
-import org.eclipse.tcf.te.tcf.locator.nodes.PeerModel;
+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;
@@ -44,14 +44,14 @@ import org.eclipse.tcf.te.tcf.locator.nodes.PeerRedirector;
*/
public final class LocatorListener implements ILocator.LocatorListener {
// Reference to the parent model
- /* default */ final ILocatorModel model;
+ /* default */ final IPeerModel model;
/**
* Constructor.
*
* @param model The parent locator model. Must not be <code>null</code>.
*/
- public LocatorListener(ILocatorModel model) {
+ public LocatorListener(IPeerModel model) {
super();
Assert.isNotNull(model);
@@ -96,28 +96,26 @@ public final class LocatorListener implements ILocator.LocatorListener {
if (model != null && peer != null) {
// find the corresponding model node to remove (expected to be null)
- IPeerModel peerNode = model.getService(ILocatorModelLookupService.class).lkupPeerModelById(peer.getID());
+ IPeerNode peerNode = model.getService(IPeerModelLookupService.class).lkupPeerModelById(peer.getID());
if (peerNode == null) {
// Double check with "ClientID" if set
String clientID = peer.getAttributes().get("ClientID"); //$NON-NLS-1$
if (clientID != null) {
- peerNode = model.getService(ILocatorModelLookupService.class).lkupPeerModelById(clientID);
+ peerNode = model.getService(IPeerModelLookupService.class).lkupPeerModelById(clientID);
}
}
// If not found, create a new peer node instance
if (peerNode == null) {
- peerNode = new PeerModel(model, peer);
+ 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<IPeerModel> nodes = new ArrayList<IPeerModel>();
+ List<IPeerNode> nodes = new ArrayList<IPeerNode>();
- for (IPeerModel node : model.getPeers()) {
- // Skip static nodes
- if (!node.isStatic()) continue;
+ for (IPeerNode node : model.getPeers()) {
// We expect the agent ID to be set
if (node.getPeer().getAgentID() == null || "".equals(node.getPeer().getAgentID())) { //$NON-NLS-1$
nodes.add(node);
@@ -125,31 +123,31 @@ public final class LocatorListener implements ILocator.LocatorListener {
}
// Create the runnable to execute after the agent ID refresh (if needed)
- final IPeerModel finPeerNode = peerNode;
+ final IPeerNode finPeerNode = peerNode;
final IPeer finPeer = peer;
final Runnable runnable = new Runnable() {
@Override
public void run() {
- IPeerModel[] matches = model.getService(ILocatorModelLookupService.class).lkupMatchingStaticPeerModels(finPeerNode);
+ 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(ILocatorModelLookupService.class).lkupPeerModelById(finPeerNode.getPeerId()) != null) {
+ 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(ILocatorModelUpdateService.class).remove(finPeerNode);
+ model.getService(IPeerModelUpdateService.class).remove(finPeerNode);
- for (IPeerModel match : matches) {
+ 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(ILocatorModelUpdateService.class).mergeUserDefinedAttributes(match, myPeer, true);
+ model.getService(IPeerModelUpdateService.class).mergeUserDefinedAttributes(match, myPeer, true);
if (changed) match.setChangeEventsEnabled(true);
- match.fireChangeEvent(IPeerModelProperties.PROP_INSTANCE, myPeer, match.getPeer());
+ match.fireChangeEvent(IPeerNodeProperties.PROP_INSTANCE, myPeer, match.getPeer());
// And schedule for immediate status update
Runnable runnable2 = new ScannerRunnable(model.getScanner(), match);
Protocol.invokeLater(runnable2);
@@ -161,11 +159,11 @@ public final class LocatorListener implements ILocator.LocatorListener {
// 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(ILocatorModelUpdateService.class).add(peerNode);
+ model.getService(IPeerModelUpdateService.class).add(peerNode);
if (nodes.size() > 0) {
// Refresh the agent ID's first
- model.getService(ILocatorModelRefreshService.class).refreshAgentIDs(nodes.toArray(new IPeerModel[nodes.size()]), new Callback() {
+ model.getService(IPeerModelRefreshService.class).refreshAgentIDs(nodes.toArray(new IPeerNode[nodes.size()]), new Callback() {
@Override
protected void internalDone(Object caller, IStatus status) {
// Ignore errors
@@ -179,26 +177,18 @@ public final class LocatorListener implements ILocator.LocatorListener {
}
} else {
// Peer node found, update the peer instance
- boolean isStatic = peerNode.isStatic();
- if (isStatic) {
// 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(ILocatorModelUpdateService.class).mergeUserDefinedAttributes(peerNode, myPeer, true);
+ model.getService(IPeerModelUpdateService.class).mergeUserDefinedAttributes(peerNode, myPeer, true);
if (changed) peerNode.setChangeEventsEnabled(true);
- peerNode.fireChangeEvent(IPeerModelProperties.PROP_INSTANCE, myPeer, peerNode.getPeer());
+ peerNode.fireChangeEvent(IPeerNodeProperties.PROP_INSTANCE, myPeer, peerNode.getPeer());
// And schedule for immediate status update
Runnable runnable = new ScannerRunnable(model.getScanner(), peerNode);
Protocol.invokeLater(runnable);
}
- } else {
- peerNode.setProperty(IPeerModelProperties.PROP_INSTANCE, peer);
- // And schedule for immediate status update
- Runnable runnable = new ScannerRunnable(model.getScanner(), peerNode);
- Protocol.invokeLater(runnable);
- }
}
}
}
@@ -229,12 +219,12 @@ public final class LocatorListener implements ILocator.LocatorListener {
if (model != null && peer != null) {
// find the corresponding model node to remove
- IPeerModel peerNode = model.getService(ILocatorModelLookupService.class).lkupPeerModelById(peer.getID());
+ IPeerNode peerNode = model.getService(IPeerModelLookupService.class).lkupPeerModelById(peer.getID());
if (peerNode == null) {
// Double check with "ClientID" if set
String clientID = peer.getAttributes().get("ClientID"); //$NON-NLS-1$
if (clientID != null) {
- peerNode = model.getService(ILocatorModelLookupService.class).lkupPeerModelById(clientID);
+ peerNode = model.getService(IPeerModelLookupService.class).lkupPeerModelById(clientID);
}
}
// Update the peer instance
@@ -245,7 +235,7 @@ public final class LocatorListener implements ILocator.LocatorListener {
if (oldPeer != peer) {
// Peers visible to the locator are replaced with the new instance
if (oldPeer instanceof AbstractPeer) {
- peerNode.setProperty(IPeerModelProperties.PROP_INSTANCE, peer);
+ peerNode.setProperty(IPeerNodeProperties.PROP_INSTANCE, peer);
}
// Non-visible peers are updated
else {
@@ -254,15 +244,15 @@ public final class LocatorListener implements ILocator.LocatorListener {
if (myPeer != null) {
boolean changed = peerNode.setChangeEventsEnabled(false);
// Merge user configured properties between the peers
- model.getService(ILocatorModelUpdateService.class).mergeUserDefinedAttributes(peerNode, myPeer, true);
+ model.getService(IPeerModelUpdateService.class).mergeUserDefinedAttributes(peerNode, myPeer, true);
if (changed) peerNode.setChangeEventsEnabled(true);
- peerNode.fireChangeEvent(IPeerModelProperties.PROP_INSTANCE, myPeer, peerNode.getPeer());
+ peerNode.fireChangeEvent(IPeerNodeProperties.PROP_INSTANCE, myPeer, peerNode.getPeer());
}
}
}
}
// Refresh static peers and merge attributes if required
- model.getService(ILocatorModelRefreshService.class).refreshStaticPeers();
+ model.getService(IPeerModelRefreshService.class).refreshStaticPeers();
}
// Clean up the guardians
@@ -282,7 +272,7 @@ public final class LocatorListener implements ILocator.LocatorListener {
if (model != null && id != null) {
// find the corresponding model node to remove
- IPeerModel peerNode = model.getService(ILocatorModelLookupService.class).lkupPeerModelById(id);
+ IPeerNode peerNode = model.getService(IPeerModelLookupService.class).lkupPeerModelById(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.
@@ -309,12 +299,11 @@ public final class LocatorListener implements ILocator.LocatorListener {
newId.append(id.substring(endIndex + 1));
// Try the lookup again
- peerNode = model.getService(ILocatorModelLookupService.class).lkupPeerModelById(newId.toString());
+ peerNode = model.getService(IPeerModelLookupService.class).lkupPeerModelById(newId.toString());
}
// If the model node is found in the model, process the removal.
if (peerNode != null) {
- if (peerNode.isStatic()) {
boolean changed = peerNode.setChangeEventsEnabled(false);
IPeer peer = peerNode.getPeer();
@@ -349,8 +338,8 @@ public final class LocatorListener implements ILocator.LocatorListener {
}
// Remove the attributes stored at peer node level
- peerNode.setProperty(IPeerModelProperties.PROP_LOCAL_SERVICES, null);
- peerNode.setProperty(IPeerModelProperties.PROP_REMOTE_SERVICES, null);
+ 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) {
@@ -363,11 +352,11 @@ public final class LocatorListener implements ILocator.LocatorListener {
peerNode.getModel().setChildren(peerNode.getPeerId(), null);
if (changed) peerNode.setChangeEventsEnabled(true);
- peerNode.fireChangeEvent(IPeerModelProperties.PROP_INSTANCE, peer, peerNode.getPeer());
+ peerNode.fireChangeEvent(IPeerNodeProperties.PROP_INSTANCE, peer, peerNode.getPeer());
final IModelListener[] listeners = model.getListener();
if (listeners.length > 0) {
- final IPeerModel finPeerNode = peerNode;
+ final IPeerNode finPeerNode = peerNode;
Protocol.invokeLater(new Runnable() {
@Override
public void run() {
@@ -377,10 +366,6 @@ public final class LocatorListener implements ILocator.LocatorListener {
}
});
}
- } else {
- // Dynamic peer -> Remove peer model node from the model
- model.getService(ILocatorModelUpdateService.class).remove(peerNode);
- }
}
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/ModelAdapter.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/ModelAdapter.java
index 2da4ca45c..ecadefe17 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/ModelAdapter.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/ModelAdapter.java
@@ -10,8 +10,8 @@
package org.eclipse.tcf.te.tcf.locator.listener;
import org.eclipse.tcf.te.tcf.locator.interfaces.IModelListener;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
/**
* Default model listener implementation.
@@ -19,17 +19,17 @@ import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
public class ModelAdapter implements IModelListener {
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.IModelListener#locatorModelChanged(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel, org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel, boolean)
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.IModelListener#locatorModelChanged(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel, org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode, boolean)
*/
@Override
- public void locatorModelChanged(ILocatorModel model, IPeerModel peerModel, boolean added) {
+ public void locatorModelChanged(IPeerModel model, IPeerNode peerNode, boolean added) {
}
/* (non-Javadoc)
* @see org.eclipse.tcf.te.tcf.locator.core.interfaces.IModelListener#locatorModelDisposed(org.eclipse.tcf.te.tcf.locator.core.interfaces.nodes.ILocatorModel)
*/
@Override
- public void locatorModelDisposed(ILocatorModel model) {
+ public void locatorModelDisposed(IPeerModel model) {
}
}
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 cab63d2f2..2af3c5844 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,9 +11,9 @@ 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.services.ILocatorModelRefreshService;
-import org.eclipse.tcf.te.tcf.locator.nodes.LocatorModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelRefreshService;
+import org.eclipse.tcf.te.tcf.locator.nodes.PeerModel;
/**
@@ -21,7 +21,7 @@ import org.eclipse.tcf.te.tcf.locator.nodes.LocatorModel;
*/
public final class Model {
// Reference to the locator model
- /* default */ static volatile ILocatorModel locatorModel;
+ /* default */ static volatile IPeerModel peerModel;
/**
* Returns the shared locator model instance.
@@ -31,7 +31,7 @@ public final class Model {
*
* @return The shared locator model.
*/
- public static ILocatorModel getModel() {
+ public static IPeerModel getModel() {
return getModel(false);
}
@@ -48,9 +48,9 @@ public final class Model {
*
* @return The shared locator model.
*/
- public static ILocatorModel getModel(boolean shutdown) {
+ public static IPeerModel getModel(boolean shutdown) {
// Access to the locator model must happen in the TCF dispatch thread
- if (locatorModel == null && !shutdown) {
+ if (peerModel == null && !shutdown) {
if (Protocol.isDispatchThread()) {
initialize();
} else {
@@ -62,7 +62,7 @@ public final class Model {
});
}
}
- return locatorModel;
+ return peerModel;
}
/**
@@ -73,35 +73,35 @@ public final class Model {
// If locator model is set in the mean while, initialize got
// called twice. Return immediately in this case.
- if (locatorModel != null) return;
+ if (peerModel != null) return;
// Create the model instance
- locatorModel = new LocatorModel();
+ peerModel = new PeerModel();
// Refresh the model right away
- locatorModel.getService(ILocatorModelRefreshService.class).refresh(null);
+ peerModel.getService(IPeerModelRefreshService.class).refresh(null);
// Start the scanner
- locatorModel.startScanner(5000, 120000);
+ peerModel.startScanner(5000, 120000);
}
/**
* Dispose the root node.
*/
public static void dispose() {
- if (locatorModel == null) return;
+ if (peerModel == null) return;
// Access to the locator model must happen in the TCF dispatch thread
if (Protocol.isDispatchThread()) {
- locatorModel.dispose();
+ peerModel.dispose();
} else {
Protocol.invokeAndWait(new Runnable() {
@Override
public void run() {
- locatorModel.dispose();
+ peerModel.dispose();
}
});
}
- locatorModel = null;
+ peerModel = null;
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/ConnectablePeerModel.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/ConnectablePeerModel.java
deleted file mode 100644
index 95b1e989d..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/ConnectablePeerModel.java
+++ /dev/null
@@ -1,179 +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.nodes;
-
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.tcf.protocol.IPeer;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.core.interfaces.IConnectable;
-import org.eclipse.tcf.te.core.utils.ConnectStateHelper;
-import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperOperationService;
-import org.eclipse.tcf.te.runtime.stepper.utils.StepperHelper;
-import org.eclipse.tcf.te.runtime.utils.StatusHelper;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProperties;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.IStepperServiceOperations;
-
-/**
- * ConnectablePeerModel
- */
-public class ConnectablePeerModel extends PeerModel implements IConnectable {
-
- public static final String PROPERTY_CONNECT_STATE = "connectState"; //$NON-NLS-1$
-
- /**
- * Constructor.
- * @param model
- * @param peer
- */
- public ConnectablePeerModel(ILocatorModel model, IPeer peer) {
- super(model, peer);
- setConnectState(STATE_DISCONNECTED);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.core.interfaces.IConnectable#getConnectState()
- */
- @Override
- public int getConnectState() {
- final AtomicInteger state = new AtomicInteger(STATE_UNKNOWN);
- Protocol.invokeAndWait(new Runnable() {
- @Override
- public void run() {
- if (getProperty(PROPERTY_CONNECT_STATE) != null) {
- state.set(getIntProperty(PROPERTY_CONNECT_STATE));
- }
- }
- });
- return state.get();
- }
-
- @Override
- public boolean setConnectState(final int newState) {
- final AtomicBoolean result = new AtomicBoolean(false);
- if (isConnectStateChangeAllowed(newState)) {
- Protocol.invokeAndWait(new Runnable() {
- @Override
- public void run() {
- result.set(setProperty(PROPERTY_CONNECT_STATE, newState));
- }
- });
- }
- return result.get();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.nodes.PeerModel#postSetProperty(java.lang.String, java.lang.Object, java.lang.Object)
- */
- @Override
- public void postSetProperty(String key, Object value, Object oldValue) {
- if (getConnectState() == STATE_CONNECTED && IPeerModelProperties.PROP_STATE.equals(key)) {
- int state = value instanceof Integer ? ((Integer)value).intValue() : IPeerModelProperties.STATE_UNKNOWN;
- if (state != IPeerModelProperties.STATE_CONNECTED && state != IPeerModelProperties.STATE_REACHABLE) {
- changeConnectState(STATE_DISCONNECTED, null, null);
- }
- }
-
- super.postSetProperty(key, value, oldValue);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.core.interfaces.IConnectable#changeConnectState(int, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
- */
- @Override
- public void changeConnectState(final int action, ICallback callback, IProgressMonitor monitor) throws IllegalArgumentException {
- final int oldState = getConnectState();
- if (!isConnectStateChangeActionAllowed(action)) {
- IllegalArgumentException e = new IllegalArgumentException("Cannot change state from '" + ConnectStateHelper.getConnectState(oldState) + "' using action '" + ConnectStateHelper.getConnectState(action) + "'."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- if (callback != null) {
- callback.done(this, StatusHelper.getStatus(e));
- }
- else {
- throw e;
- }
- }
-
- String operation = null;
- int intermediateState = 0;
-
- switch (action) {
- case ACTION_CONNECT:
- operation = IStepperServiceOperations.CONNECT;
- intermediateState = STATE_CONNECT_SCHEDULED;
- break;
- case ACTION_DISCONNECT:
- operation = IStepperServiceOperations.DISCONNECT;
- intermediateState = STATE_DISCONNECT_SCHEDULED;
- break;
- }
-
- IStepperOperationService service = StepperHelper.getService(this, operation);
- if (service != null) {
- setConnectState(intermediateState);
- StepperHelper.scheduleStepperJob(this, operation, service, callback, monitor);
- }
- else if (callback != null) {
- callback.done(this, StatusHelper.getStatus(new NullPointerException("Missing stepper operation service for " + getName() + "."))); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- @Override
- public boolean isConnectStateChangeActionAllowed(int action) {
- int state = getConnectState();
- switch (state) {
- case STATE_CONNECTED:
- case STATE_CONNECT_SCHEDULED:
- case STATE_CONNECTING:
- return isAllowedState(action, ACTION_DISCONNECT);
- case STATE_DISCONNECTED:
- return isAllowedState(action, ACTION_CONNECT);
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.core.interfaces.IConnectable#isConnectStateChangeAllowed(int)
- */
- @Override
- public boolean isConnectStateChangeAllowed(int newState) {
- int state = getConnectState();
- switch (state) {
- case STATE_CONNECTED:
- return isAllowedState(newState, STATE_DISCONNECTED, STATE_DISCONNECT_SCHEDULED, STATE_DISCONNECTING);
- case STATE_CONNECT_SCHEDULED:
- return isAllowedState(newState, STATE_CONNECTING, STATE_CONNECTED, STATE_DISCONNECTED, STATE_DISCONNECT_SCHEDULED, STATE_DISCONNECTING);
- case STATE_CONNECTING:
- return isAllowedState(newState, STATE_CONNECTED, STATE_DISCONNECT_SCHEDULED, STATE_DISCONNECTING, STATE_DISCONNECTED);
- case STATE_DISCONNECTED:
- return isAllowedState(newState, STATE_CONNECTED, STATE_CONNECT_SCHEDULED, STATE_CONNECTING);
- case STATE_DISCONNECT_SCHEDULED:
- return isAllowedState(newState, STATE_DISCONNECTING, STATE_DISCONNECTED);
- case STATE_DISCONNECTING:
- return isAllowedState(newState, STATE_DISCONNECTED);
- case STATE_UNKNOWN:
- return isAllowedState(newState, STATE_DISCONNECTED);
- }
- return false;
- }
-
- private boolean isAllowedState(int state, int... allowedStates) {
- for (int allowedState : allowedStates) {
- if (state == allowedState) {
- return true;
- }
- }
- return false;
- }
-}
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
deleted file mode 100644
index 45a47c802..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/LocatorModel.java
+++ /dev/null
@@ -1,785 +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.nodes;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-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.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.ILocatorModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelPeerNodeQueryService;
-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.ChannelStateChangeListener;
-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.LocatorModelPeerNodeQueryService;
-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, IPeerModel> peers = new HashMap<String, IPeerModel>();
- // The list of "proxied" peers per proxy peer id
- /* default */ final Map<String, List<IPeerModel>> peerChildren = new HashMap<String, List<IPeerModel>>();
-
- // 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;
-
- // The list of registered model listeners
- private final List<IModelListener> modelListener = new ArrayList<IModelListener>();
-
- // 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);
- // Reference to the query service
- private final ILocatorModelPeerNodeQueryService queryService = new LocatorModelPeerNodeQueryService(this);
-
- /**
- * Constructor.
- */
- public LocatorModel() {
- super();
- disposed = false;
-
- channelStateChangeListener = new ChannelStateChangeListener(this);
- Tcf.addChannelStateChangeListener(channelStateChangeListener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.core.interfaces.nodes.ILocatorModel#addListener(org.eclipse.tcf.te.tcf.locator.core.interfaces.IModelListener)
- */
- @Override
- public void addListener(IModelListener listener) {
- 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("LocatorModel.addListener( " + listener + " )", ITracing.ID_TRACE_LOCATOR_MODEL, this); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- if (!modelListener.contains(listener)) modelListener.add(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.core.interfaces.nodes.ILocatorModel#removeListener(org.eclipse.tcf.te.tcf.locator.core.interfaces.IModelListener)
- */
- @Override
- public void removeListener(IModelListener listener) {
- 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("LocatorModel.removeListener( " + listener + " )", ITracing.ID_TRACE_LOCATOR_MODEL, this); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- modelListener.remove(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel#getListener()
- */
- @Override
- public IModelListener[] getListener() {
- Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- return modelListener.toArray(new IModelListener[modelListener.size()]);
- }
-
- /* (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("LocatorModel.dispose()", ITracing.ID_TRACE_LOCATOR_MODEL, this); //$NON-NLS-1$
- }
-
- // If already disposed, we are done immediately
- if (disposed) return;
-
- disposed = true;
-
- final IModelListener[] listeners = getListener();
- if (listeners.length > 0) {
- Protocol.invokeLater(new Runnable() {
- @Override
- public void run() {
- for (IModelListener listener : listeners) {
- listener.locatorModelDisposed(LocatorModel.this);
- }
- }
- });
- }
- 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();
- }
-
- /* (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.core.interfaces.nodes.ILocatorModel#getPeers()
- */
- @Override
- public IPeerModel[] getPeers() {
- final AtomicReference<IPeerModel[]> result = new AtomicReference<IPeerModel[]>();
-
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- result.set(peers.values().toArray(new IPeerModel[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<IPeerModel> getChildren(final String parentPeerID) {
- Assert.isNotNull(parentPeerID);
-
- final AtomicReference<List<IPeerModel>> result = new AtomicReference<List<IPeerModel>>();
-
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- List<IPeerModel> 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<IPeerModel> 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<IPeerModel>(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(ILocatorModelRefreshService.class)) {
- return refreshService;
- }
- if (adapter.isAssignableFrom(ILocatorModelLookupService.class)) {
- return lookupService;
- }
- if (adapter.isAssignableFrom(ILocatorModelUpdateService.class)) {
- return updateService;
- }
- if (adapter.isAssignableFrom(ILocatorModelPeerNodeQueryService.class)) {
- return queryService;
- }
- 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.core.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);
- }
-
- /* (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("LocatorModel.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("LocatorModel.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.ILocatorModel#validatePeer(org.eclipse.tcf.protocol.IPeer)
- */
- @Override
- public IPeer validatePeer(IPeer peer) {
- 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("LocatorModel.validatePeer( " + peer.getID() + " )", ITracing.ID_TRACE_LOCATOR_MODEL, this); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- IPeer result = peer;
-
- // 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)) {
- // Not loopback address -> drop the peer
- result = null;
-
- if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITracing.ID_TRACE_LOCATOR_MODEL)) {
- CoreBundleActivator.getTraceHandler().trace("LocatorModel.validatePeer: local host peer but not loopback address -> peer node dropped" //$NON-NLS-1$
- , ITracing.ID_TRACE_LOCATOR_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 IPeerModel validatePeerNodeForAdd(IPeerModel 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
- boolean isStatic = node.isStatic();
- if (isStatic) 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("LocatorModel.validatePeerNodeForAdd( " + peer.getID() + " )", ITracing.ID_TRACE_LOCATOR_MODEL, this); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- IPeerModel 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("LocatorModel.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<IPeerModel> previousNodes = new ArrayList<IPeerModel>();
-
- // 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(ILocatorModelLookupService.class).lkupPeerModelByAgentId(agentId)));
- }
-
- // Lookup for matching static peer nodes not found by the agent id lookup
- IPeerModel[] candidates = getService(ILocatorModelLookupService.class).lkupMatchingStaticPeerModels(peer);
- for (IPeerModel candidate : candidates) {
- if (!previousNodes.contains(candidate)) previousNodes.add(candidate);
- }
-
- if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITracing.ID_TRACE_LOCATOR_MODEL)) {
- CoreBundleActivator.getTraceHandler().trace("LocatorModel.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 (IPeerModel 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(ILocatorModelUpdateService.class).remove(previousNode);
-
- if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITracing.ID_TRACE_LOCATOR_MODEL)) {
- CoreBundleActivator.getTraceHandler().trace("LocatorModel.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("LocatorModel.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("LocatorModel.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("LocatorModel.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.ILocatorModel#validateChildPeerNodeForAdd(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel)
- */
- @Override
- public IPeerModel validateChildPeerNodeForAdd(final IPeerModel 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("LocatorModel.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 IPeerModel parent = node.getParent(IPeerModel.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 IPeerModel validateChildPeerNodeForAdd(IPeerModel parent, IPeerModel 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("LocatorModel.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(IPeerModel.class) != null) {
- IPeerModel parentParentNode = parent.getParent(IPeerModel.class);
- if (doValidateChildPeerNodeForAdd(parentParentNode, node) == null) {
- return null;
- }
-
- // And validate the child node against all child nodes of the parent parent.
- List<IPeerModel> childrenList = getChildren(parentParentNode.getPeerId());
- IPeerModel[] children = childrenList.toArray(new IPeerModel[childrenList.size()]);
- for (IPeerModel 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 IPeerModel doValidateChildPeerNodeForAdd(IPeerModel parent, IPeerModel 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("LocatorModel.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) {
- IPeerModel[] matches = getService(ILocatorModelLookupService.class).lkupPeerModelByAgentId(parent.getPeerId(), agentID);
- for (IPeerModel 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(ILocatorModelUpdateService.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(ILocatorModelLookupService.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/nodes/PeerModel.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/PeerModel.java
index aae484eec..19d9e40af 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
@@ -9,344 +9,775 @@
*******************************************************************************/
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.concurrent.atomic.AtomicBoolean;
+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.core.runtime.jobs.Job;
import org.eclipse.tcf.protocol.IPeer;
import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.runtime.model.ContainerModelNode;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel;
+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.IPeerModelProperties;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelLookupService;
+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;
+import org.eclipse.tcf.te.tcf.locator.services.PeerModelUpdateService;
/**
- * Default peer model implementation.
+ * Default locator model implementation.
*/
-public class PeerModel extends ContainerModelNode implements IPeerModel {
- // Reference to the parent locator model
- private final ILocatorModel model;
- // Reference to the peer id (cached for performance optimization)
- private String peerId;
+public class PeerModel extends PlatformObject implements IPeerModel {
+ // 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, 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;
+
+ // The list of registered model listeners
+ private final List<IModelListener> modelListener = new ArrayList<IModelListener>();
+
+ // Reference to the refresh service
+ private final IPeerModelRefreshService refreshService = new PeerModelRefreshService(this);
+ // Reference to the lookup service
+ private final IPeerModelLookupService lookupService = new PeerModelLookupService(this);
+ // Reference to the update service
+ private final IPeerModelUpdateService updateService = new PeerModelUpdateService(this);
+ // Reference to the query service
+ private final IPeerModelQueryService queryService = new PeerModelQueryService(this);
/**
* Constructor.
- *
- * @param model The parent locator model. Must not be <code>null</code>.
- * @param peer The peer. Must not be <code>null</code>.
*/
- public PeerModel(ILocatorModel model, IPeer peer) {
+ public PeerModel() {
super();
+ disposed = false;
- Assert.isNotNull(model);
- this.model = model;
-
- Assert.isNotNull(peer);
-
- // Set the default properties before enabling the change events.
- // The properties changed listeners should not be called from the
- // constructor.
- setProperty(IPeerModelProperties.PROP_INSTANCE, peer);
-
- // Initialize the peer id
- peerId = peer.getID();
- Assert.isNotNull(peerId);
-
- // Peer model nodes can change the node parent at any time
- allowSetParentOnNonNullParent = true;
- // Peer model nodes does not have a parent by default
- // -> allow change events with null parent
- suppressEventsOnNullParent = false;
-
- // Enable change events
- setChangeEventsEnabled(true);
+ channelStateChangeListener = new ChannelStateChangeListener(this);
+ Tcf.addChannelStateChangeListener(channelStateChangeListener);
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.properties.PropertiesContainer#checkThreadAccess()
+ * @see org.eclipse.tcf.te.tcf.locator.core.interfaces.nodes.ILocatorModel#addListener(org.eclipse.tcf.te.tcf.locator.core.interfaces.IModelListener)
*/
@Override
- protected final boolean checkThreadAccess() {
- return Protocol.isDispatchThread();
- }
+ public void addListener(IModelListener listener) {
+ Assert.isNotNull(listener);
+ Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel#getModel()
- */
- @Override
- public ILocatorModel getModel() {
- return (ILocatorModel)getAdapter(ILocatorModel.class);
- }
+ 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$
+ }
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel#getPeer()
- */
- @Override
- public IPeer getPeer() {
- return (IPeer)getAdapter(IPeer.class);
+ if (!modelListener.contains(listener)) modelListener.add(listener);
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel#getPeerId()
+ * @see org.eclipse.tcf.te.tcf.locator.core.interfaces.nodes.ILocatorModel#removeListener(org.eclipse.tcf.te.tcf.locator.core.interfaces.IModelListener)
*/
@Override
- public String getPeerId() {
- return peerId;
+ public void removeListener(IModelListener listener) {
+ 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$
+ }
+
+ modelListener.remove(listener);
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.model.ModelNode#getName()
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel#getListener()
*/
@Override
- public String getName() {
- return getPeer().getName();
+ public IModelListener[] getListener() {
+ Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
+ return modelListener.toArray(new IModelListener[modelListener.size()]);
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel#getRemotePeerId()
+ * @see org.eclipse.tcf.te.tcf.locator.core.interfaces.nodes.ILocatorModel#dispose()
*/
@Override
- public String getRemotePeerId() {
- // If the peer is a remote peer by itself, than we return getPeerId()
- if ("RemotePeer".equals(getPeer().getClass().getSimpleName())) { //$NON-NLS-1$
- return getPeerId();
+ 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$
}
- // Try to determine the remote peer ID
- final AtomicReference<String> remotePeerId = new AtomicReference<String>();
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- remotePeerId.set(getPeer().getAttributes().get("remote.id.transient")); //$NON-NLS-1$
- }
- };
+ // If already disposed, we are done immediately
+ if (disposed) return;
+
+ disposed = true;
+
+ final IModelListener[] listeners = getListener();
+ if (listeners.length > 0) {
+ Protocol.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+ for (IModelListener listener : listeners) {
+ listener.locatorModelDisposed(PeerModel.this);
+ }
+ }
+ });
+ }
+ modelListener.clear();
- if (Protocol.isDispatchThread()) {
- runnable.run();
+ if (locatorListener != null) {
+ Protocol.getLocator().removeListener(locatorListener);
+ locatorListener = null;
}
- else {
- Protocol.invokeAndWait(runnable);
+
+ if (channelStateChangeListener != null) {
+ Tcf.removeChannelStateChangeListener(channelStateChangeListener);
+ channelStateChangeListener = null;
+ }
+
+ if (scanner != null) {
+ stopScanner();
+ scanner = null;
}
- return remotePeerId.get();
+ peers.clear();
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel#isComplete()
+ * @see org.eclipse.tcf.te.tcf.locator.core.interfaces.nodes.ILocatorModel#isDisposed()
*/
@Override
- public boolean isComplete() {
- Assert.isTrue(checkThreadAccess(), "Illegal Thread Access"); //$NON-NLS-1$
-
- boolean complete = true;
-
- // Determine the transport method
- String transport = getPeer().getTransportName();
- // If the transport is not set, the peer attributes are incomplete
- if (transport == null) {
- complete = false;
- } else {
- // For TCP or SSL transport, ATTR_IP_HOST must not be null.
- String ip = getPeer().getAttributes().get(IPeer.ATTR_IP_HOST);
- String port = getPeer().getAttributes().get(IPeer.ATTR_IP_PORT);
- if (("TCP".equals(transport) || "SSL".equals(transport)) && (ip == null || port == null)) { //$NON-NLS-1$ //$NON-NLS-2$
- complete = false;
- }
-
- // Pipe and Loop transport does not require additional attributes
- }
-
- return complete;
+ public boolean isDisposed() {
+ return disposed;
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel#isStatic()
+ * @see org.eclipse.tcf.te.tcf.locator.core.interfaces.nodes.ILocatorModel#getPeers()
*/
@Override
- public boolean isStatic() {
- final AtomicBoolean isStatic = new AtomicBoolean();
+ public IPeerNode[] getPeers() {
+ final AtomicReference<IPeerNode[]> result = new AtomicReference<IPeerNode[]>();
Runnable runnable = new Runnable() {
@Override
public void run() {
- String value = getPeer().getAttributes().get("static.transient"); //$NON-NLS-1$
- isStatic.set(value != null && Boolean.parseBoolean(value.trim()));
+ result.set(peers.values().toArray(new IPeerNode[peers.values().size()]));
}
};
if (Protocol.isDispatchThread()) runnable.run();
else Protocol.invokeAndWait(runnable);
- return isStatic.get();
+ return result.get();
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel#isRemote()
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel#getChildren(java.lang.String)
*/
@Override
- public boolean isRemote() {
- final AtomicBoolean isRemote = new AtomicBoolean();
+ 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() {
- // Determine the "remote" flag
- String value = getPeer().getAttributes().get("remote.transient"); //$NON-NLS-1$
- boolean bValue = value != null && Boolean.parseBoolean(value.trim());
-
- // The peer model node is considered to be remote if it is a remote peer
- // or the "remote" flag is set.
- isRemote.set("RemotePeer".equals(getPeer().getClass().getSimpleName()) || bValue); //$NON-NLS-1$
+ 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 isRemote.get();
+ return Collections.unmodifiableList(result.get());
}
/* (non-Javadoc)
- * @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel#setChildren(java.lang.String, java.util.List)
*/
@Override
- public Object getAdapter(final Class adapter) {
- // NOTE: The getAdapter(...) method can be invoked from many place and
- // many threads where we cannot control the calls. Therefore, this
- // method is allowed be called from any thread.
- final AtomicReference<Object> object = new AtomicReference<Object>();
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- object.set(doGetAdapter(adapter));
- }
- };
+ public void setChildren(String parentPeerID, List<IPeerNode> children) {
+ Assert.isNotNull(parentPeerID);
+ Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- if (Protocol.isDispatchThread()) {
- runnable.run();
+ 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;
}
- else {
- Protocol.invokeAndWait(runnable);
+ if (adapter.isAssignableFrom(IPeerModelLookupService.class)) {
+ return lookupService;
+ }
+ if (adapter.isAssignableFrom(IPeerModelUpdateService.class)) {
+ return updateService;
+ }
+ if (adapter.isAssignableFrom(IPeerModelQueryService.class)) {
+ return queryService;
+ }
+ if (adapter.isAssignableFrom(Map.class)) {
+ return peers;
}
- return object.get() != null ? object.get() : super.getAdapter(adapter);
+ 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 PeerModel) {
+ return uniqueId.equals(((PeerModel)obj).uniqueId);
+ }
+ return super.equals(obj);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.tcf.locator.core.interfaces.nodes.ILocatorModel#getService(java.lang.Class)
+ */
+ @Override
+ @SuppressWarnings("unchecked")
+ public <V extends IPeerModelService> V getService(Class<V> serviceInterface) {
+ Assert.isNotNull(serviceInterface);
+ return (V)getAdapter(serviceInterface);
}
/**
- * Returns an object which is an instance of the given class associated with this object.
- * Returns <code>null</code> if no such object can be found.
+ * Check if the locator listener has been created and registered
+ * to the global locator service.
* <p>
- * This method must be called within the TCF dispatch thread!
- *
- * @param adapter The adapter class to look up.
- * @return The adapter or <code>null</code>.
+ * <b>Note:</b> This method is not intended to be call from clients.
*/
- protected Object doGetAdapter(Class<?> adapter) {
- Assert.isTrue(checkThreadAccess(), "Illegal Thread Access"); //$NON-NLS-1$
+ public void checkLocatorListener() {
+ Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
+ Assert.isNotNull(Protocol.getLocator());
- if (ILocatorModel.class.isAssignableFrom(adapter)) {
- return model;
+ if (locatorListener == null) {
+ locatorListener = doCreateLocatorListener(this);
+ Protocol.getLocator().addListener(locatorListener);
}
+ }
- Object peer = getProperty(IPeerModelProperties.PROP_INSTANCE);
- // Check with adapter.isAssignableFrom(...) to return the peer instance
- // correctly if adapter is IPeer.class.
- if (peer != null && adapter.isAssignableFrom(peer.getClass())) {
- return peer;
- }
+ /**
+ * 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 null;
+ return new LocatorListener(model);
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.properties.PropertiesContainer#toString()
+ * @see org.eclipse.tcf.te.tcf.locator.core.interfaces.nodes.ILocatorModel#getScanner()
*/
@Override
- public String toString() {
- final StringBuilder buffer = new StringBuilder(getClass().getSimpleName());
+ public IScanner getScanner() {
+ if (scanner == null) scanner = new Scanner(this);
+ return scanner;
+ }
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- IPeer peer = getPeer();
- buffer.append(": id=" + peer.getID()); //$NON-NLS-1$
- buffer.append(", name=" + peer.getName()); //$NON-NLS-1$
- }
- };
+ /* (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$
+ }
- if (Protocol.isDispatchThread()) {
- runnable.run();
+ 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);
}
- else {
- Protocol.invokeAndWait(runnable);
+ }
+
+ /* (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$
}
- buffer.append(", " + super.toString()); //$NON-NLS-1$
- return buffer.toString();
+ if (scanner != null) {
+ // Terminate the scanner
+ scanner.terminate();
+ // Reset the scanner reference
+ scanner = null;
+ }
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.properties.PropertiesContainer#equals(java.lang.Object)
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel#validatePeer(org.eclipse.tcf.protocol.IPeer)
*/
@Override
- public boolean equals(Object obj) {
- if (obj instanceof PeerModel) {
- return getPeerId().equals(((PeerModel)obj).getPeerId());
+ public IPeer validatePeer(IPeer peer) {
+ 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$
}
- return super.equals(obj);
+
+ IPeer result = peer;
+
+ // 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)) {
+ // Not loopback address -> drop the peer
+ result = null;
+
+ if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITracing.ID_TRACE_LOCATOR_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);
+ }
+ }
+
+ return result;
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.properties.PropertiesContainer#hashCode()
+ * @see org.eclipse.tcf.te.tcf.locator.core.interfaces.nodes.ILocatorModel#validatePeerNodeForAdd(org.eclipse.tcf.te.tcf.locator.core.interfaces.nodes.IPeerModel)
*/
@Override
- public int hashCode() {
- return getPeerId().hashCode();
+ 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.runtime.properties.PropertiesContainer#postSetProperties(java.util.Map)
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel#validateChildPeerNodeForAdd(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode)
*/
@Override
- protected void postSetProperties(Map<String, ?> properties) {
- Assert.isTrue(checkThreadAccess(), "Illegal Thread Access"); //$NON-NLS-1$
- Assert.isNotNull(properties);
- Assert.isNotNull(getPeer());
+ 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$
+ }
- // New properties applied. Update the element id
- peerId = getPeer().getID();
- Assert.isNotNull(peerId);
+ // 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;
- super.postSetProperties(properties);
+ return validateChildPeerNodeForAdd(parent, node);
}
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.properties.PropertiesContainer#postSetProperty(java.lang.String, java.lang.Object, java.lang.Object)
+ /**
+ * 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>.
*/
- @Override
- public void postSetProperty(String key, Object value, Object oldValue) {
- Assert.isTrue(checkThreadAccess(), "Illegal Thread Access"); //$NON-NLS-1$
- Assert.isNotNull(key);
- Assert.isNotNull(getPeer());
+ 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 peer instance changed, update the element id
- if (IPeerModelProperties.PROP_INSTANCE.equals(key)) {
- peerId = getPeer().getID();
- Assert.isNotNull(peerId);
+ // 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;
+ }
+ }
}
- super.postSetProperty(key, value, oldValue);
+ return node;
}
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.model.ModelNode#isVisible()
+ /**
+ * 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>.
*/
- @Override
- public boolean isVisible() {
- IPeer peer = getPeer();
- return peer != null && peer.getAttributes().containsKey(IPeerModelProperties.PROP_VISIBLE)
- ? Boolean.valueOf(peer.getAttributes().get(IPeerModelProperties.PROP_VISIBLE)).booleanValue() : true;
+ 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/nodes/PeerNode.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/PeerNode.java
new file mode 100644
index 000000000..8888fa798
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/PeerNode.java
@@ -0,0 +1,405 @@
+/*******************************************************************************
+ * 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.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.tcf.protocol.IPeer;
+import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.te.core.interfaces.IConnectable;
+import org.eclipse.tcf.te.core.utils.ConnectStateHelper;
+import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
+import org.eclipse.tcf.te.runtime.model.ContainerModelNode;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperOperationService;
+import org.eclipse.tcf.te.runtime.stepper.utils.StepperHelper;
+import org.eclipse.tcf.te.runtime.utils.StatusHelper;
+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.IStepperServiceOperations;
+
+
+/**
+ * Default peer model implementation.
+ */
+public class PeerNode extends ContainerModelNode implements IPeerNode {
+ // Reference to the parent locator model
+ private final IPeerModel model;
+ // Reference to the peer id (cached for performance optimization)
+ private String peerId;
+
+ /**
+ * Constructor.
+ *
+ * @param model The parent locator model. Must not be <code>null</code>.
+ * @param peer The peer. Must not be <code>null</code>.
+ */
+ public PeerNode(IPeerModel model, IPeer peer) {
+ super();
+
+ Assert.isNotNull(model);
+ this.model = model;
+
+ Assert.isNotNull(peer);
+
+ // Set the default properties before enabling the change events.
+ // The properties changed listeners should not be called from the
+ // constructor.
+ setProperty(IPeerNodeProperties.PROP_INSTANCE, peer);
+ setProperty(IPeerNodeProperties.PROP_CONNECT_STATE, IConnectable.STATE_DISCONNECTED);
+
+ // Initialize the peer id
+ peerId = peer.getID();
+ Assert.isNotNull(peerId);
+
+ // Peer model nodes can change the node parent at any time
+ allowSetParentOnNonNullParent = true;
+ // Peer model nodes does not have a parent by default
+ // -> allow change events with null parent
+ suppressEventsOnNullParent = false;
+
+ // Enable change events
+ setChangeEventsEnabled(true);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.properties.PropertiesContainer#checkThreadAccess()
+ */
+ @Override
+ protected final boolean checkThreadAccess() {
+ return Protocol.isDispatchThread();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode#getModel()
+ */
+ @Override
+ public IPeerModel getModel() {
+ return (IPeerModel)getAdapter(IPeerModel.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode#getPeer()
+ */
+ @Override
+ public IPeer getPeer() {
+ return (IPeer)getAdapter(IPeer.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode#getPeerId()
+ */
+ @Override
+ public String getPeerId() {
+ return peerId;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.model.ModelNode#getName()
+ */
+ @Override
+ public String getName() {
+ return getPeer().getName();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode#isComplete()
+ */
+ @Override
+ public boolean isComplete() {
+ Assert.isTrue(checkThreadAccess(), "Illegal Thread Access"); //$NON-NLS-1$
+
+ boolean complete = true;
+
+ // Determine the transport method
+ String transport = getPeer().getTransportName();
+ // If the transport is not set, the peer attributes are incomplete
+ if (transport == null) {
+ complete = false;
+ } else {
+ // For TCP or SSL transport, ATTR_IP_HOST must not be null.
+ String ip = getPeer().getAttributes().get(IPeer.ATTR_IP_HOST);
+ String port = getPeer().getAttributes().get(IPeer.ATTR_IP_PORT);
+ if (("TCP".equals(transport) || "SSL".equals(transport)) && (ip == null || port == null)) { //$NON-NLS-1$ //$NON-NLS-2$
+ complete = false;
+ }
+
+ // Pipe and Loop transport does not require additional attributes
+ }
+
+ return complete;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
+ */
+ @Override
+ public Object getAdapter(final Class adapter) {
+ // NOTE: The getAdapter(...) method can be invoked from many place and
+ // many threads where we cannot control the calls. Therefore, this
+ // method is allowed be called from any thread.
+ final AtomicReference<Object> object = new AtomicReference<Object>();
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ object.set(doGetAdapter(adapter));
+ }
+ };
+
+ if (Protocol.isDispatchThread()) {
+ runnable.run();
+ }
+ else {
+ Protocol.invokeAndWait(runnable);
+ }
+
+ return object.get() != null ? object.get() : super.getAdapter(adapter);
+ }
+
+ /**
+ * Returns an object which is an instance of the given class associated with this object.
+ * Returns <code>null</code> if no such object can be found.
+ * <p>
+ * This method must be called within the TCF dispatch thread!
+ *
+ * @param adapter The adapter class to look up.
+ * @return The adapter or <code>null</code>.
+ */
+ protected Object doGetAdapter(Class<?> adapter) {
+ Assert.isTrue(checkThreadAccess(), "Illegal Thread Access"); //$NON-NLS-1$
+
+ if (IPeerModel.class.isAssignableFrom(adapter)) {
+ return model;
+ }
+
+ Object peer = getProperty(IPeerNodeProperties.PROP_INSTANCE);
+ // Check with adapter.isAssignableFrom(...) to return the peer instance
+ // correctly if adapter is IPeer.class.
+ if (peer != null && adapter.isAssignableFrom(peer.getClass())) {
+ return peer;
+ }
+
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.properties.PropertiesContainer#toString()
+ */
+ @Override
+ public String toString() {
+ final StringBuilder buffer = new StringBuilder(getClass().getSimpleName());
+
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ IPeer peer = getPeer();
+ buffer.append(": id=" + peer.getID()); //$NON-NLS-1$
+ buffer.append(", name=" + peer.getName()); //$NON-NLS-1$
+ }
+ };
+
+ if (Protocol.isDispatchThread()) {
+ runnable.run();
+ }
+ else {
+ Protocol.invokeAndWait(runnable);
+ }
+
+ buffer.append(", " + super.toString()); //$NON-NLS-1$
+ return buffer.toString();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.properties.PropertiesContainer#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof PeerNode) {
+ return getPeerId().equals(((PeerNode)obj).getPeerId());
+ }
+ return super.equals(obj);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.properties.PropertiesContainer#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ return getPeerId().hashCode();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.properties.PropertiesContainer#postSetProperties(java.util.Map)
+ */
+ @Override
+ protected void postSetProperties(Map<String, ?> properties) {
+ Assert.isTrue(checkThreadAccess(), "Illegal Thread Access"); //$NON-NLS-1$
+ Assert.isNotNull(properties);
+ Assert.isNotNull(getPeer());
+
+ // New properties applied. Update the element id
+ peerId = getPeer().getID();
+ Assert.isNotNull(peerId);
+
+ super.postSetProperties(properties);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.properties.PropertiesContainer#postSetProperty(java.lang.String, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public void postSetProperty(String key, Object value, Object oldValue) {
+ Assert.isTrue(checkThreadAccess(), "Illegal Thread Access"); //$NON-NLS-1$
+ Assert.isNotNull(key);
+ Assert.isNotNull(getPeer());
+
+ // If the peer instance changed, update the element id
+ if (IPeerNodeProperties.PROP_INSTANCE.equals(key)) {
+ peerId = getPeer().getID();
+ Assert.isNotNull(peerId);
+ }
+
+ super.postSetProperty(key, value, oldValue);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.model.ModelNode#isVisible()
+ */
+ @Override
+ public boolean isVisible() {
+ IPeer peer = getPeer();
+ return peer != null && peer.getAttributes().containsKey(IPeerNodeProperties.PROP_VISIBLE)
+ ? Boolean.valueOf(peer.getAttributes().get(IPeerNodeProperties.PROP_VISIBLE)).booleanValue() : true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.core.interfaces.IConnectable#getConnectState()
+ */
+ @Override
+ public int getConnectState() {
+ final AtomicInteger state = new AtomicInteger(STATE_UNKNOWN);
+ Protocol.invokeAndWait(new Runnable() {
+ @Override
+ public void run() {
+ if (getProperty(IPeerNodeProperties.PROP_CONNECT_STATE) != null) {
+ state.set(getIntProperty(IPeerNodeProperties.PROP_CONNECT_STATE));
+ }
+ }
+ });
+ return state.get();
+ }
+
+ @Override
+ public boolean setConnectState(final int newState) {
+ final AtomicBoolean result = new AtomicBoolean(false);
+ if (isConnectStateChangeAllowed(newState)) {
+ Protocol.invokeAndWait(new Runnable() {
+ @Override
+ public void run() {
+ result.set(setProperty(IPeerNodeProperties.PROP_CONNECT_STATE, newState));
+ }
+ });
+ }
+ return result.get();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.core.interfaces.IConnectable#changeConnectState(int, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
+ */
+ @Override
+ public void changeConnectState(final int action, ICallback callback, IProgressMonitor monitor) throws IllegalArgumentException {
+ final int oldState = getConnectState();
+ if (!isConnectStateChangeActionAllowed(action)) {
+ IllegalArgumentException e = new IllegalArgumentException("Cannot change state from '" + ConnectStateHelper.getConnectState(oldState) + "' using action '" + ConnectStateHelper.getConnectState(action) + "'."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ if (callback != null) {
+ callback.done(this, StatusHelper.getStatus(e));
+ }
+ else {
+ throw e;
+ }
+ }
+
+ String operation = null;
+ int intermediateState = 0;
+
+ switch (action) {
+ case ACTION_CONNECT:
+ operation = IStepperServiceOperations.CONNECT;
+ intermediateState = STATE_CONNECT_SCHEDULED;
+ break;
+ case ACTION_DISCONNECT:
+ operation = IStepperServiceOperations.DISCONNECT;
+ intermediateState = STATE_DISCONNECT_SCHEDULED;
+ break;
+ }
+
+ IStepperOperationService service = StepperHelper.getService(this, operation);
+ if (service != null) {
+ setConnectState(intermediateState);
+ StepperHelper.scheduleStepperJob(this, operation, service, callback, monitor);
+ }
+ else if (callback != null) {
+ callback.done(this, StatusHelper.getStatus(new NullPointerException("Missing stepper operation service for " + getName() + "."))); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+
+ @Override
+ public boolean isConnectStateChangeActionAllowed(int action) {
+ int state = getConnectState();
+ switch (state) {
+ case STATE_CONNECTED:
+ case STATE_CONNECT_SCHEDULED:
+ case STATE_CONNECTING:
+ return isAllowedState(action, ACTION_DISCONNECT);
+ case STATE_DISCONNECTED:
+ return isAllowedState(action, ACTION_CONNECT);
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.core.interfaces.IConnectable#isConnectStateChangeAllowed(int)
+ */
+ @Override
+ public boolean isConnectStateChangeAllowed(int newState) {
+ int state = getConnectState();
+ switch (state) {
+ case STATE_CONNECTED:
+ return isAllowedState(newState, STATE_DISCONNECTED, STATE_DISCONNECT_SCHEDULED, STATE_DISCONNECTING);
+ case STATE_CONNECT_SCHEDULED:
+ return isAllowedState(newState, STATE_CONNECTING, STATE_CONNECTED, STATE_DISCONNECTED, STATE_DISCONNECT_SCHEDULED, STATE_DISCONNECTING);
+ case STATE_CONNECTING:
+ return isAllowedState(newState, STATE_CONNECTED, STATE_DISCONNECT_SCHEDULED, STATE_DISCONNECTING, STATE_DISCONNECTED);
+ case STATE_DISCONNECTED:
+ return isAllowedState(newState, STATE_CONNECTED, STATE_CONNECT_SCHEDULED, STATE_CONNECTING);
+ case STATE_DISCONNECT_SCHEDULED:
+ return isAllowedState(newState, STATE_DISCONNECTING, STATE_DISCONNECTED);
+ case STATE_DISCONNECTING:
+ return isAllowedState(newState, STATE_DISCONNECTED);
+ case STATE_UNKNOWN:
+ return isAllowedState(newState, STATE_DISCONNECTED);
+ }
+ return false;
+ }
+
+ private boolean isAllowedState(int state, int... allowedStates) {
+ for (int allowedState : allowedStates) {
+ if (state == allowedState) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
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 ce3aad621..a274f8129 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
@@ -20,11 +20,11 @@ import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
import org.eclipse.tcf.te.runtime.persistence.delegates.GsonMapPersistenceDelegate;
import org.eclipse.tcf.te.tcf.core.peers.Peer;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProvider;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelLookupService;
import org.eclipse.tcf.te.tcf.locator.model.Model;
-import org.eclipse.tcf.te.tcf.locator.nodes.PeerModel;
+import org.eclipse.tcf.te.tcf.locator.nodes.PeerNode;
/**
* Peer to string persistence delegate implementation.
@@ -75,8 +75,8 @@ public class GsonPeerPersistenceDelegate extends GsonMapPersistenceDelegate {
if (context instanceof IPeer || IPeer.class.equals(context)) {
return peer;
}
- else if (context instanceof Class && (((Class<?>)context).isAssignableFrom(IPeerModel.class))) {
- final AtomicReference<IPeerModel> model = new AtomicReference<IPeerModel>();
+ else if (context instanceof Class && (((Class<?>)context).isAssignableFrom(IPeerNode.class))) {
+ final AtomicReference<IPeerNode> model = new AtomicReference<IPeerNode>();
Runnable runnable = new Runnable() {
@Override
@@ -85,14 +85,14 @@ public class GsonPeerPersistenceDelegate extends GsonMapPersistenceDelegate {
String id = peer.getID();
if (id != null) {
// Lookup the id within the model
- IPeerModel peerModel = Model.getModel().getService(ILocatorModelLookupService.class).lkupPeerModelById(id);
- if (peerModel == null) {
+ IPeerNode peerNode = Model.getModel().getService(IPeerModelLookupService.class).lkupPeerModelById(id);
+ if (peerNode == null) {
// Not found in the model -> create a ghost object
- peerModel = new PeerModel(Model.getModel(), peer);
- peerModel.setProperty(IModelNode.PROPERTY_IS_GHOST, true);
+ peerNode = new PeerNode(Model.getModel(), peer);
+ peerNode.setProperty(IModelNode.PROPERTY_IS_GHOST, true);
}
- model.set(peerModel);
+ model.set(peerNode);
}
}
};
@@ -122,11 +122,11 @@ public class GsonPeerPersistenceDelegate extends GsonMapPersistenceDelegate {
if (context instanceof IPeer) {
peer = (IPeer)context;
}
- else if (context instanceof IPeerModel) {
- peer = ((IPeerModel)context).getPeer();
+ else if (context instanceof IPeerNode) {
+ peer = ((IPeerNode)context).getPeer();
}
- else if (context instanceof IPeerModelProvider) {
- peer = ((IPeerModelProvider)context).getPeerModel().getPeer();
+ else if (context instanceof IPeerNodeProvider) {
+ peer = ((IPeerNodeProvider)context).getPeerModel().getPeer();
}
return peer;
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/AbstractPeerModelService.java
index ea6df29b5..5a3e37ea8 100644
--- 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/AbstractPeerModelService.java
@@ -11,32 +11,32 @@ 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;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelService;
/**
- * Abstract locator model service base implementation.
+ * Abstract peer model service base implementation.
*/
-public abstract class AbstractLocatorModelService extends PlatformObject implements ILocatorModelService {
+public abstract class AbstractPeerModelService extends PlatformObject implements IPeerModelService {
// Reference to the parent locator model
- private final ILocatorModel locatorModel;
+ private final IPeerModel peerModel;
/**
* 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 AbstractLocatorModelService(ILocatorModel parentModel) {
+ public AbstractPeerModelService(IPeerModel parentModel) {
Assert.isNotNull(parentModel);
- locatorModel = parentModel;
+ peerModel = parentModel;
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelService#getLocatorModel()
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelService#getPeerModel()
*/
@Override
- public final ILocatorModel getLocatorModel() {
- return locatorModel;
+ public final IPeerModel getPeerModel() {
+ return peerModel;
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/AbstractSimulatorService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/AbstractSimulatorService.java
index acffb7f09..9b7c3259f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/AbstractSimulatorService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/AbstractSimulatorService.java
@@ -15,7 +15,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.te.runtime.services.AbstractService;
import org.eclipse.tcf.te.runtime.services.interfaces.ISimulatorService;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
/**
* Abstract simulator service implementation.
@@ -27,12 +27,12 @@ public abstract class AbstractSimulatorService extends AbstractService implement
*/
@Override
public boolean isValidContext(final Object context, String config) {
- if (context instanceof IPeerModel) {
+ if (context instanceof IPeerNode) {
final AtomicBoolean complete = new AtomicBoolean(false);
Runnable runnable = new Runnable() {
@Override
public void run() {
- complete.set(((IPeerModel)context).isComplete());
+ complete.set(((IPeerNode)context).isComplete());
}
};
Protocol.invokeAndWait(runnable);
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/PeerModelLookupService.java
index d8fb46c8f..b21e4f898 100644
--- 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/PeerModelLookupService.java
@@ -15,23 +15,23 @@ 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.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelPeerNodeQueryService;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelLookupService;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelQueryService;
/**
* Default locator model lookup service implementation.
*/
-public class LocatorModelLookupService extends AbstractLocatorModelService implements ILocatorModelLookupService {
+public class PeerModelLookupService extends AbstractPeerModelService implements IPeerModelLookupService {
/**
* Constructor.
*
* @param parentModel The parent locator model instance. Must not be <code>null</code>.
*/
- public LocatorModelLookupService(ILocatorModel parentModel) {
+ public PeerModelLookupService(IPeerModel parentModel) {
super(parentModel);
}
@@ -39,12 +39,12 @@ public class LocatorModelLookupService extends AbstractLocatorModelService imple
* @see org.eclipse.tcf.te.tcf.locator.core.interfaces.services.ILocatorModelLookupService#lkupPeerModelById(java.lang.String)
*/
@Override
- public IPeerModel lkupPeerModelById(String id) {
+ public IPeerNode lkupPeerModelById(String id) {
Assert.isNotNull(id);
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- IPeerModel node = null;
- for (IPeerModel candidate : getLocatorModel().getPeers()) {
+ IPeerNode node = null;
+ for (IPeerNode candidate : getPeerModel().getPeers()) {
IPeer peer = candidate.getPeer();
if (id.equals(peer.getID())) {
node = candidate;
@@ -60,16 +60,16 @@ public class LocatorModelLookupService extends AbstractLocatorModelService imple
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService#lkupPeerModelById(java.lang.String, java.lang.String)
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelLookupService#lkupPeerModelById(java.lang.String, java.lang.String)
*/
@Override
- public IPeerModel lkupPeerModelById(String parentId, String id) {
+ public IPeerNode lkupPeerModelById(String parentId, String id) {
Assert.isNotNull(parentId);
Assert.isNotNull(id);
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- IPeerModel node = null;
- for (IPeerModel candidate : getLocatorModel().getChildren(parentId)) {
+ IPeerNode node = null;
+ for (IPeerNode candidate : getPeerModel().getChildren(parentId)) {
IPeer peer = candidate.getPeer();
if (id.equals(peer.getID())) {
node = candidate;
@@ -85,75 +85,75 @@ public class LocatorModelLookupService extends AbstractLocatorModelService imple
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService#lkupPeerModelByAgentId(java.lang.String)
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelLookupService#lkupPeerModelByAgentId(java.lang.String)
*/
@Override
- public IPeerModel[] lkupPeerModelByAgentId(String agentId) {
+ public IPeerNode[] lkupPeerModelByAgentId(String agentId) {
Assert.isNotNull(agentId);
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- List<IPeerModel> nodes = new ArrayList<IPeerModel>();
- for (IPeerModel candidate : getLocatorModel().getPeers()) {
+ List<IPeerNode> nodes = new ArrayList<IPeerNode>();
+ for (IPeerNode candidate : getPeerModel().getPeers()) {
IPeer peer = candidate.getPeer();
if (agentId.equals(peer.getAgentID())) {
nodes.add(candidate);
}
}
- return nodes.toArray(new IPeerModel[nodes.size()]);
+ return nodes.toArray(new IPeerNode[nodes.size()]);
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService#lkupPeerModelByAgentId(java.lang.String, java.lang.String)
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelLookupService#lkupPeerModelByAgentId(java.lang.String, java.lang.String)
*/
@Override
- public IPeerModel[] lkupPeerModelByAgentId(String parentId, String agentId) {
+ public IPeerNode[] lkupPeerModelByAgentId(String parentId, String agentId) {
Assert.isNotNull(parentId);
Assert.isNotNull(agentId);
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- List<IPeerModel> nodes = new ArrayList<IPeerModel>();
- for (IPeerModel candidate : getLocatorModel().getChildren(parentId)) {
+ 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 IPeerModel[nodes.size()]);
+ return nodes.toArray(new IPeerNode[nodes.size()]);
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService#lkupPeerModelByName(java.lang.String)
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelLookupService#lkupPeerModelByName(java.lang.String)
*/
@Override
- public IPeerModel[] lkupPeerModelByName(String name) {
+ public IPeerNode[] lkupPeerModelByName(String name) {
Assert.isNotNull(name);
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- List<IPeerModel> nodes = new ArrayList<IPeerModel>();
- for (IPeerModel candidate : getLocatorModel().getPeers()) {
+ List<IPeerNode> nodes = new ArrayList<IPeerNode>();
+ for (IPeerNode candidate : getPeerModel().getPeers()) {
IPeer peer = candidate.getPeer();
if (name.equals(peer.getName())) {
nodes.add(candidate);
}
}
- return nodes.toArray(new IPeerModel[nodes.size()]);
+ return nodes.toArray(new IPeerNode[nodes.size()]);
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService#lkupPeerModelBySupportedServices(java.lang.String[], java.lang.String[])
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelLookupService#lkupPeerModelBySupportedServices(java.lang.String[], java.lang.String[])
*/
@Override
- public IPeerModel[] lkupPeerModelBySupportedServices(String[] expectedLocalServices, String[] expectedRemoteServices) {
+ public IPeerNode[] lkupPeerModelBySupportedServices(String[] expectedLocalServices, String[] expectedRemoteServices) {
Assert.isTrue(!Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- ILocatorModel model = getLocatorModel();
- ILocatorModelPeerNodeQueryService queryService = model.getService(ILocatorModelPeerNodeQueryService.class);
+ IPeerModel model = getPeerModel();
+ IPeerModelQueryService queryService = model.getService(IPeerModelQueryService.class);
- List<IPeerModel> nodes = new ArrayList<IPeerModel>();
- for (IPeerModel candidate : model.getPeers()) {
+ List<IPeerNode> nodes = new ArrayList<IPeerNode>();
+ for (IPeerNode candidate : model.getPeers()) {
String services = queryService.queryLocalServices(candidate);
boolean matchesExpectations = true;
@@ -193,33 +193,30 @@ public class LocatorModelLookupService extends AbstractLocatorModelService imple
if (matchesExpectations) nodes.add(candidate);
}
- return nodes.toArray(new IPeerModel[nodes.size()]);
+ return nodes.toArray(new IPeerNode[nodes.size()]);
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService#lkupMatchingStaticPeerModels(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel)
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelLookupService#lkupMatchingStaticPeerModels(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode)
*/
@Override
- public IPeerModel[] lkupMatchingStaticPeerModels(IPeerModel peerNode) {
+ 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.ILocatorModelLookupService#lkupMatchingStaticPeerModels(org.eclipse.tcf.protocol.IPeer)
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelLookupService#lkupMatchingStaticPeerModels(org.eclipse.tcf.protocol.IPeer)
*/
@Override
- public IPeerModel[] lkupMatchingStaticPeerModels(IPeer peer) {
+ public IPeerNode[] lkupMatchingStaticPeerModels(IPeer peer) {
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- List<IPeerModel> nodes = new ArrayList<IPeerModel>();
+ List<IPeerNode> nodes = new ArrayList<IPeerNode>();
if (peer != null) {
- for (IPeerModel candidate : getLocatorModel().getPeers()) {
- // Look only at the static peers here
- if (!candidate.isStatic()) continue;
-
+ for (IPeerNode candidate : getPeerModel().getPeers()) {
// 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);
@@ -245,6 +242,6 @@ public class LocatorModelLookupService extends AbstractLocatorModelService imple
}
}
- return nodes.toArray(new IPeerModel[nodes.size()]);
+ 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/LocatorModelPeerNodeQueryService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelQueryService.java
index 356f3536a..51f3cd282 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/LocatorModelPeerNodeQueryService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelQueryService.java
@@ -23,31 +23,31 @@ import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.te.runtime.interfaces.IConditionTester;
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.ILocatorModel;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProperties;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelPeerNodeQueryService;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelUpdateService;
+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.interfaces.services.IPeerModelUpdateService;
/**
* Default locator model peer node query service implementation.
*/
-public class LocatorModelPeerNodeQueryService extends AbstractLocatorModelService implements ILocatorModelPeerNodeQueryService {
+public class PeerModelQueryService extends AbstractPeerModelService implements IPeerModelQueryService {
/**
* Constructor.
*
* @param parentModel The parent locator model instance. Must not be <code>null</code>.
*/
- public LocatorModelPeerNodeQueryService(ILocatorModel parentModel) {
+ public PeerModelQueryService(IPeerModel parentModel) {
super(parentModel);
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelPeerNodeQueryService#queryLocalServices(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel)
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelQueryService#queryLocalServices(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode)
*/
@Override
- public String queryLocalServices(final IPeerModel node) {
+ public String queryLocalServices(final IPeerNode node) {
Assert.isTrue(!Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
Assert.isNotNull(node);
@@ -56,7 +56,7 @@ public class LocatorModelPeerNodeQueryService extends AbstractLocatorModelServic
Protocol.invokeAndWait(new Runnable() {
@Override
public void run() {
- services.set(node.getStringProperty(IPeerModelProperties.PROP_LOCAL_SERVICES));
+ services.set(node.getStringProperty(IPeerNodeProperties.PROP_LOCAL_SERVICES));
}
});
@@ -75,7 +75,7 @@ public class LocatorModelPeerNodeQueryService extends AbstractLocatorModelServic
@Override
public void doneQueryServices(Throwable error) {
if (error == null) {
- services.set(node.getStringProperty(IPeerModelProperties.PROP_LOCAL_SERVICES));
+ services.set(node.getStringProperty(IPeerNodeProperties.PROP_LOCAL_SERVICES));
}
completed.set(true);
}
@@ -104,10 +104,10 @@ public class LocatorModelPeerNodeQueryService extends AbstractLocatorModelServic
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelPeerNodeQueryService#queryRemoteServices(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel)
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelQueryService#queryRemoteServices(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode)
*/
@Override
- public String queryRemoteServices(final IPeerModel node) {
+ public String queryRemoteServices(final IPeerNode node) {
Assert.isTrue(!Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
Assert.isNotNull(node);
@@ -116,7 +116,7 @@ public class LocatorModelPeerNodeQueryService extends AbstractLocatorModelServic
Protocol.invokeAndWait(new Runnable() {
@Override
public void run() {
- services.set(node.getStringProperty(IPeerModelProperties.PROP_REMOTE_SERVICES));
+ services.set(node.getStringProperty(IPeerNodeProperties.PROP_REMOTE_SERVICES));
}
});
@@ -135,7 +135,7 @@ public class LocatorModelPeerNodeQueryService extends AbstractLocatorModelServic
@Override
public void doneQueryServices(Throwable error) {
if (error == null) {
- services.set(node.getStringProperty(IPeerModelProperties.PROP_REMOTE_SERVICES));
+ services.set(node.getStringProperty(IPeerNodeProperties.PROP_REMOTE_SERVICES));
}
completed.set(true);
}
@@ -163,13 +163,13 @@ public class LocatorModelPeerNodeQueryService extends AbstractLocatorModelServic
return services.get();
}
- /* default */ final Map<IPeerModel, List<DoneQueryServices>> serviceQueriesInProgress = new HashMap<IPeerModel, List<DoneQueryServices>>();
+ /* default */ final Map<IPeerNode, List<DoneQueryServices>> serviceQueriesInProgress = new HashMap<IPeerNode, List<DoneQueryServices>>();
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelPeerNodeQueryService#queryServicesAsync(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel, org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelPeerNodeQueryService.DoneQueryServices)
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelQueryService#queryServicesAsync(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode, org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelQueryService.DoneQueryServices)
*/
@Override
- public void queryServicesAsync(final IPeerModel node, final DoneQueryServices done) {
+ public void queryServicesAsync(final IPeerNode node, final DoneQueryServices done) {
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
Assert.isNotNull(node);
Assert.isNotNull(done);
@@ -204,8 +204,8 @@ public class LocatorModelPeerNodeQueryService extends AbstractLocatorModelServic
};
// Do not try to open a channel to peers known to be unreachable
- int state = node.getIntProperty(IPeerModelProperties.PROP_STATE);
- if (state == IPeerModelProperties.STATE_ERROR || state == IPeerModelProperties.STATE_NOT_REACHABLE || !node.isComplete()) {
+ int state = node.getIntProperty(IPeerNodeProperties.PROP_STATE);
+ if (state == IPeerNodeProperties.STATE_ERROR || state == IPeerNodeProperties.STATE_NOT_REACHABLE || !node.isComplete()) {
innerDone.doneQueryServices(null);
return;
}
@@ -234,7 +234,7 @@ public class LocatorModelPeerNodeQueryService extends AbstractLocatorModelServic
Collections.sort(remoteServices);
// Update the services
- ILocatorModelUpdateService updateService = node.getModel().getService(ILocatorModelUpdateService.class);
+ IPeerModelUpdateService updateService = node.getModel().getService(IPeerModelUpdateService.class);
updateService.updatePeerServices(node, localServices, remoteServices);
// Invoke the callback
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/PeerModelRefreshService.java
index 2894548ce..ba31a6891 100644
--- 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/PeerModelRefreshService.java
@@ -44,31 +44,29 @@ 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.ILocatorModel;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProperties;
+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.preferences.IPreferenceKeys;
-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;
+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.model.ModelLocationUtil;
-import org.eclipse.tcf.te.tcf.locator.nodes.ConnectablePeerModel;
-import org.eclipse.tcf.te.tcf.locator.nodes.LocatorModel;
-import org.eclipse.tcf.te.tcf.locator.nodes.PeerModel;
+import org.eclipse.tcf.te.tcf.locator.nodes.PeerNode;
import org.eclipse.tcf.te.tcf.locator.nodes.PeerRedirector;
/**
* Default locator model refresh service implementation.
*/
-public class LocatorModelRefreshService extends AbstractLocatorModelService implements ILocatorModelRefreshService {
+public class PeerModelRefreshService extends AbstractPeerModelService implements IPeerModelRefreshService {
/**
* Constructor.
*
* @param parentModel The parent locator model instance. Must not be <code>null</code>.
*/
- public LocatorModelRefreshService(ILocatorModel parentModel) {
+ public PeerModelRefreshService(IPeerModel parentModel) {
super(parentModel);
}
@@ -84,21 +82,21 @@ public class LocatorModelRefreshService extends AbstractLocatorModelService impl
Protocol.invokeLater(new Runnable() {
@Override
public void run() {
- callback.done(LocatorModelRefreshService.this, Status.OK_STATUS);
+ callback.done(PeerModelRefreshService.this, Status.OK_STATUS);
}
});
}
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelRefreshService#refresh(org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
+ * @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 locator model
- ILocatorModel model = getLocatorModel();
+ IPeerModel model = getPeerModel();
// If the parent model is already disposed, the service will drop out immediately
if (model.isDisposed()) {
@@ -113,27 +111,27 @@ public class LocatorModelRefreshService extends AbstractLocatorModelService impl
}
// Get the list of old children (update node instances where possible)
- final List<IPeerModel> oldChildren = new ArrayList<IPeerModel>(Arrays.asList(model.getPeers()));
+ final List<IPeerNode> oldChildren = new ArrayList<IPeerNode>(Arrays.asList(model.getPeers()));
// 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 LocatorModel) {
- ((LocatorModel)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);
- }
+// // 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 (IPeerModel oldChild : oldChildren) {
- model.getService(ILocatorModelUpdateService.class).remove(oldChild);
+ for (IPeerNode oldChild : oldChildren) {
+ model.getService(IPeerModelUpdateService.class).remove(oldChild);
}
// Invoke the callback
@@ -147,7 +145,7 @@ public class LocatorModelRefreshService extends AbstractLocatorModelService impl
* @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<IPeerModel> oldChildren, ILocatorModel model) {
+ protected void processPeers(Map<String, IPeer> peers, List<IPeerNode> oldChildren, IPeerModel model) {
Assert.isNotNull(peers);
Assert.isNotNull(oldChildren);
Assert.isNotNull(model);
@@ -156,35 +154,25 @@ public class LocatorModelRefreshService extends AbstractLocatorModelService impl
// Get the peer instance for the current peer id
IPeer peer = entry.getValue();
// Try to find an existing peer node first
- IPeerModel peerNode = model.getService(ILocatorModelLookupService.class).lkupPeerModelById(entry.getKey());
+ IPeerNode peerNode = model.getService(IPeerModelLookupService.class).lkupPeerModelById(entry.getKey());
// And create a new one if we cannot find it
if (peerNode == null) {
- String value = peer.getAttributes().get("static.transient"); //$NON-NLS-1$
- if (value != null && Boolean.parseBoolean(value.trim())) {
- peerNode = new ConnectablePeerModel(model, peer);
- }
- else {
- peerNode = new PeerModel(model, peer);
- }
+ peerNode = new PeerNode(model, peer);
}
else {
oldChildren.remove(peerNode);
}
if (peerNode.getPeer() != peer) {
- if (!peerNode.isStatic()) {
- peerNode.setProperty(IPeerModelProperties.PROP_INSTANCE, peer);
- } else {
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(IPeerModelProperties.PROP_INSTANCE, peer);
+ peerNode.setProperty(IPeerNodeProperties.PROP_INSTANCE, peer);
} else {
// Merge user configured properties between the peers
- model.getService(ILocatorModelUpdateService.class).mergeUserDefinedAttributes(peerNode, peer, false);
+ model.getService(IPeerModelUpdateService.class).mergeUserDefinedAttributes(peerNode, peer, false);
}
- }
}
// Validate the peer node before adding
@@ -193,15 +181,14 @@ public class LocatorModelRefreshService extends AbstractLocatorModelService impl
// 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.
- if (peerNode.isStatic()) {
- IPeerModel toRemove = null;
- for (IPeerModel candidate : model.getPeers()) {
- if (candidate.isStatic() || candidate.equals(peerNode))continue;
+ IPeerNode toRemove = null;
+ for (IPeerNode candidate : model.getPeers()) {
+ 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(ILocatorModelUpdateService.class).mergeUserDefinedAttributes(candidate, peerNode.getPeer(), true);
+ model.getService(IPeerModelUpdateService.class).mergeUserDefinedAttributes(candidate, peerNode.getPeer(), true);
peerNode = null;
break;
}
@@ -215,13 +202,13 @@ public class LocatorModelRefreshService extends AbstractLocatorModelService impl
// Same pipe -> same node
if (name1 != null && name1.equals(name2)) {
// Merge user configured properties between the peers
- model.getService(ILocatorModelUpdateService.class).mergeUserDefinedAttributes(peerNode, candidate.getPeer(), true);
+ 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(ILocatorModelUpdateService.class).mergeUserDefinedAttributes(peerNode, candidate.getPeer(), true);
+ model.getService(IPeerModelUpdateService.class).mergeUserDefinedAttributes(peerNode, candidate.getPeer(), true);
toRemove = candidate;
break;
} else {
@@ -235,7 +222,7 @@ public class LocatorModelRefreshService extends AbstractLocatorModelService impl
if (port1 != null && port1.equals(port2)) {
// Merge user configured properties between the peers
- model.getService(ILocatorModelUpdateService.class).mergeUserDefinedAttributes(peerNode, candidate.getPeer(), true);
+ model.getService(IPeerModelUpdateService.class).mergeUserDefinedAttributes(peerNode, candidate.getPeer(), true);
toRemove = candidate;
break;
}
@@ -245,14 +232,13 @@ public class LocatorModelRefreshService extends AbstractLocatorModelService impl
}
if (toRemove != null) {
- model.getService(ILocatorModelUpdateService.class).remove(toRemove);
+ model.getService(IPeerModelUpdateService.class).remove(toRemove);
toRemove = null;
}
- }
if (peerNode != null) {
// Add the peer node to model
- model.getService(ILocatorModelUpdateService.class).add(peerNode);
+ model.getService(IPeerModelUpdateService.class).add(peerNode);
// And schedule for immediate status update
Runnable runnable = new ScannerRunnable(model.getScanner(), peerNode);
Protocol.invokeLater(runnable);
@@ -264,7 +250,7 @@ public class LocatorModelRefreshService extends AbstractLocatorModelService impl
private final AtomicBoolean REFRESH_STATIC_PEERS_GUARD = new AtomicBoolean(false);
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelRefreshService#refreshStaticPeers()
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelRefreshService#refreshStaticPeers()
*/
@Override
public void refreshStaticPeers() {
@@ -278,7 +264,7 @@ public class LocatorModelRefreshService extends AbstractLocatorModelService impl
REFRESH_STATIC_PEERS_GUARD.set(true);
// Get the parent locator model
- ILocatorModel model = getLocatorModel();
+ IPeerModel model = getPeerModel();
// If the parent model is already disposed, the service will drop out immediately
if (model.isDisposed()) {
@@ -286,7 +272,7 @@ public class LocatorModelRefreshService extends AbstractLocatorModelService impl
}
// Get the list of old children (update node instances where possible)
- final List<IPeerModel> oldChildren = new ArrayList<IPeerModel>(Arrays.asList(model.getPeers()));
+ final List<IPeerNode> oldChildren = new ArrayList<IPeerNode>(Arrays.asList(model.getPeers()));
// Refresh the static peer definitions
refreshStaticPeers(oldChildren, model);
@@ -300,7 +286,7 @@ public class LocatorModelRefreshService extends AbstractLocatorModelService impl
* @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 refreshStaticPeers(List<IPeerModel> oldChildren, ILocatorModel model) {
+ protected void refreshStaticPeers(List<IPeerNode> oldChildren, IPeerModel model) {
Assert.isNotNull(oldChildren);
Assert.isNotNull(model);
@@ -367,19 +353,19 @@ public class LocatorModelRefreshService extends AbstractLocatorModelService impl
}
// If the redirect property is not set, create the peer right away
- if (attrs.get(IPeerModelProperties.PROP_REDIRECT_PROXY) == null) {
+ if (attrs.get(IPeerNodeProperties.PROP_REDIRECT_PROXY) == null) {
// Construct the peer from the attributes
IPeer peer = new Peer(attrs);
// Add the constructed peer to the peers map
peers.put(peer.getID(), peer);
} else {
// Try to get the peer proxy
- String proxyId = attrs.get(IPeerModelProperties.PROP_REDIRECT_PROXY);
+ String proxyId = attrs.get(IPeerNodeProperties.PROP_REDIRECT_PROXY);
IPeer proxy = peers.get(proxyId);
if (proxy == null) {
- IPeerModel peerModel = model.getService(ILocatorModelLookupService.class).lkupPeerModelById(proxyId);
- if (peerModel != null) {
- proxy = peerModel.getPeer();
+ IPeerNode peerNode = model.getService(IPeerModelLookupService.class).lkupPeerModelById(proxyId);
+ if (peerNode != null) {
+ proxy = peerNode.getPeer();
}
}
@@ -403,12 +389,12 @@ public class LocatorModelRefreshService extends AbstractLocatorModelService impl
// Process postponed peers if there are any
if (!postponed.isEmpty()) {
for (Map<String, String> attrs : postponed) {
- String proxyId = attrs.get(IPeerModelProperties.PROP_REDIRECT_PROXY);
+ String proxyId = attrs.get(IPeerNodeProperties.PROP_REDIRECT_PROXY);
IPeer proxy = proxyId != null ? peers.get(proxyId) : null;
if (proxy == null) {
- IPeerModel peerModel = model.getService(ILocatorModelLookupService.class).lkupPeerModelById(proxyId);
- if (peerModel != null) {
- proxy = peerModel.getPeer();
+ IPeerNode peerNode = model.getService(IPeerModelLookupService.class).lkupPeerModelById(proxyId);
+ if (peerNode != null) {
+ proxy = peerNode.getPeer();
}
}
@@ -419,7 +405,7 @@ public class LocatorModelRefreshService extends AbstractLocatorModelService impl
peers.put(redirector.getID(), redirector);
} else {
// Proxy not available -> reset redirection
- attrs.remove(IPeerModelProperties.PROP_REDIRECT_PROXY);
+ attrs.remove(IPeerNodeProperties.PROP_REDIRECT_PROXY);
// Construct the peer from the attributes
IPeer peer = new Peer(attrs);
// Add the constructed peer to the peers map
@@ -441,16 +427,16 @@ public class LocatorModelRefreshService extends AbstractLocatorModelService impl
}
// Get the peers peer model object
- IPeerModel peerModel = model.getService(ILocatorModelLookupService.class).lkupPeerModelById(entry.getKey());
- Assert.isNotNull(peerModel);
+ 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();
- IPeerModel proxy = model.getService(ILocatorModelLookupService.class).lkupPeerModelById(proxyPeerId);
+ IPeerNode proxy = model.getService(IPeerModelLookupService.class).lkupPeerModelById(proxyPeerId);
Assert.isNotNull(proxy);
- peerModel.setParent(proxy);
- model.getService(ILocatorModelUpdateService.class).addChild(peerModel);
+ peerNode.setParent(proxy);
+ model.getService(IPeerModelUpdateService.class).addChild(peerNode);
}
}
}
@@ -493,10 +479,10 @@ public class LocatorModelRefreshService extends AbstractLocatorModelService impl
/* default */ final List<ICallback> refreshAgentIDCallbacks = new ArrayList<ICallback>();
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelRefreshService#refreshAgentIDs(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel[], org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
+ * @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(IPeerModel[] nodes, final ICallback callback) {
+ 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
@@ -508,7 +494,7 @@ public class LocatorModelRefreshService extends AbstractLocatorModelService impl
refreshAgentIDCallbacks.add(callback);
// Get the parent locator model
- ILocatorModel model = getLocatorModel();
+ IPeerModel model = getPeerModel();
// If the parent model is already disposed, the service will drop out immediately
if (model.isDisposed()) {
@@ -530,11 +516,11 @@ public class LocatorModelRefreshService extends AbstractLocatorModelService impl
}, new CallbackInvocationDelegate());
// Make a copy of the current list of static peers before processing
- List<IPeerModel> nodesToProcess = new ArrayList<IPeerModel>(Arrays.asList(nodes != null ? nodes : model.getPeers()));
+ List<IPeerNode> nodesToProcess = new ArrayList<IPeerNode>(Arrays.asList(nodes != null ? nodes : model.getPeers()));
// Loop the list of static peers and try to get the agent ID
- for (IPeerModel node : nodesToProcess) {
+ for (IPeerNode node : nodesToProcess) {
// If not static or not complete --> ignore
- if (!node.isStatic() || !node.isComplete()) continue;
+ if (!node.isComplete()) continue;
// Refresh the agent ID
refreshAgentID(node, new AsyncCallbackCollector.SimpleCollectorCallback(collector));
}
@@ -549,18 +535,11 @@ public class LocatorModelRefreshService extends AbstractLocatorModelService impl
* @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 IPeerModel node, final ICallback callback) {
+ protected void refreshAgentID(final IPeerNode node, final ICallback callback) {
Assert.isNotNull(node);
Assert.isNotNull(callback);
- // If the peer is not static or associated with an remote peer
- // --> skip the node
- if (!node.isStatic() || node.isRemote()) {
- callback.done(LocatorModelRefreshService.this, Status.OK_STATUS);
- return;
- }
-
- Assert.isTrue(node.getPeer() instanceof Peer);
+ if (!(node.getPeer() instanceof Peer)) return;
// Try to open a channel to the node
Map<String, Boolean> flags = new HashMap<String, Boolean>();
@@ -588,30 +567,30 @@ public class LocatorModelRefreshService extends AbstractLocatorModelService impl
// Remove the old agent ID
Map<String, String> attrs = new HashMap<String, String>(channel.getRemotePeer().getAttributes());
attrs.remove(IPeer.ATTR_AGENT_ID);
- node.setProperty(IPeerModelProperties.PROP_INSTANCE, new Peer(attrs));
+ 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(IPeerModelProperties.PROP_INSTANCE, new Peer(attrs));
+ node.setProperty(IPeerNodeProperties.PROP_INSTANCE, new Peer(attrs));
}
// Invoke the callback
- callback.done(LocatorModelRefreshService.this, Status.OK_STATUS);
+ callback.done(PeerModelRefreshService.this, Status.OK_STATUS);
}
});
} else {
// Close the channel
Tcf.getChannelManager().closeChannel(channel);
// Invoke the callback
- callback.done(LocatorModelRefreshService.this, Status.OK_STATUS);
+ 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(LocatorModelRefreshService.this, Status.OK_STATUS);
+ 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/LocatorModelUpdateService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelUpdateService.java
index f55587249..0f4684ca4 100644
--- 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/PeerModelUpdateService.java
@@ -21,24 +21,24 @@ 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.ILocatorModel;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProperties;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelUpdateService;
+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.
*/
-public class LocatorModelUpdateService extends AbstractLocatorModelService implements ILocatorModelUpdateService {
+public class PeerModelUpdateService extends AbstractPeerModelService implements IPeerModelUpdateService {
/**
* Constructor.
*
* @param parentModel The parent locator model instance. Must not be <code>null</code>.
*/
- public LocatorModelUpdateService(ILocatorModel parentModel) {
+ public PeerModelUpdateService(IPeerModel parentModel) {
super(parentModel);
}
@@ -46,21 +46,21 @@ public class LocatorModelUpdateService extends AbstractLocatorModelService imple
* @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 IPeerModel peer) {
+ public void add(final IPeerNode peer) {
Assert.isNotNull(peer);
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- Map<String, IPeerModel> peers = (Map<String, IPeerModel>)getLocatorModel().getAdapter(Map.class);
+ Map<String, IPeerNode> peers = (Map<String, IPeerNode>)getPeerModel().getAdapter(Map.class);
Assert.isNotNull(peers);
peers.put(peer.getPeerId(), peer);
- final IModelListener[] listeners = getLocatorModel().getListener();
+ final IModelListener[] listeners = getPeerModel().getListener();
if (listeners.length > 0) {
Protocol.invokeLater(new Runnable() {
@Override
public void run() {
for (IModelListener listener : listeners) {
- listener.locatorModelChanged(getLocatorModel(), peer, true);
+ listener.locatorModelChanged(getPeerModel(), peer, true);
}
}
});
@@ -71,23 +71,23 @@ public class LocatorModelUpdateService extends AbstractLocatorModelService imple
* @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 IPeerModel peer) {
+ public void remove(final IPeerNode peer) {
Assert.isNotNull(peer);
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- Map<String, IPeerModel> peers = (Map<String, IPeerModel>)getLocatorModel().getAdapter(Map.class);
+ Map<String, IPeerNode> peers = (Map<String, IPeerNode>)getPeerModel().getAdapter(Map.class);
Assert.isNotNull(peers);
peers.remove(peer.getPeerId());
- getLocatorModel().setChildren(peer.getPeerId(), null);
+ getPeerModel().setChildren(peer.getPeerId(), null);
- final IModelListener[] listeners = getLocatorModel().getListener();
+ final IModelListener[] listeners = getPeerModel().getListener();
if (listeners.length > 0) {
Protocol.invokeLater(new Runnable() {
@Override
public void run() {
for (IModelListener listener : listeners) {
- listener.locatorModelChanged(getLocatorModel(), peer, false);
+ listener.locatorModelChanged(getPeerModel(), peer, false);
}
}
});
@@ -98,12 +98,12 @@ public class LocatorModelUpdateService extends AbstractLocatorModelService imple
* @see org.eclipse.tcf.te.tcf.locator.core.interfaces.services.ILocatorModelUpdateService#updatePeerServices(org.eclipse.tcf.te.tcf.locator.core.interfaces.nodes.IPeerModel, java.util.Collection, java.util.Collection)
*/
@Override
- public void updatePeerServices(IPeerModel peerNode, Collection<String> localServices, Collection<String> remoteServices) {
+ public void updatePeerServices(IPeerNode peerNode, Collection<String> localServices, Collection<String> remoteServices) {
Assert.isNotNull(peerNode);
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- peerNode.setProperty(IPeerModelProperties.PROP_LOCAL_SERVICES, localServices != null ? makeString(localServices) : null);
- peerNode.setProperty(IPeerModelProperties.PROP_REMOTE_SERVICES, remoteServices != null ? makeString(remoteServices) : null);
+ peerNode.setProperty(IPeerNodeProperties.PROP_LOCAL_SERVICES, localServices != null ? makeString(localServices) : null);
+ peerNode.setProperty(IPeerNodeProperties.PROP_REMOTE_SERVICES, remoteServices != null ? makeString(remoteServices) : null);
}
/**
@@ -124,15 +124,15 @@ public class LocatorModelUpdateService extends AbstractLocatorModelService imple
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelUpdateService#addChild(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel)
+ * @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 IPeerModel child) {
+ public void addChild(final IPeerNode child) {
Assert.isNotNull(child);
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
// Determine the parent node
- final IPeerModel parent = child.getParent(IPeerModel.class);
+ final IPeerNode parent = child.getParent(IPeerNode.class);
if (parent == null) return;
// Determine the peer id of the parent
@@ -140,10 +140,10 @@ public class LocatorModelUpdateService extends AbstractLocatorModelService imple
Assert.isNotNull(parentPeerId);
// Get the list of existing children
- List<IPeerModel> children = new ArrayList<IPeerModel>(getLocatorModel().getChildren(parentPeerId));
+ List<IPeerNode> children = new ArrayList<IPeerNode>(getPeerModel().getChildren(parentPeerId));
if (!children.contains(child)) {
children.add(child);
- getLocatorModel().setChildren(parentPeerId, children);
+ getPeerModel().setChildren(parentPeerId, children);
}
// Notify listeners
@@ -151,15 +151,15 @@ public class LocatorModelUpdateService extends AbstractLocatorModelService imple
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelUpdateService#removeChild(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel)
+ * @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 IPeerModel child) {
+ public void removeChild(final IPeerNode child) {
Assert.isNotNull(child);
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
// Determine the parent node
- final IPeerModel parent = child.getParent(IPeerModel.class);
+ final IPeerNode parent = child.getParent(IPeerNode.class);
if (parent == null) return;
// Determine the peer id of the parent
@@ -167,10 +167,10 @@ public class LocatorModelUpdateService extends AbstractLocatorModelService imple
Assert.isNotNull(parentPeerId);
// Get the list of existing children
- List<IPeerModel> children = new ArrayList<IPeerModel>(getLocatorModel().getChildren(parentPeerId));
+ List<IPeerNode> children = new ArrayList<IPeerNode>(getPeerModel().getChildren(parentPeerId));
if (children.contains(child)) {
children.remove(child);
- getLocatorModel().setChildren(parentPeerId, children);
+ getPeerModel().setChildren(parentPeerId, children);
}
// Notify listeners
@@ -178,10 +178,10 @@ public class LocatorModelUpdateService extends AbstractLocatorModelService imple
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelUpdateService#mergeUserDefinedAttributes(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel, org.eclipse.tcf.protocol.IPeer, boolean)
+ * @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(IPeerModel node, IPeer peer, boolean force) {
+ 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$
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/StepperOperationService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/StepperOperationService.java
index 70fabdaaf..f1ff8984e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/StepperOperationService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/StepperOperationService.java
@@ -12,7 +12,7 @@ package org.eclipse.tcf.te.tcf.locator.services;
import org.eclipse.core.runtime.Assert;
import org.eclipse.tcf.te.core.interfaces.IConnectable;
-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.IStepperServiceOperations;
/**
@@ -40,7 +40,7 @@ public class StepperOperationService extends org.eclipse.tcf.te.runtime.stepper.
*/
@Override
public String getStepGroupId(Object context, String operation) {
- Assert.isTrue(context instanceof IPeerModel);
+ Assert.isTrue(context instanceof IPeerNode);
if (IStepperServiceOperations.CONNECT.equals(operation)) {
return "org.eclipse.tcf.te.tcf.locator.connectStepGroup"; //$NON-NLS-1$
@@ -57,13 +57,13 @@ public class StepperOperationService extends org.eclipse.tcf.te.runtime.stepper.
*/
@Override
public String getStepGroupName(Object context, String operation) {
- Assert.isTrue(context instanceof IPeerModel);
+ Assert.isTrue(context instanceof IPeerNode);
if (IStepperServiceOperations.CONNECT.equals(operation)) {
- return "Connect "+((IPeerModel)context).getName(); //$NON-NLS-1$
+ return "Connect "+((IPeerNode)context).getName(); //$NON-NLS-1$
}
if (IStepperServiceOperations.DISCONNECT.equals(operation)) {
- return "Disconnect "+((IPeerModel)context).getName(); //$NON-NLS-1$
+ return "Disconnect "+((IPeerNode)context).getName(); //$NON-NLS-1$
}
return null;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/selection/RuntimeServiceContextFilter.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/selection/RuntimeServiceContextFilter.java
index e23d2f3d6..9cf2ffa15 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/selection/RuntimeServiceContextFilter.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/selection/RuntimeServiceContextFilter.java
@@ -17,8 +17,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
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.IPeerModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProperties;
+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.IDefaultContextService;
/**
@@ -51,19 +51,19 @@ public class RuntimeServiceContextFilter implements IDefaultContextService.ICont
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.IDefaultContextService.IContextFilter#select(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel)
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.services.IDefaultContextService.IContextFilter#select(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode)
*/
@Override
- public boolean select(final IPeerModel peerModel) {
- Assert.isNotNull(peerModel);
+ public boolean select(final IPeerNode peerNode) {
+ Assert.isNotNull(peerNode);
- final IPeer peer = peerModel.getPeer();
+ final IPeer peer = peerNode.getPeer();
final AtomicBoolean result = new AtomicBoolean(false);
Protocol.invokeAndWait(new Runnable() {
@Override
public void run() {
List<String> list;
- String services = peerModel.getStringProperty(IPeerModelProperties.PROP_REMOTE_SERVICES);
+ String services = peerNode.getStringProperty(IPeerNodeProperties.PROP_REMOTE_SERVICES);
if (services != null) {
list = Arrays.asList(services.split(",\\s*")); //$NON-NLS-1$
boolean containsAll = true;
@@ -78,7 +78,7 @@ public class RuntimeServiceContextFilter implements IDefaultContextService.ICont
}
if (useDisconnectedContexts) {
- services = peer.getAttributes().get(IPeerModelProperties.PROP_OFFLINE_SERVICES);
+ services = peer.getAttributes().get(IPeerNodeProperties.PROP_OFFLINE_SERVICES);
list = services != null ? Arrays.asList(services.split(",\\s*")) : Collections.EMPTY_LIST; //$NON-NLS-1$
boolean containsAll = true;
for (String serviceName : serviceNames) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/AbstractPeerModelStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/AbstractPeerNodeStep.java
index 3effd5fbf..98fdd69c4 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/AbstractPeerModelStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/AbstractPeerNodeStep.java
@@ -1,45 +1,45 @@
-/*******************************************************************************
- * 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.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-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.core.steps.AbstractPeerStep;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-
-/**
- * Abstract peer model context step
- */
-public abstract class AbstractPeerModelStep extends AbstractPeerStep {
-
- /**
- * Returns the active peer model context that is currently used.
- *
- * @param context The step context. Must not be <code>null</code>.
- * @param data The data giving object. Must not be <code>null</code>.
- * @param fullQualifiedId The full qualfied id for this step. Must not be <code>null</code>.
- * @return The active peer model context.
- */
- protected IPeerModel getActivePeerModelContext(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId) {
- Object activeContext = getActiveContext(context, data, fullQualifiedId);
- IPeerModel peerModel = null;
- if (activeContext instanceof IPeerModel)
- return (IPeerModel)activeContext;
- if (activeContext instanceof IAdaptable)
- peerModel = (IPeerModel)((IAdaptable)activeContext).getAdapter(IPeerModel.class);
- if (peerModel == null)
- peerModel = (IPeerModel)Platform.getAdapterManager().getAdapter(activeContext, IPeerModel.class);
-
- return peerModel;
- }
-}
+/*******************************************************************************
+ * 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.IAdaptable;
+import org.eclipse.core.runtime.Platform;
+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.core.steps.AbstractPeerStep;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
+
+/**
+ * Abstract peer model context step
+ */
+public abstract class AbstractPeerNodeStep extends AbstractPeerStep {
+
+ /**
+ * Returns the active peer model context that is currently used.
+ *
+ * @param context The step context. Must not be <code>null</code>.
+ * @param data The data giving object. Must not be <code>null</code>.
+ * @param fullQualifiedId The full qualfied id for this step. Must not be <code>null</code>.
+ * @return The active peer model context.
+ */
+ protected IPeerNode getActivePeerModelContext(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId) {
+ Object activeContext = getActiveContext(context, data, fullQualifiedId);
+ IPeerNode peerNode = null;
+ if (activeContext instanceof IPeerNode)
+ return (IPeerNode)activeContext;
+ if (activeContext instanceof IAdaptable)
+ peerNode = (IPeerNode)((IAdaptable)activeContext).getAdapter(IPeerNode.class);
+ if (peerNode == null)
+ peerNode = (IPeerNode)Platform.getAdapterManager().getAdapter(activeContext, IPeerNode.class);
+
+ return peerNode;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/CheckServiceStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/CheckServiceStep.java
index 69b562ec4..2af3fb0ab 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/CheckServiceStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/CheckServiceStep.java
@@ -27,12 +27,12 @@ import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
import org.eclipse.tcf.te.tcf.core.interfaces.steps.ITcfStepAttributes;
import org.eclipse.tcf.te.tcf.locator.activator.CoreBundleActivator;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProperties;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties;
/**
* Check service step implementation.
*/
-public class CheckServiceStep extends AbstractPeerModelStep {
+public class CheckServiceStep extends AbstractPeerNodeStep {
public static final String PARAMETER_REMOTE_SERVICE = "remoteService"; //$NON-NLS-1$
public static final String PARAMETER_LOCAL_SERVICE = "localService"; //$NON-NLS-1$
@@ -88,7 +88,7 @@ public class CheckServiceStep extends AbstractPeerModelStep {
}
String offlineService = getParameters().get(PARAMETER_OFFLINE_SERVICE);
- String services = getActivePeerContext(context, data, fullQualifiedId).getAttributes().get(IPeerModelProperties.PROP_OFFLINE_SERVICES);
+ String services = getActivePeerContext(context, data, fullQualifiedId).getAttributes().get(IPeerNodeProperties.PROP_OFFLINE_SERVICES);
List<String> list = services != null ? Arrays.asList(services.split(",\\s*")) : Collections.EMPTY_LIST; //$NON-NLS-1$
if (offlineService != null && !list.contains(offlineService)) {
throw new CoreException(new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), "missing offline service '" + offlineService + "'")); //$NON-NLS-1$ //$NON-NLS-2$
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/SetAsDefaultContextStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/SetAsDefaultContextStep.java
index 023622795..df40c6157 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/SetAsDefaultContextStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/SetAsDefaultContextStep.java
@@ -23,7 +23,7 @@ import org.eclipse.tcf.te.tcf.locator.interfaces.services.IDefaultContextService
/**
* Set the active context as default context.
*/
-public class SetAsDefaultContextStep extends AbstractPeerModelStep {
+public class SetAsDefaultContextStep extends AbstractPeerNodeStep {
/**
* Constructor.
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/SetWaitForReadyStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/SetWaitForReadyStep.java
index 386d936ea..369a2b4e1 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/SetWaitForReadyStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/SetWaitForReadyStep.java
@@ -19,12 +19,12 @@ 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.nodes.IPeerModelProperties;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties;
/**
* Set the waiting_for_ready state.
*/
-public class SetWaitForReadyStep extends AbstractPeerModelStep {
+public class SetWaitForReadyStep extends AbstractPeerNodeStep {
/**
* Constructor.
@@ -47,9 +47,9 @@ public class SetWaitForReadyStep extends AbstractPeerModelStep {
Protocol.invokeAndWait(new Runnable() {
@Override
public void run() {
- int state = getActivePeerModelContext(context, data, fullQualifiedId).getIntProperty(IPeerModelProperties.PROP_STATE);
- if (state == IPeerModelProperties.STATE_UNKNOWN || state == IPeerModelProperties.STATE_NOT_REACHABLE || state == IPeerModelProperties.STATE_ERROR) {
- getActivePeerModelContext(context, data, fullQualifiedId).setProperty(IPeerModelProperties.PROP_STATE, IPeerModelProperties.STATE_WAITING_FOR_READY);
+ int state = getActivePeerModelContext(context, data, fullQualifiedId).getIntProperty(IPeerNodeProperties.PROP_STATE);
+ if (state == IPeerNodeProperties.STATE_UNKNOWN || state == IPeerNodeProperties.STATE_NOT_REACHABLE || state == IPeerNodeProperties.STATE_ERROR) {
+ getActivePeerModelContext(context, data, fullQualifiedId).setProperty(IPeerNodeProperties.PROP_STATE, IPeerNodeProperties.STATE_WAITING_FOR_READY);
}
}
});
@@ -72,7 +72,7 @@ public class SetWaitForReadyStep extends AbstractPeerModelStep {
Protocol.invokeAndWait(new Runnable() {
@Override
public void run() {
- getActivePeerModelContext(context, data, fullQualifiedId).setProperty(IPeerModelProperties.PROP_STATE, IPeerModelProperties.STATE_NOT_REACHABLE);
+ getActivePeerModelContext(context, data, fullQualifiedId).setProperty(IPeerNodeProperties.PROP_STATE, IPeerNodeProperties.STATE_NOT_REACHABLE);
}
});
super.rollback(context, data, status, fullQualifiedId, monitor, callback);
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
index cbf2a034e..f29164fca 100644
--- 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
@@ -19,14 +19,14 @@ 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.ILocatorModel;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
import org.eclipse.tcf.te.tcf.locator.model.Model;
/**
* Signal peer disconnected step.
*/
-public class SignalPeerDisconnectedStep extends AbstractPeerModelStep {
+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)
@@ -46,14 +46,14 @@ public class SignalPeerDisconnectedStep extends AbstractPeerModelStep {
Assert.isNotNull(monitor);
Assert.isNotNull(callback);
- final IPeerModel peerModel = getActivePeerModelContext(context, data, fullQualifiedId);
- if (peerModel != null) {
+ final IPeerNode peerNode = getActivePeerModelContext(context, data, fullQualifiedId);
+ if (peerNode != null) {
Protocol.invokeLater(new Runnable() {
@Override
public void run() {
- ILocatorModel model = Model.getModel();
+ IPeerModel model = Model.getModel();
for (IModelListener listener : model.getListener()) {
- listener.locatorModelChanged(model, peerModel, false);
+ 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/StartDebuggerStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StartDebuggerStep.java
index 73ae17f02..58b66d40c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StartDebuggerStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StartDebuggerStep.java
@@ -30,14 +30,14 @@ import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
import org.eclipse.tcf.te.runtime.utils.StatusHelper;
import org.eclipse.tcf.te.tcf.locator.interfaces.IStepAttributes;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProperties;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelPeerNodeQueryService;
+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;
/**
* Start debugger step implementation.
*/
-public class StartDebuggerStep extends AbstractPeerModelStep {
+public class StartDebuggerStep extends AbstractPeerNodeStep {
/**
* Interface to be implemented by start debugger step delegates.
@@ -51,7 +51,7 @@ public class StartDebuggerStep extends AbstractPeerModelStep {
* @param monitor The progress monitor. Must not be <code>null</code>.
* @param callback The callback to invoke if finished. Must not be <code>null</code>.
*/
- public void postAttachDebugger(IPeerModel node, IProgressMonitor monitor, ICallback callback);
+ public void postAttachDebugger(IPeerNode node, IProgressMonitor monitor, ICallback callback);
}
/**
@@ -72,7 +72,7 @@ public class StartDebuggerStep extends AbstractPeerModelStep {
*/
@Override
public void execute(final IStepContext context, final IPropertiesContainer data, final IFullQualifiedId fullQualifiedId, final IProgressMonitor monitor, final ICallback callback) {
- final IPeerModel node = getActivePeerModelContext(context, data, fullQualifiedId);
+ final IPeerNode node = getActivePeerModelContext(context, data, fullQualifiedId);
Assert.isNotNull(node);
String value = getParameters().get("autoAttachAll"); //$NON-NLS-1$
final boolean autoAttachAll = value != null ? Boolean.parseBoolean(value) : false;
@@ -82,14 +82,14 @@ public class StartDebuggerStep extends AbstractPeerModelStep {
@Override
public void run() {
// Don't attach the debugger if no run control is provided by the target
- final ILocatorModelPeerNodeQueryService queryService = node.getModel().getService(ILocatorModelPeerNodeQueryService.class);
+ final IPeerModelQueryService queryService = node.getModel().getService(IPeerModelQueryService.class);
Assert.isNotNull(queryService);
- queryService.queryServicesAsync(node, new ILocatorModelPeerNodeQueryService.DoneQueryServices() {
+ queryService.queryServicesAsync(node, new IPeerModelQueryService.DoneQueryServices() {
@Override
public void doneQueryServices(Throwable error) {
if (error == null) {
// Get the list of available remote services
- String remoteServices = node.getStringProperty(IPeerModelProperties.PROP_REMOTE_SERVICES);
+ String remoteServices = node.getStringProperty(IPeerNodeProperties.PROP_REMOTE_SERVICES);
Assert.isNotNull(remoteServices);
boolean canAttachDbg = false;
StringTokenizer tokenizer = new StringTokenizer(remoteServices, ","); //$NON-NLS-1$
@@ -157,7 +157,7 @@ public class StartDebuggerStep extends AbstractPeerModelStep {
*/
@Override
public void rollback(IStepContext context, IPropertiesContainer data, IStatus status, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, ICallback callback) {
- final IPeerModel node = getActivePeerModelContext(context, data, fullQualifiedId);
+ final IPeerNode node = getActivePeerModelContext(context, data, fullQualifiedId);
IDebugService dbgService = ServiceManager.getInstance().getService(node, IDebugService.class, false);
if (dbgService != null) {
IPropertiesContainer props = new PropertiesContainer();
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StartSimulatorStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StartSimulatorStep.java
index cde08c7d6..905d0830e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StartSimulatorStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StartSimulatorStep.java
@@ -21,7 +21,7 @@ import org.eclipse.tcf.te.tcf.locator.utils.SimulatorUtils;
/**
* Start simulator step implementation.
*/
-public class StartSimulatorStep extends AbstractPeerModelStep {
+public class StartSimulatorStep extends AbstractPeerNodeStep {
/**
* Constructor.
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StopDebuggerStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StopDebuggerStep.java
index 3fe928a33..d6ea6557c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StopDebuggerStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StopDebuggerStep.java
@@ -1,55 +1,55 @@
-/*******************************************************************************
- * 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.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.properties.PropertiesContainer;
-import org.eclipse.tcf.te.runtime.services.ServiceManager;
-import org.eclipse.tcf.te.runtime.services.interfaces.IDebugService;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-
-/**
- * Stop debugger step implementation.
- */
-public class StopDebuggerStep extends AbstractPeerModelStep {
-
- /**
- * Constructor.
- */
- public StopDebuggerStep() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IExtendedStep#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(final IStepContext context, final IPropertiesContainer data, final IFullQualifiedId fullQualifiedId, final 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) {
- IDebugService dbgService = ServiceManager.getInstance().getService(getActivePeerModelContext(context, data, fullQualifiedId), IDebugService.class, false);
- if (dbgService != null) {
- IPropertiesContainer props = new PropertiesContainer();
- dbgService.detach(getActivePeerModelContext(context, data, fullQualifiedId), props, monitor, callback);
- }
- else {
- callback.done(this, Status.OK_STATUS);
- }
- }
-}
+/*******************************************************************************
+ * 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.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.properties.PropertiesContainer;
+import org.eclipse.tcf.te.runtime.services.ServiceManager;
+import org.eclipse.tcf.te.runtime.services.interfaces.IDebugService;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
+
+/**
+ * Stop debugger step implementation.
+ */
+public class StopDebuggerStep extends AbstractPeerNodeStep {
+
+ /**
+ * Constructor.
+ */
+ public StopDebuggerStep() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IExtendedStep#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(final IStepContext context, final IPropertiesContainer data, final IFullQualifiedId fullQualifiedId, final 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) {
+ IDebugService dbgService = ServiceManager.getInstance().getService(getActivePeerModelContext(context, data, fullQualifiedId), IDebugService.class, false);
+ if (dbgService != null) {
+ IPropertiesContainer props = new PropertiesContainer();
+ dbgService.detach(getActivePeerModelContext(context, data, fullQualifiedId), props, monitor, callback);
+ }
+ else {
+ callback.done(this, Status.OK_STATUS);
+ }
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StopSimulatorStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StopSimulatorStep.java
index 3edf32507..0f91d460a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StopSimulatorStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StopSimulatorStep.java
@@ -1,45 +1,45 @@
-/*******************************************************************************
- * 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.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-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.utils.SimulatorUtils;
-
-/**
- * Stop simulator step implementation.
- */
-public class StopSimulatorStep extends AbstractPeerModelStep {
-
- /**
- * Constructor.
- */
- public StopSimulatorStep() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IExtendedStep#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(final IStepContext context, final IPropertiesContainer data, final IFullQualifiedId fullQualifiedId, final 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) {
- SimulatorUtils.stop(getActivePeerModelContext(context, data, fullQualifiedId), monitor, callback);
- }
-}
+/*******************************************************************************
+ * 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.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+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.utils.SimulatorUtils;
+
+/**
+ * Stop simulator step implementation.
+ */
+public class StopSimulatorStep extends AbstractPeerNodeStep {
+
+ /**
+ * Constructor.
+ */
+ public StopSimulatorStep() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IExtendedStep#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(final IStepContext context, final IPropertiesContainer data, final IFullQualifiedId fullQualifiedId, final 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) {
+ SimulatorUtils.stop(getActivePeerModelContext(context, data, fullQualifiedId), monitor, callback);
+ }
+}
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 d5e635fe1..f1c79cc7a 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
@@ -27,13 +27,13 @@ import org.eclipse.tcf.te.runtime.utils.ProgressHelper;
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.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
import org.eclipse.tcf.te.tcf.locator.nls.Messages;
/**
* WaitForReadyStep
*/
-public class WaitForReadyStep extends AbstractPeerModelStep {
+public class WaitForReadyStep extends AbstractPeerNodeStep {
/**
* Constructor.
@@ -53,9 +53,9 @@ public class WaitForReadyStep extends AbstractPeerModelStep {
*/
@Override
public void execute(final IStepContext context, final IPropertiesContainer data, final IFullQualifiedId fullQualifiedId, final IProgressMonitor monitor, final ICallback callback) {
- final IPeerModel peerModel = getActivePeerModelContext(context, data, fullQualifiedId);
+ final IPeerNode peerNode = getActivePeerModelContext(context, data, fullQualifiedId);
- if (peerModel != null && !Boolean.getBoolean("WaitForReadyStep.skip")) { //$NON-NLS-1$
+ if (peerNode != null && !Boolean.getBoolean("WaitForReadyStep.skip")) { //$NON-NLS-1$
Protocol.invokeLater(new Runnable() {
final Runnable thisRunnable = this;
int refreshCount = 0;
@@ -71,7 +71,7 @@ public class WaitForReadyStep extends AbstractPeerModelStep {
}
else {
// Try to open a channel to the target and check for errors
- Tcf.getChannelManager().openChannel(peerModel.getPeer(), null, new IChannelManager.DoneOpenChannel() {
+ Tcf.getChannelManager().openChannel(peerNode.getPeer(), null, new IChannelManager.DoneOpenChannel() {
@Override
public void doneOpenChannel(final Throwable error, final IChannel channel) {
if (ProgressHelper.isCancel(WaitForReadyStep.this, monitor, callback)) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/utils/SimulatorUtils.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/utils/SimulatorUtils.java
index c58c09538..e9a3520f8 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/utils/SimulatorUtils.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/utils/SimulatorUtils.java
@@ -23,8 +23,8 @@ import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
import org.eclipse.tcf.te.runtime.services.ServiceManager;
import org.eclipse.tcf.te.runtime.services.interfaces.IService;
import org.eclipse.tcf.te.runtime.services.interfaces.ISimulatorService;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProperties;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties;
/**
* Simulator related utilities.
@@ -43,18 +43,18 @@ public final class SimulatorUtils {
/**
* Returns if or if the given peer model has the simulator enabled or not.
*
- * @param peerModel The peer model node. Must not be <code>null</code>.
+ * @param peerNode The peer model node. Must not be <code>null</code>.
* @return <code>True</code> if the simulator is enabled, <code>false</code> otherwise.
*/
- public static boolean isSimulatorEnabled(final IPeerModel peerModel) {
- Assert.isNotNull(peerModel);
+ public static boolean isSimulatorEnabled(final IPeerNode peerNode) {
+ Assert.isNotNull(peerNode);
final AtomicBoolean isEnabled = new AtomicBoolean(false);
Runnable runnable = new Runnable() {
@Override
public void run() {
- String value = peerModel.getPeer().getAttributes().get(IPeerModelProperties.PROP_SIM_ENABLED);
+ String value = peerNode.getPeer().getAttributes().get(IPeerNodeProperties.PROP_SIM_ENABLED);
if (value != null) {
isEnabled.set(Boolean.parseBoolean(value));
}
@@ -72,11 +72,11 @@ public final class SimulatorUtils {
* If no simulator service is configured in the peer
* or the configured service is not available, <code>null</code> will be returned.
*
- * @param peerModel The peer model node. Must not be <code>null</code>.
+ * @param peerNode The peer model node. Must not be <code>null</code>.
* @return The {@link Result} containing the simulator service and the settings or <code>null</code>.
*/
- public static Result getSimulatorService(final IPeerModel peerModel) {
- Assert.isNotNull(peerModel);
+ public static Result getSimulatorService(final IPeerNode peerNode) {
+ Assert.isNotNull(peerNode);
final AtomicBoolean isEnabled = new AtomicBoolean(false);
final AtomicReference<String> type = new AtomicReference<String>();
@@ -85,13 +85,13 @@ public final class SimulatorUtils {
Runnable runnable = new Runnable() {
@Override
public void run() {
- String value = peerModel.getPeer().getAttributes().get(IPeerModelProperties.PROP_SIM_ENABLED);
+ String value = peerNode.getPeer().getAttributes().get(IPeerNodeProperties.PROP_SIM_ENABLED);
if (value != null) {
isEnabled.set(Boolean.parseBoolean(value));
}
- type.set(peerModel.getPeer().getAttributes().get(IPeerModelProperties.PROP_SIM_TYPE));
- properties.set(peerModel.getPeer().getAttributes().get(IPeerModelProperties.PROP_SIM_PROPERTIES));
+ type.set(peerNode.getPeer().getAttributes().get(IPeerNodeProperties.PROP_SIM_TYPE));
+ properties.set(peerNode.getPeer().getAttributes().get(IPeerNodeProperties.PROP_SIM_PROPERTIES));
}
};
@@ -101,7 +101,7 @@ public final class SimulatorUtils {
Result result = null;
if (isEnabled.get()) {
- IService[] services = ServiceManager.getInstance().getServices(peerModel, ISimulatorService.class, false);
+ IService[] services = ServiceManager.getInstance().getServices(peerNode, ISimulatorService.class, false);
for (IService service : services) {
Assert.isTrue(service instanceof ISimulatorService);
// Get the UI service which is associated with the simulator service
@@ -123,25 +123,25 @@ public final class SimulatorUtils {
* model node and the configured simulator service type is available. In any
* other cases, the given callback is invoked immediately.
*
- * @param peerModel The peer model node. Must not be <code>null</code>.
+ * @param peerNode The peer model node. Must not be <code>null</code>.
* @param monitor The progress monitor.
* @param callback The callback to invoke if finished. Must not be <code>null</code>.
*/
- public static void start(final IPeerModel peerModel, final IProgressMonitor monitor, final ICallback callback) {
- Assert.isNotNull(peerModel);
+ public static void start(final IPeerNode peerNode, final IProgressMonitor monitor, final ICallback callback) {
+ Assert.isNotNull(peerNode);
Assert.isNotNull(callback);
// Determine if we have to start a simulator first
- final Result result = getSimulatorService(peerModel);
+ final Result result = getSimulatorService(peerNode);
if (result != null && result.service != null) {
// Check if the simulator is already running
- result.service.isRunning(peerModel, result.settings, new Callback() {
+ result.service.isRunning(peerNode, result.settings, new Callback() {
@Override
protected void internalDone(Object caller, IStatus status) {
Object cbResult = getResult();
if (cbResult instanceof Boolean && !((Boolean)cbResult).booleanValue()) {
// Start the simulator
- result.service.start(peerModel, result.settings, new Callback() {
+ result.service.start(peerNode, result.settings, new Callback() {
@Override
protected void internalDone(Object caller, IStatus status) {
callback.setResult(new Boolean(status.isOK()));
@@ -165,25 +165,25 @@ public final class SimulatorUtils {
* model node and the configured simulator service type is available. In any
* other cases, the given callback is invoked immediately.
*
- * @param peerModel The peer model node. Must not be <code>null</code>.
+ * @param peerNode The peer model node. Must not be <code>null</code>.
* @param monitor The progress monitor.
* @param callback The callback to invoke if finished. Must not be <code>null</code>.
*/
- public static void stop(final IPeerModel peerModel, final IProgressMonitor monitor, final ICallback callback) {
- Assert.isNotNull(peerModel);
+ public static void stop(final IPeerNode peerNode, final IProgressMonitor monitor, final ICallback callback) {
+ Assert.isNotNull(peerNode);
Assert.isNotNull(callback);
// Get the associated simulator service
- final Result result = getSimulatorService(peerModel);
+ final Result result = getSimulatorService(peerNode);
if (result != null && result.service != null) {
// Determine if the simulator is at all running
- result.service.isRunning(peerModel, result.settings, new Callback() {
+ result.service.isRunning(peerNode, result.settings, new Callback() {
@Override
protected void internalDone(Object caller, IStatus status) {
Object cbResult = getResult();
if (cbResult instanceof Boolean && ((Boolean)cbResult).booleanValue()) {
// Stop the simulator
- result.service.stop(peerModel, result.settings, new Callback(callback) {
+ result.service.stop(peerNode, result.settings, new Callback(callback) {
@Override
protected void internalDone(Object caller, IStatus status) {
callback.done(caller, status);
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 aed90e597..855302f66 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
@@ -1,121 +1,121 @@
-/*******************************************************************************
- * 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.processes.core.activator;
-
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.runtime.tracing.TraceHandler;
-import org.eclipse.tcf.te.tcf.locator.interfaces.IModelListener;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel;
-import org.eclipse.tcf.te.tcf.locator.model.Model;
-import org.eclipse.tcf.te.tcf.processes.core.model.listener.ModelListener;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class CoreBundleActivator extends Plugin {
- // The bundle context
- private static BundleContext context;
- // The trace handler instance
- private static volatile TraceHandler traceHandler;
- // The locator model listener instance
- /* default */ IModelListener listener;
-
- // The shared instance
- private static CoreBundleActivator plugin;
-
- /**
- * Returns the bundle context
- *
- * @return the bundle context
- */
- public static BundleContext getContext() {
- return context;
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static CoreBundleActivator getDefault() {
- return plugin;
- }
-
- /**
- * Convenience method which returns the unique identifier of this plugin.
- */
- public static String getUniqueIdentifier() {
- if (getContext() != null && getContext().getBundle() != null) {
- return getContext().getBundle().getSymbolicName();
- }
- return "org.eclipse.tcf.te.tcf.processes.core"; //$NON-NLS-1$
- }
-
- /**
- * Returns the bundles trace handler.
- *
- * @return The bundles trace handler.
- */
- public static TraceHandler getTraceHandler() {
- if (traceHandler == null) {
- traceHandler = new TraceHandler(getUniqueIdentifier());
- }
- return traceHandler;
- }
-
- /* (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
- */
- @Override
- public void start(BundleContext bundleContext) throws Exception {
- CoreBundleActivator.context = bundleContext;
- plugin = this;
-
- // Create the model listener instance
- listener = new ModelListener();
-
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- if (listener == null) return;
- // Register the model listener with the locator model
- Model.getModel().addListener(listener);
- }
- };
-
- Protocol.invokeLater(runnable);
- }
-
- /* (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
- */
- @Override
- public void stop(BundleContext bundleContext) throws Exception {
- CoreBundleActivator.context = null;
- plugin = null;
-
- // Remove the model listener from the locator model
- if (listener != null) {
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- ILocatorModel model = Model.getModel(true);
- if (model != null) model.removeListener(listener);
- listener = null;
- }
- };
- if (Protocol.isDispatchThread()) runnable.run();
- else Protocol.invokeAndWait(runnable);
- }
- }
-
-}
+/*******************************************************************************
+ * 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.processes.core.activator;
+
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.te.runtime.tracing.TraceHandler;
+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.model.Model;
+import org.eclipse.tcf.te.tcf.processes.core.model.listener.ModelListener;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class CoreBundleActivator extends Plugin {
+ // The bundle context
+ private static BundleContext context;
+ // The trace handler instance
+ private static volatile TraceHandler traceHandler;
+ // The locator model listener instance
+ /* default */ IModelListener listener;
+
+ // The shared instance
+ private static CoreBundleActivator plugin;
+
+ /**
+ * Returns the bundle context
+ *
+ * @return the bundle context
+ */
+ public static BundleContext getContext() {
+ return context;
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static CoreBundleActivator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Convenience method which returns the unique identifier of this plugin.
+ */
+ public static String getUniqueIdentifier() {
+ if (getContext() != null && getContext().getBundle() != null) {
+ return getContext().getBundle().getSymbolicName();
+ }
+ return "org.eclipse.tcf.te.tcf.processes.core"; //$NON-NLS-1$
+ }
+
+ /**
+ * Returns the bundles trace handler.
+ *
+ * @return The bundles trace handler.
+ */
+ public static TraceHandler getTraceHandler() {
+ if (traceHandler == null) {
+ traceHandler = new TraceHandler(getUniqueIdentifier());
+ }
+ return traceHandler;
+ }
+
+ /* (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start(BundleContext bundleContext) throws Exception {
+ CoreBundleActivator.context = bundleContext;
+ plugin = this;
+
+ // Create the model listener instance
+ listener = new ModelListener();
+
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ if (listener == null) return;
+ // Register the model listener with the locator model
+ Model.getModel().addListener(listener);
+ }
+ };
+
+ Protocol.invokeLater(runnable);
+ }
+
+ /* (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(BundleContext bundleContext) throws Exception {
+ CoreBundleActivator.context = null;
+ plugin = null;
+
+ // Remove the model listener from the locator model
+ if (listener != null) {
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ IPeerModel model = Model.getModel(true);
+ if (model != null) model.removeListener(listener);
+ listener = null;
+ }
+ };
+ if (Protocol.isDispatchThread()) runnable.run();
+ else Protocol.invokeAndWait(runnable);
+ }
+ }
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/ModelManager.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/ModelManager.java
index e323927ef..ac5850b73 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/ModelManager.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/ModelManager.java
@@ -15,7 +15,7 @@ import java.util.concurrent.atomic.AtomicReference;
import org.eclipse.core.runtime.Assert;
import org.eclipse.tcf.protocol.Protocol;
-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.processes.core.model.interfaces.runtime.IRuntimeModel;
import org.eclipse.tcf.te.tcf.processes.core.model.runtime.RuntimeModel;
@@ -31,11 +31,11 @@ public class ModelManager {
* <p>
* If not yet initialized, a new runtime model will be initialized before returning.
*
- * @param peerModel The peer model instance. Must not be <code>null</code>.
+ * @param peerNode The peer model instance. Must not be <code>null</code>.
* @return The runtime model.
*/
- public static IRuntimeModel getRuntimeModel(final IPeerModel peerModel) {
- Assert.isNotNull(peerModel);
+ public static IRuntimeModel getRuntimeModel(final IPeerNode peerNode) {
+ Assert.isNotNull(peerNode);
// The result reference holder
final AtomicReference<IRuntimeModel> runtimeModel = new AtomicReference<IRuntimeModel>();
@@ -47,12 +47,12 @@ public class ModelManager {
Assert.isTrue(Protocol.isDispatchThread());
// Get the peer id
- String id = peerModel.getPeerId();
+ String id = peerNode.getPeerId();
// Lookup the runtime model instance
IRuntimeModel candidate = runtimeModels.get(id);
// Initialize a new runtime model instance if necessary
if (candidate == null) {
- candidate = initializeRuntimeModel(peerModel);
+ candidate = initializeRuntimeModel(peerNode);
if (candidate != null) runtimeModels.put(id, candidate);
}
// Store to the result reference holder
@@ -72,22 +72,22 @@ public class ModelManager {
* <p>
* Must be called within the TCF dispatch thread.
*
- * @param peerModel The peer model instance. Must not be <code>null</code>.
+ * @param peerNode The peer model instance. Must not be <code>null</code>.
* @return The runtime model.
*/
- protected static IRuntimeModel initializeRuntimeModel(IPeerModel peerModel) {
+ protected static IRuntimeModel initializeRuntimeModel(IPeerNode peerNode) {
Assert.isTrue(Protocol.isDispatchThread());
- IRuntimeModel runtimeModel = new RuntimeModel(peerModel);
+ IRuntimeModel runtimeModel = new RuntimeModel(peerNode);
return runtimeModel;
}
/**
* Dispose the runtime model.
*
- * @param peerModel The peer model instance. Must not be <code>null</code>.
+ * @param peerNode The peer model instance. Must not be <code>null</code>.
*/
- public static void disposeRuntimeModel(final IPeerModel peerModel) {
- Assert.isNotNull(peerModel);
+ public static void disposeRuntimeModel(final IPeerNode peerNode) {
+ Assert.isNotNull(peerNode);
Runnable runnable = new Runnable() {
@Override
@@ -95,7 +95,7 @@ public class ModelManager {
Assert.isTrue(Protocol.isDispatchThread());
// Get the peer id
- String id = peerModel.getPeerId();
+ String id = peerNode.getPeerId();
// Lookup the runtime model instance
IRuntimeModel candidate = runtimeModels.remove(id);
// Dispose it
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/interfaces/runtime/IRuntimeModel.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/interfaces/runtime/IRuntimeModel.java
index a4c7fa33c..202fb645d 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/interfaces/runtime/IRuntimeModel.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/interfaces/runtime/IRuntimeModel.java
@@ -10,7 +10,7 @@
package org.eclipse.tcf.te.tcf.processes.core.model.interfaces.runtime;
import org.eclipse.tcf.te.tcf.core.model.interfaces.IModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProvider;
/**
@@ -22,7 +22,7 @@ import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider;
* <p>
* All model access must happen in the TCF dispatch thread.
*/
-public interface IRuntimeModel extends IModel, IPeerModelProvider {
+public interface IRuntimeModel extends IModel, IPeerNodeProvider {
/**
* Set the auto-refresh interval in seconds.
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/listener/ModelListener.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/listener/ModelListener.java
index e5d979468..216609e9d 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/listener/ModelListener.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/listener/ModelListener.java
@@ -11,8 +11,8 @@ package org.eclipse.tcf.te.tcf.processes.core.model.listener;
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.nodes.IPeerNode;
import org.eclipse.tcf.te.tcf.locator.listener.ModelAdapter;
import org.eclipse.tcf.te.tcf.processes.core.model.ModelManager;
@@ -22,10 +22,10 @@ import org.eclipse.tcf.te.tcf.processes.core.model.ModelManager;
public class ModelListener extends ModelAdapter {
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.listener.ModelAdapter#locatorModelChanged(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel, org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel, boolean)
+ * @see org.eclipse.tcf.te.tcf.locator.listener.ModelAdapter#locatorModelChanged(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel, org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode, boolean)
*/
@Override
- public void locatorModelChanged(ILocatorModel model, IPeerModel peer, boolean added) {
+ public void locatorModelChanged(IPeerModel model, IPeerNode peer, boolean added) {
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
if (peer == null) return;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/nodes/ProcessContextNode.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/nodes/ProcessContextNode.java
index 0dc33b65f..2bf003277 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/nodes/ProcessContextNode.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/nodes/ProcessContextNode.java
@@ -25,15 +25,15 @@ import org.eclipse.tcf.te.runtime.model.interfaces.contexts.IAsyncRefreshableCtx
import org.eclipse.tcf.te.runtime.model.interfaces.contexts.IAsyncRefreshableCtx.QueryState;
import org.eclipse.tcf.te.runtime.model.interfaces.contexts.IAsyncRefreshableCtx.QueryType;
import org.eclipse.tcf.te.tcf.core.model.interfaces.IModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProvider;
import org.eclipse.tcf.te.tcf.processes.core.model.interfaces.IProcessContextNode;
import org.eclipse.tcf.te.tcf.processes.core.model.interfaces.IProcessContextNodeProperties;
/**
* A process context node implementation.
*/
-public class ProcessContextNode extends ContainerModelNode implements IProcessContextNode, IPeerModelProvider, IFilterable {
+public class ProcessContextNode extends ContainerModelNode implements IProcessContextNode, IPeerNodeProvider, IFilterable {
// Reference to the agent side process context object
private IProcesses.ProcessContext pContext = null;
// Reference to the agent side system monitor context object
@@ -156,11 +156,11 @@ public class ProcessContextNode extends ContainerModelNode implements IProcessCo
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider#getPeerModel()
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProvider#getPeerModel()
*/
@Override
- public IPeerModel getPeerModel() {
- return (IPeerModel)getAdapter(IPeerModel.class);
+ public IPeerNode getPeerModel() {
+ return (IPeerNode)getAdapter(IPeerNode.class);
}
/* (non-Javadoc)
@@ -224,13 +224,13 @@ public class ProcessContextNode extends ContainerModelNode implements IProcessCo
if (ISysMonitor.SysMonitorContext.class.isAssignableFrom(adapter)) {
return sContext;
}
- if (IPeerModelProvider.class.isAssignableFrom(adapter)) {
+ if (IPeerNodeProvider.class.isAssignableFrom(adapter)) {
IModel model = getParent(IModel.class);
- if (model instanceof IPeerModelProvider) return model;
+ if (model instanceof IPeerNodeProvider) return model;
}
- if (IPeerModel.class.isAssignableFrom(adapter)) {
+ if (IPeerNode.class.isAssignableFrom(adapter)) {
IModel model = getParent(IModel.class);
- if (model instanceof IPeerModelProvider) return ((IPeerModelProvider)model).getPeerModel();
+ if (model instanceof IPeerNodeProvider) return ((IPeerNodeProvider)model).getPeerModel();
}
if (IAsyncRefreshableCtx.class.isAssignableFrom(adapter)) {
return refreshableCtxAdapter;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/RuntimeModel.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/RuntimeModel.java
index 384a785bd..5bccafe5a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/RuntimeModel.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/RuntimeModel.java
@@ -29,7 +29,7 @@ import org.eclipse.tcf.te.tcf.core.model.interfaces.services.IModelLookupService
import org.eclipse.tcf.te.tcf.core.model.interfaces.services.IModelRefreshService;
import org.eclipse.tcf.te.tcf.core.model.interfaces.services.IModelService;
import org.eclipse.tcf.te.tcf.core.model.interfaces.services.IModelUpdateService;
-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.processes.core.model.interfaces.runtime.IRuntimeModel;
import org.eclipse.tcf.te.tcf.processes.core.model.interfaces.runtime.IRuntimeModelLookupService;
import org.eclipse.tcf.te.tcf.processes.core.model.interfaces.runtime.IRuntimeModelRefreshService;
@@ -51,7 +51,7 @@ public final class RuntimeModel extends ContainerModelNode implements IRuntimeMo
private IFactory factory = null;
// Reference to the associated peer model
- private final IPeerModel peerModel;
+ private final IPeerNode peerNode;
// Reference to the refresh service
private final IRuntimeModelRefreshService refreshService = new RuntimeModelRefreshService(this);
@@ -73,17 +73,17 @@ public final class RuntimeModel extends ContainerModelNode implements IRuntimeMo
/**
* Constructor.
*
- * @param peerModel The peerModel to associated. Must not be <code>null</code>.
+ * @param peerNode The peerNode to associated. Must not be <code>null</code>.
*/
- public RuntimeModel(IPeerModel peerModel) {
+ public RuntimeModel(IPeerNode peerNode) {
super();
disposed = false;
setChangeEventsEnabled(true);
suppressEventsOnNullParent = false;
- Assert.isNotNull(peerModel);
- this.peerModel = peerModel;
+ Assert.isNotNull(peerNode);
+ this.peerNode = peerNode;
// No initial context query required
refreshableCtxAdapter.setQueryState(QueryType.CONTEXT, QueryState.DONE);
@@ -180,12 +180,12 @@ public final class RuntimeModel extends ContainerModelNode implements IRuntimeMo
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider#getPeerModel()
+ * @see org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProvider#getPeerModel()
*/
@Override
- public IPeerModel getPeerModel() {
+ public IPeerNode getPeerModel() {
Assert.isTrue(checkThreadAccess(), "Illegal Thread Access"); //$NON-NLS-1$
- return peerModel;
+ return peerNode;
}
/* (non-Javadoc)
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelChannelService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelChannelService.java
index 7ed2fdf3d..14f2887e0 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelChannelService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelChannelService.java
@@ -19,7 +19,7 @@ import org.eclipse.tcf.te.tcf.core.Tcf;
import org.eclipse.tcf.te.tcf.core.interfaces.IChannelManager;
import org.eclipse.tcf.te.tcf.core.model.interfaces.services.IModelChannelService;
import org.eclipse.tcf.te.tcf.core.model.services.AbstractModelService;
-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.processes.core.model.interfaces.runtime.IRuntimeModel;
import org.eclipse.tcf.te.tcf.processes.core.model.runtime.listener.RuntimeModelProcessServiceListener;
import org.eclipse.tcf.te.tcf.processes.core.model.runtime.listener.RuntimeModelRunControlServiceListener;
@@ -67,7 +67,7 @@ public class RuntimeModelChannelService extends AbstractModelService<IRuntimeMod
}
// Get the peer model node
- IPeerModel node = getModel().getPeerModel();
+ IPeerNode node = getModel().getPeerModel();
if (node != null) {
// Open a new channel to the remote peer
Tcf.getChannelManager().openChannel(node.getPeer(), null, new IChannelManager.DoneOpenChannel() {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/steps/AttachStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/steps/AttachStep.java
index c417374e9..4a0ee4ffe 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/steps/AttachStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/steps/AttachStep.java
@@ -38,7 +38,7 @@ 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.model.interfaces.IModel;
import org.eclipse.tcf.te.tcf.core.model.interfaces.services.IModelRefreshService;
-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.processes.core.activator.CoreBundleActivator;
import org.eclipse.tcf.te.tcf.processes.core.interfaces.IContextHelpIds;
import org.eclipse.tcf.te.tcf.processes.core.model.interfaces.IProcessContextNode;
@@ -54,20 +54,20 @@ public class AttachStep {
* <p>
* <b>Note:</b> This method must be called from within the TCF dispatch thread.
*
- * @param peerModel The peer model. Must not be <code>null</code>.
+ * @param peerNode The peer model. Must not be <code>null</code>.
* @param nodes The list of process context nodes. Must not be <code>null</code>.
* @param callback The callback to invoke once the operation completed, or<code>null</code>.
*/
- public void executeAttach(final IPeerModel peerModel, final IProcessContextNode[] nodes, final ICallback callback) {
+ public void executeAttach(final IPeerNode peerNode, final IProcessContextNode[] nodes, final ICallback callback) {
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- Assert.isNotNull(peerModel);
+ Assert.isNotNull(peerNode);
Assert.isNotNull(nodes);
// Determine if we have to execute the attach at all
final List<IProcessContextNode> nodesToAttach = new ArrayList<IProcessContextNode>();
for (IProcessContextNode node : nodes) {
- IPeerModel parentPeerModel = (IPeerModel)node.getAdapter(IPeerModel.class);
- if (!peerModel.equals(parentPeerModel)) continue;
+ IPeerNode parentPeerModel = (IPeerNode)node.getAdapter(IPeerNode.class);
+ if (!peerNode.equals(parentPeerModel)) continue;
// If not yet attached, we have to attach to it
if (node.getProcessContext() != null && !node.getProcessContext().isAttached()) {
@@ -78,17 +78,17 @@ public class AttachStep {
// Anything to attach?
if (!nodesToAttach.isEmpty()) {
// Determine the debug service to attach to the peer node
- IDebugService dbgService = ServiceManager.getInstance().getService(peerModel, IDebugService.class, false);
+ IDebugService dbgService = ServiceManager.getInstance().getService(peerNode, IDebugService.class, false);
if (dbgService != null) {
// Attach to the peer node first
- dbgService.attach(peerModel, new PropertiesContainer(), null, new Callback() {
+ dbgService.attach(peerNode, new PropertiesContainer(), null, new Callback() {
@Override
protected void internalDone(Object caller, IStatus status) {
callback.setProperty("launch", getProperty("launch")); //$NON-NLS-1$ //$NON-NLS-2$
Runnable runnable = new Runnable() {
@Override
public void run() {
- doAttach(peerModel, Collections.unmodifiableList(nodesToAttach), callback);
+ doAttach(peerNode, Collections.unmodifiableList(nodesToAttach), callback);
}
};
if (Protocol.isDispatchThread()) runnable.run();
@@ -96,7 +96,7 @@ public class AttachStep {
}
});
} else {
- doAttach(peerModel, Collections.unmodifiableList(nodesToAttach), callback);
+ doAttach(peerNode, Collections.unmodifiableList(nodesToAttach), callback);
}
} else {
onDone(callback);
@@ -109,19 +109,19 @@ public class AttachStep {
* <p>
* <b>Note:</b> This method must be called from within the TCF dispatch thread.
*
- * @param peerModel The peer model. Must not be <code>null</code>.
+ * @param peerNode The peer model. Must not be <code>null</code>.
* @param nodes The process context node. Must not be <code>null</code>.
* @param callback The callback to invoke once the operation completed, or<code>null</code>.
*/
- protected void doAttach(final IPeerModel peerModel, final List<IProcessContextNode> nodes, final ICallback callback) {
+ protected void doAttach(final IPeerNode peerNode, final List<IProcessContextNode> nodes, final ICallback callback) {
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- Assert.isNotNull(peerModel);
+ Assert.isNotNull(peerNode);
Assert.isNotNull(nodes);
// Loop the nodes and attach to them
if (!nodes.isEmpty()) {
// Open a channel
- Tcf.getChannelManager().openChannel(peerModel.getPeer(), null, new IChannelManager.DoneOpenChannel() {
+ Tcf.getChannelManager().openChannel(peerNode.getPeer(), null, new IChannelManager.DoneOpenChannel() {
@Override
public void doneOpenChannel(final Throwable error, final IChannel channel) {
if (error == null) {
@@ -132,7 +132,7 @@ public class AttachStep {
@Override
protected void internalDone(Object caller, IStatus status) {
if (status.getSeverity() == IStatus.ERROR) {
- onError(peerModel, status.getMessage(), status.getException(), callback);
+ onError(peerNode, status.getMessage(), status.getException(), callback);
} else {
onDone(callback);
}
@@ -177,10 +177,10 @@ public class AttachStep {
// Mark the collector initialization done
collector.initDone();
} else {
- onError(peerModel, NLS.bind(Messages.AttachStep_error_missingService, peerModel.getName()), null, callback);
+ onError(peerNode, NLS.bind(Messages.AttachStep_error_missingService, peerNode.getName()), null, callback);
}
} else {
- onError(peerModel, NLS.bind(Messages.AttachStep_error_openChannel, peerModel.getName()), error, callback);
+ onError(peerNode, NLS.bind(Messages.AttachStep_error_openChannel, peerNode.getName()), error, callback);
}
}
});
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/steps/DetachStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/steps/DetachStep.java
index 3d43b7a1a..9313cea9f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/steps/DetachStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/steps/DetachStep.java
@@ -30,7 +30,7 @@ import org.eclipse.tcf.te.tcf.core.Tcf;
import org.eclipse.tcf.te.tcf.core.interfaces.IChannelManager;
import org.eclipse.tcf.te.tcf.core.model.interfaces.IModel;
import org.eclipse.tcf.te.tcf.core.model.interfaces.services.IModelRefreshService;
-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.processes.core.activator.CoreBundleActivator;
import org.eclipse.tcf.te.tcf.processes.core.interfaces.IContextHelpIds;
import org.eclipse.tcf.te.tcf.processes.core.model.interfaces.IProcessContextNode;
@@ -55,7 +55,7 @@ public class DetachStep {
// If the context is not attached, there is nothing to do
if (node.getProcessContext() != null && node.getProcessContext().isAttached()) {
- IPeerModel peerNode = (IPeerModel)node.getAdapter(IPeerModel.class);
+ IPeerNode peerNode = (IPeerNode)node.getAdapter(IPeerNode.class);
if (peerNode != null) {
doDetach(node, callback);
} else {
@@ -84,7 +84,7 @@ public class DetachStep {
Assert.isNotNull(node);
// Determine the peer model node
- final IPeerModel peerNode = (IPeerModel)node.getAdapter(IPeerModel.class);
+ final IPeerNode peerNode = (IPeerNode)node.getAdapter(IPeerNode.class);
// Open a channel
Tcf.getChannelManager().openChannel(peerNode.getPeer(), null, new IChannelManager.DoneOpenChannel() {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/steps/TerminateStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/steps/TerminateStep.java
index c3534d7ff..d5bc4f9c8 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/steps/TerminateStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/steps/TerminateStep.java
@@ -27,7 +27,7 @@ import org.eclipse.tcf.te.runtime.statushandler.interfaces.IStatusHandler;
import org.eclipse.tcf.te.runtime.statushandler.interfaces.IStatusHandlerConstants;
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.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
import org.eclipse.tcf.te.tcf.processes.core.activator.CoreBundleActivator;
import org.eclipse.tcf.te.tcf.processes.core.interfaces.IContextHelpIds;
import org.eclipse.tcf.te.tcf.processes.core.model.interfaces.IProcessContextNode;
@@ -52,7 +52,7 @@ public class TerminateStep {
// If the context is not attached, there is nothing to do
if (node.getProcessContext() != null) {
- IPeerModel peerNode = (IPeerModel)node.getAdapter(IPeerModel.class);
+ IPeerNode peerNode = (IPeerNode)node.getAdapter(IPeerNode.class);
if (peerNode != null) {
doTerminate(node, callback);
} else {
@@ -78,7 +78,7 @@ public class TerminateStep {
Assert.isNotNull(node);
// Determine the peer model node
- final IPeerModel peerNode = (IPeerModel)node.getAdapter(IPeerModel.class);
+ final IPeerNode peerNode = (IPeerNode)node.getAdapter(IPeerNode.class);
// Open a channel
Tcf.getChannelManager().openChannel(peerNode.getPeer(), null, new IChannelManager.DoneOpenChannel() {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/plugin.xml
index 0d976fc89..ae462b3cc 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/plugin.xml
@@ -8,7 +8,7 @@
adaptableType="org.eclipse.tcf.te.tcf.processes.core.model.interfaces.IProcessContextNode"
class="org.eclipse.tcf.te.tcf.processes.ui.internal.adapters.AdapterFactory">
<adapter type="org.eclipse.jface.viewers.ILabelProvider"/>
- <adapter type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
+ <adapter type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode"/>
<adapter type="org.eclipse.tcf.te.ui.interfaces.ISearchable"/>
</factory>
@@ -56,7 +56,7 @@
id="org.eclipse.tcf.te.tcf.processes.ui.properties"
namespace="processMonitor.delegatedActivation"
properties="isColumnActive,isFilterActive"
- type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode">
</propertyTester>
</extension>
@@ -86,7 +86,7 @@
<or>
<and>
<reference definitionId="te.expressions.IConnectable.connected"/>
- <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
+ <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode"/>
<and>
<test property="org.eclipse.tcf.te.tcf.locator.hasRemoteService" value="Processes"/>
<test property="org.eclipse.tcf.te.tcf.locator.hasRemoteService" value="SysMonitor"/>
@@ -154,7 +154,7 @@
<enablement>
<with variable="activeEditorInput">
<reference definitionId="te.expressions.IConnectable.connected"/>
- <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode">
<and>
<test property="org.eclipse.tcf.te.tcf.locator.hasRemoteService" value="Processes"/>
<test property="org.eclipse.tcf.te.tcf.locator.hasRemoteService" value="SysMonitor"/>
@@ -182,7 +182,7 @@
<iterate operator="and" ifEmpty="false">
<and>
<instanceof value="org.eclipse.tcf.te.tcf.processes.core.model.interfaces.IProcessContextNode"/>
- <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode">
<test
forcePluginActivation="true"
property="org.eclipse.tcf.te.runtime.services.hasService"
@@ -208,7 +208,7 @@
<iterate operator="and" ifEmpty="false">
<and>
<instanceof value="org.eclipse.tcf.te.tcf.processes.core.model.interfaces.IProcessContextNode"/>
- <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode">
<test
forcePluginActivation="true"
property="org.eclipse.tcf.te.runtime.services.hasService"
@@ -459,7 +459,7 @@
<count value="+"/>
<iterate operator="and" ifEmpty="false">
<instanceof value="org.eclipse.tcf.te.tcf.processes.core.model.interfaces.IProcessContextNode"/>
- <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode">
<test
forcePluginActivation="true"
property="org.eclipse.tcf.te.runtime.services.hasService"
@@ -500,7 +500,7 @@
<count value="+"/>
<iterate operator="and" ifEmpty="false">
<instanceof value="org.eclipse.tcf.te.tcf.processes.core.model.interfaces.IProcessContextNode"/>
- <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode">
<test
forcePluginActivation="true"
property="org.eclipse.tcf.te.runtime.services.hasService"
@@ -641,7 +641,7 @@
width="250">
<activation>
<with variable="input">
- <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode">
<test property="processMonitor.delegatedActivation.isColumnActive" args="name" value="true"/>
</adapt>
</with>
@@ -657,7 +657,7 @@
width="50">
<activation>
<with variable="input">
- <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode">
<test property="processMonitor.delegatedActivation.isColumnActive" args="PID" value="true"/>
</adapt>
</with>
@@ -673,7 +673,7 @@
width="50">
<activation>
<with variable="input">
- <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode">
<test property="processMonitor.delegatedActivation.isColumnActive" args="PPID" value="true"/>
</adapt>
</with>
@@ -689,7 +689,7 @@
width="50">
<activation>
<with variable="input">
- <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode">
<test property="processMonitor.delegatedActivation.isColumnActive" args="state" value="true"/>
</adapt>
</with>
@@ -705,7 +705,7 @@
width="50">
<activation>
<with variable="input">
- <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode">
<test property="processMonitor.delegatedActivation.isColumnActive" args="user" value="true"/>
</adapt>
</with>
@@ -721,7 +721,7 @@
width="100">
<activation>
<with variable="input">
- <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode">
<test property="processMonitor.delegatedActivation.isColumnActive" args="cmdline" value="true"/>
</adapt>
</with>
@@ -738,7 +738,7 @@
name="%singlethreadfilter.name">
<activation>
<with variable="input">
- <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode">
<test property="processMonitor.delegatedActivation.isFilterActive" args="singleThread" value="true"/>
</adapt>
</with>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/editor/ProcessMonitorEditorPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/editor/ProcessMonitorEditorPage.java
index 27ec2b409..8e6aca1a1 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/editor/ProcessMonitorEditorPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/editor/ProcessMonitorEditorPage.java
@@ -20,7 +20,7 @@ import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.TreeColumn;
import org.eclipse.tcf.te.runtime.events.ChangeEvent;
import org.eclipse.tcf.te.runtime.events.EventManager;
-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.processes.core.model.ModelManager;
import org.eclipse.tcf.te.tcf.processes.ui.navigator.events.TreeViewerListener;
import org.eclipse.tcf.te.tcf.processes.ui.nls.Messages;
@@ -176,10 +176,10 @@ public class ProcessMonitorEditorPage extends TreeViewerExplorerEditorPage {
@Override
protected Object getViewerInput() {
Object element = getEditorInputNode();
- IPeerModel peerModel = element instanceof IPeerModel ? (IPeerModel)element : null;
- if (peerModel == null && element instanceof IAdaptable) {
- peerModel = (IPeerModel)((IAdaptable)element).getAdapter(IPeerModel.class);
+ IPeerNode peerNode = element instanceof IPeerNode ? (IPeerNode)element : null;
+ if (peerNode == null && element instanceof IAdaptable) {
+ peerNode = (IPeerNode)((IAdaptable)element).getAdapter(IPeerNode.class);
}
- return peerModel != null ? ModelManager.getRuntimeModel(peerModel) : null;
+ return peerNode != null ? ModelManager.getRuntimeModel(peerNode) : null;
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/editor/tree/ContentProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/editor/tree/ContentProvider.java
index e854ae43b..c579540df 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/editor/tree/ContentProvider.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/editor/tree/ContentProvider.java
@@ -10,7 +10,7 @@
package org.eclipse.tcf.te.tcf.processes.ui.editor.tree;
import org.eclipse.jface.viewers.Viewer;
-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.processes.core.model.ModelManager;
import org.eclipse.tcf.te.tcf.processes.core.model.interfaces.runtime.IRuntimeModel;
@@ -19,15 +19,15 @@ import org.eclipse.tcf.te.tcf.processes.core.model.interfaces.runtime.IRuntimeMo
*/
public class ContentProvider extends org.eclipse.tcf.te.tcf.processes.ui.navigator.runtime.ContentProvider {
// The target's peer model.
- private IPeerModel peerModel;
+ private IPeerNode peerNode;
/* (non-Javadoc)
* @see org.eclipse.tcf.te.tcf.processes.ui.navigator.runtime.ContentProvider#dispose()
*/
@Override
public void dispose() {
- if (peerModel != null) {
- IRuntimeModel model = ModelManager.getRuntimeModel(peerModel);
+ if (peerNode != null) {
+ IRuntimeModel model = ModelManager.getRuntimeModel(peerNode);
if (model != null && model.getAutoRefreshInterval() > 0) {
// If the model is auto refreshing, then stop it when the editor is disposed.
model.setAutoRefreshInterval(0);
@@ -41,8 +41,8 @@ public class ContentProvider extends org.eclipse.tcf.te.tcf.processes.ui.navigat
@Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
super.inputChanged(viewer, oldInput, newInput);
- if (newInput instanceof IPeerModel) {
- peerModel = (IPeerModel) newInput;
+ if (newInput instanceof IPeerNode) {
+ peerNode = (IPeerNode) newInput;
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/editor/tree/columns/PIDLabelProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/editor/tree/columns/PIDLabelProvider.java
index 3a65a5bdd..c1a12491e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/editor/tree/columns/PIDLabelProvider.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/editor/tree/columns/PIDLabelProvider.java
@@ -15,7 +15,7 @@ import org.eclipse.core.runtime.Assert;
import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.te.runtime.services.ServiceManager;
import org.eclipse.tcf.te.runtime.services.interfaces.IUIService;
-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.processes.core.model.interfaces.IPendingOperationNode;
import org.eclipse.tcf.te.tcf.processes.core.model.interfaces.IProcessContextNode;
import org.eclipse.tcf.te.tcf.processes.core.model.interfaces.runtime.IRuntimeModel;
@@ -55,9 +55,9 @@ public class PIDLabelProvider extends AbstractLabelProviderDelegate {
String id = pid.get() >= 0 ? Long.toString(pid.get()) : ""; //$NON-NLS-1$
if (id.startsWith("P")) id = id.substring(1); //$NON-NLS-1$
- IPeerModel peerModel = (IPeerModel)node.getAdapter(IPeerModel.class);
- IUIService service = peerModel != null ? ServiceManager.getInstance().getService(peerModel, IUIService.class) : null;
- IProcessMonitorUIDelegate delegate = service != null ? service.getDelegate(peerModel, IProcessMonitorUIDelegate.class) : null;
+ IPeerNode peerNode = (IPeerNode)node.getAdapter(IPeerNode.class);
+ IUIService service = peerNode != null ? ServiceManager.getInstance().getService(peerNode, IUIService.class) : null;
+ IProcessMonitorUIDelegate delegate = service != null ? service.getDelegate(peerNode, IProcessMonitorUIDelegate.class) : null;
String newId = delegate != null ? delegate.getText(element, "PID", id) : null; //$NON-NLS-1$
return newId != null ? newId : id;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/editor/tree/columns/PPIDLabelProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/editor/tree/columns/PPIDLabelProvider.java
index 184cad8c5..2cb8a8769 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/editor/tree/columns/PPIDLabelProvider.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/editor/tree/columns/PPIDLabelProvider.java
@@ -15,7 +15,7 @@ import org.eclipse.core.runtime.Assert;
import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.te.runtime.services.ServiceManager;
import org.eclipse.tcf.te.runtime.services.interfaces.IUIService;
-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.processes.core.model.interfaces.IPendingOperationNode;
import org.eclipse.tcf.te.tcf.processes.core.model.interfaces.IProcessContextNode;
import org.eclipse.tcf.te.tcf.processes.core.model.interfaces.runtime.IRuntimeModel;
@@ -53,9 +53,9 @@ public class PPIDLabelProvider extends AbstractLabelProviderDelegate {
String id = ppid.get() >= 0 ? Long.toString(ppid.get()) : ""; //$NON-NLS-1$
- IPeerModel peerModel = (IPeerModel)node.getAdapter(IPeerModel.class);
- IUIService service = peerModel != null ? ServiceManager.getInstance().getService(peerModel, IUIService.class) : null;
- IProcessMonitorUIDelegate delegate = service != null ? service.getDelegate(peerModel, IProcessMonitorUIDelegate.class) : null;
+ IPeerNode peerNode = (IPeerNode)node.getAdapter(IPeerNode.class);
+ IUIService service = peerNode != null ? ServiceManager.getInstance().getService(peerNode, IUIService.class) : null;
+ IProcessMonitorUIDelegate delegate = service != null ? service.getDelegate(peerNode, IProcessMonitorUIDelegate.class) : null;
String newId = delegate != null ? delegate.getText(element, "PPID", id) : null; //$NON-NLS-1$
return newId != null ? newId : id;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/AttachHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/AttachHandler.java
index 88c076a9c..c0004f7dd 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/AttachHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/AttachHandler.java
@@ -24,7 +24,7 @@ import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.te.runtime.callback.Callback;
-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.processes.core.model.interfaces.IProcessContextNode;
import org.eclipse.tcf.te.tcf.processes.core.model.steps.AttachStep;
import org.eclipse.ui.handlers.HandlerUtil;
@@ -67,18 +67,18 @@ public class AttachHandler extends AbstractHandler {
Assert.isNotNull(selection);
// Analyze the selection and collect all nodes per parent peer model node.
- final Map<IPeerModel, List<IProcessContextNode>> contexts = new HashMap<IPeerModel, List<IProcessContextNode>>();
+ final Map<IPeerNode, List<IProcessContextNode>> contexts = new HashMap<IPeerNode, List<IProcessContextNode>>();
Iterator<?> iterator = selection.iterator();
while (iterator.hasNext()) {
Object candidate = iterator.next();
if (candidate instanceof IProcessContextNode) {
IProcessContextNode node = (IProcessContextNode)candidate;
- IPeerModel peerModel = (IPeerModel)node.getAdapter(IPeerModel.class);
- if (peerModel != null) {
- List<IProcessContextNode> nodes = contexts.get(peerModel);
+ IPeerNode peerNode = (IPeerNode)node.getAdapter(IPeerNode.class);
+ if (peerNode != null) {
+ List<IProcessContextNode> nodes = contexts.get(peerNode);
if (nodes == null) {
nodes = new ArrayList<IProcessContextNode>();
- contexts.put(peerModel, nodes);
+ contexts.put(peerNode, nodes);
}
if (!nodes.contains(node)) nodes.add(node);
}
@@ -87,10 +87,10 @@ public class AttachHandler extends AbstractHandler {
// If not empty, attach to all nodes of the original selection per parent peer model node.
if (!contexts.isEmpty()) {
- for (Entry<IPeerModel, List<IProcessContextNode>> entry : contexts.entrySet()) {
- IPeerModel peerModel = entry.getKey();
+ for (Entry<IPeerNode, List<IProcessContextNode>> entry : contexts.entrySet()) {
+ IPeerNode peerNode = entry.getKey();
List<IProcessContextNode> nodes = entry.getValue();
- doAttach(event, peerModel, nodes.toArray(new IProcessContextNode[nodes.size()]));
+ doAttach(event, peerNode, nodes.toArray(new IProcessContextNode[nodes.size()]));
}
}
}
@@ -103,14 +103,14 @@ public class AttachHandler extends AbstractHandler {
* @param event The execution event.
* @param nodes The list of process context nodes. Must not be <code>null</code>.
*/
- protected void doAttach(final ExecutionEvent event, final IPeerModel peerModel, final IProcessContextNode[] nodes) {
+ protected void doAttach(final ExecutionEvent event, final IPeerNode peerNode, final IProcessContextNode[] nodes) {
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- Assert.isNotNull(peerModel);
+ Assert.isNotNull(peerNode);
Assert.isNotNull(nodes);
if (nodes.length > 0) {
AttachStep step = new AttachStep();
- step.executeAttach(peerModel, nodes, new Callback());
+ step.executeAttach(peerNode, nodes, new Callback());
}
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/ConfigIntervalDynamicContribution.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/ConfigIntervalDynamicContribution.java
index 8392909a4..39546dc3c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/ConfigIntervalDynamicContribution.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/ConfigIntervalDynamicContribution.java
@@ -25,7 +25,7 @@ import org.eclipse.jface.action.Separator;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.util.SafeRunnable;
import org.eclipse.jface.viewers.StructuredSelection;
-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.processes.core.model.ModelManager;
import org.eclipse.tcf.te.tcf.processes.core.model.interfaces.runtime.IRuntimeModel;
import org.eclipse.tcf.te.tcf.processes.ui.activator.UIPlugin;
@@ -174,10 +174,10 @@ public class ConfigIntervalDynamicContribution extends CompoundContributionItem
@Override
protected IContributionItem[] getContributionItems() {
IEditorInput editorInput = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getEditorInput();
- IPeerModel peerModel = (IPeerModel) editorInput.getAdapter(IPeerModel.class);
+ IPeerNode peerNode = (IPeerNode) editorInput.getAdapter(IPeerNode.class);
List<IContributionItem> items = new ArrayList<IContributionItem>();
- if (peerModel != null) {
- IRuntimeModel model = ModelManager.getRuntimeModel(peerModel);
+ if (peerNode != null) {
+ IRuntimeModel model = ModelManager.getRuntimeModel(peerNode);
List<IContributionItem> groupItems = createGradeActions(model);
if(!groupItems.isEmpty()) {
items.addAll(groupItems);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/ConfigRefreshIntervalHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/ConfigRefreshIntervalHandler.java
index 36b0285ee..f8194cf99 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/ConfigRefreshIntervalHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/ConfigRefreshIntervalHandler.java
@@ -14,7 +14,7 @@ import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.widgets.Shell;
-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.processes.core.model.ModelManager;
import org.eclipse.tcf.te.tcf.processes.core.model.interfaces.runtime.IRuntimeModel;
import org.eclipse.tcf.te.tcf.processes.ui.internal.dialogs.IntervalConfigDialog;
@@ -33,7 +33,7 @@ public class ConfigRefreshIntervalHandler extends AbstractHandler {
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IEditorInput editorInput = HandlerUtil.getActiveEditorInputChecked(event);
- IPeerModel peer = (IPeerModel) editorInput.getAdapter(IPeerModel.class);
+ IPeerNode peer = (IPeerNode) editorInput.getAdapter(IPeerNode.class);
if (peer != null) {
Shell parent = HandlerUtil.getActiveShellChecked(event);
IntervalConfigDialog dialog = new IntervalConfigDialog(peer, parent);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/EditorHandlerDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/EditorHandlerDelegate.java
index 10d56d09d..60b6787b2 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/EditorHandlerDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/EditorHandlerDelegate.java
@@ -15,7 +15,7 @@ import org.eclipse.jface.viewers.Viewer;
import org.eclipse.tcf.te.tcf.processes.core.model.interfaces.IProcessContextNode;
import org.eclipse.tcf.te.tcf.processes.core.model.interfaces.runtime.IRuntimeModel;
import org.eclipse.tcf.te.tcf.processes.ui.editor.ProcessMonitorEditorPage;
-import org.eclipse.tcf.te.tcf.ui.handler.AbstractPeerModelEditorHandlerDelegate;
+import org.eclipse.tcf.te.tcf.ui.handler.AbstractPeerNodeEditorHandlerDelegate;
import org.eclipse.tcf.te.ui.swt.DisplayUtil;
import org.eclipse.tcf.te.ui.views.editor.Editor;
import org.eclipse.ui.IEditorPart;
@@ -25,7 +25,7 @@ import org.eclipse.ui.forms.editor.IFormPage;
/**
* Processes properties command handler implementation.
*/
-public class EditorHandlerDelegate extends AbstractPeerModelEditorHandlerDelegate {
+public class EditorHandlerDelegate extends AbstractPeerNodeEditorHandlerDelegate {
/* (non-Javadoc)
* @see org.eclipse.tcf.te.ui.interfaces.handler.IEditorHandlerDelegate#postOpenProperties(org.eclipse.ui.IEditorPart, java.lang.Object)
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/RefreshProcessListHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/RefreshProcessListHandler.java
index e398ea4b9..968c48fb5 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/RefreshProcessListHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/RefreshProcessListHandler.java
@@ -24,7 +24,7 @@ import org.eclipse.tcf.te.runtime.services.ServiceManager;
import org.eclipse.tcf.te.runtime.services.interfaces.IUIService;
import org.eclipse.tcf.te.tcf.core.model.interfaces.IModel;
import org.eclipse.tcf.te.tcf.core.model.interfaces.services.IModelRefreshService;
-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.processes.core.model.ModelManager;
import org.eclipse.tcf.te.tcf.processes.ui.interfaces.IProcessMonitorUIDelegate;
import org.eclipse.ui.IEditorInput;
@@ -47,7 +47,7 @@ public class RefreshProcessListHandler extends AbstractHandler implements IEleme
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IEditorInput editorInput = HandlerUtil.getActiveEditorInputChecked(event);
- final IPeerModel peer = (IPeerModel) editorInput.getAdapter(IPeerModel.class);
+ final IPeerNode peer = (IPeerNode) editorInput.getAdapter(IPeerNode.class);
if (peer != null) {
BusyIndicator.showWhile(PlatformUI.getWorkbench().getDisplay(), new Runnable() {
@Override
@@ -85,7 +85,7 @@ public class RefreshProcessListHandler extends AbstractHandler implements IEleme
IWorkbenchPart part = site.getPart();
if (part instanceof IEditorPart) {
IEditorInput editorInput = ((IEditorPart)part).getEditorInput();
- IPeerModel node = editorInput != null ? (IPeerModel) editorInput.getAdapter(IPeerModel.class) : null;
+ IPeerNode node = editorInput != null ? (IPeerNode) editorInput.getAdapter(IPeerNode.class) : null;
IUIService service = ServiceManager.getInstance().getService(node, IUIService.class);
IProcessMonitorUIDelegate delegate = service != null ? service.getDelegate(node, IProcessMonitorUIDelegate.class) : null;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/TerminateHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/TerminateHandler.java
index e111f41e5..c39ef8a7a 100644
--- a/