Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2015-01-26 01:04:37 -0500
committerTobias Schwarz2015-01-26 01:04:37 -0500
commite9c54a4328f1a771ae3d8b67fc97cb304d7bd260 (patch)
tree60ccf7102a77322e860463f6348d1b46dbadcb97
parent021f462a18b882930245c1d8046af064dc23f28e (diff)
downloadorg.eclipse.tcf-e9c54a4328f1a771ae3d8b67fc97cb304d7bd260.tar.gz
org.eclipse.tcf-e9c54a4328f1a771ae3d8b67fc97cb304d7bd260.tar.xz
org.eclipse.tcf-e9c54a4328f1a771ae3d8b67fc97cb304d7bd260.zip
SM: add step group iterator to avoid connect step group when already
connected
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/iterators/ConnectIterator.java51
2 files changed, 55 insertions, 2 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml
index 7cddd7027..44808abf9 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
@@ -202,7 +202,8 @@
<!-- Step group contributions -->
<extension point="org.eclipse.tcf.te.runtime.stepper.stepGroups">
<stepGroup
- id="org.eclipse.tcf.te.tcf.locator.connectStepGroup">
+ id="org.eclipse.tcf.te.tcf.locator.connectStepGroup"
+ iterator="org.eclipse.tcf.te.tcf.locator.iterators.ConnectIterator">
<references>
<reference id="org.eclipse.tcf.te.tcf.locator.connectNoAttachStepGroup"/>
<reference id="org.eclipse.tcf.te.tcf.locator.startDebuggerStepGroup"/>
@@ -210,7 +211,8 @@
</stepGroup>
<stepGroup
- id="org.eclipse.tcf.te.tcf.locator.connectNoAttachStepGroup">
+ id="org.eclipse.tcf.te.tcf.locator.connectNoAttachStepGroup"
+ iterator="org.eclipse.tcf.te.tcf.locator.iterators.ConnectIterator">
<references>
<reference id="org.eclipse.tcf.te.core.setConnectStateStep" secondaryId="connecting">
<parameter name="state" value="connecting"/>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/iterators/ConnectIterator.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/iterators/ConnectIterator.java
new file mode 100644
index 000000000..54ba558c1
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/iterators/ConnectIterator.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2015 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.core.interfaces.IConnectable;
+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;
+
+/**
+ * Step group iterator for connect.
+ */
+public class ConnectIterator extends AbstractPeerNodeStepGroupIterator {
+
+ /**
+ * Constructor.
+ */
+ public ConnectIterator() {
+ 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);
+
+ int connectState = getActivePeerModelContext(context, data, fullQualifiedId).getConnectState();
+
+ boolean doConnect = connectState == IConnectable.STATE_DISCONNECTED || connectState == IConnectable.STATE_CONNECT_SCHEDULED;
+ setIterations(doConnect ? 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 {
+ }
+}

Back to the top