Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2014-04-09 13:35:56 +0000
committerTobias Schwarz2014-04-09 13:35:56 +0000
commit87d617e8fb906aabfebc268bb0a65fca5111f393 (patch)
tree3d29ceba3ec2eb39dc89544738f09b84c54a521c /target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper
parentac3614fec55fd49e54d58da00492b21f1f35460a (diff)
downloadorg.eclipse.tcf-87d617e8fb906aabfebc268bb0a65fca5111f393.tar.gz
org.eclipse.tcf-87d617e8fb906aabfebc268bb0a65fca5111f393.tar.xz
org.eclipse.tcf-87d617e8fb906aabfebc268bb0a65fca5111f393.zip
Target Explorer: rework action history
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/META-INF/MANIFEST.MF3
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepAttributes.java18
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/job/StepperJob.java3
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/stepper/Stepper.java25
4 files changed, 44 insertions, 5 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/META-INF/MANIFEST.MF b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/META-INF/MANIFEST.MF
index aefb32ec7..8e314c15c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/META-INF/MANIFEST.MF
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/META-INF/MANIFEST.MF
@@ -11,7 +11,8 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.8.0",
org.eclipse.tcf.te.runtime.concurrent;bundle-version="1.3.0",
org.eclipse.tcf.te.runtime.model;bundle-version="1.3.0",
org.eclipse.tcf.te.runtime.services;bundle-version="1.3.0",
- org.eclipse.tcf.te.runtime.statushandler;bundle-version="1.3.0"
+ org.eclipse.tcf.te.runtime.statushandler;bundle-version="1.3.0",
+ org.eclipse.tcf.te.runtime.persistence;bundle-version="1.3.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepAttributes.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepAttributes.java
index b94de8a91..2853044de 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepAttributes.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepAttributes.java
@@ -33,4 +33,22 @@ public interface IStepAttributes {
* The running job operation.
*/
public static final String ATTR_STEPPER_JOB_OPERATION = ATTR_PREFIX + ".stepper_job_operation"; //$NON-NLS-1$
+
+ /**
+ * The id to persist the data of stepper execution to the history.
+ * If this attribute is not set, it is filled automatically with <stepGroupId>@<stepContextId>
+ */
+ public static final String ATTR_HISTORY_ID = ATTR_PREFIX + ".history_id"; //$NON-NLS-1$
+
+ /**
+ * The data to persist to the history.
+ * If this attribute is not set, it is filled automatically with the given stepper data.
+ */
+ public static final String ATTR_HISTORY_DATA = ATTR_PREFIX + ".history_data"; //$NON-NLS-1$
+
+ /**
+ * The number of entries in the history.
+ * If this attribute is not set, the history manager default is used.
+ */
+ public static final String ATTR_HISTORY_COUNT = ATTR_PREFIX + ".history_count"; //$NON-NLS-1$
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/job/StepperJob.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/job/StepperJob.java
index 9f9abfa90..f3df21e69 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/job/StepperJob.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/job/StepperJob.java
@@ -165,9 +165,6 @@ public final class StepperJob extends Job {
Map<String,List<Job>> jobs = getJobs(stepContext.getContextObject());
addJob(jobs, this, operation);
setJobs(jobs, stepContext.getContextObject());
-
- data.setProperty(IStepAttributes.ATTR_STEPPER_JOB, this);
- data.setProperty(IStepAttributes.ATTR_STEPPER_JOB_OPERATION, operation);
}
public static Map<String,List<Job>> getJobs(Object context) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/stepper/Stepper.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/stepper/Stepper.java
index dd776cc7b..eb3e870d2 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/stepper/Stepper.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/stepper/Stepper.java
@@ -28,12 +28,15 @@ import org.eclipse.tcf.te.runtime.callback.Callback;
import org.eclipse.tcf.te.runtime.concurrent.util.ExecutorsUtil;
import org.eclipse.tcf.te.runtime.interfaces.ISharedConstants;
import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.persistence.history.HistoryManager;
+import org.eclipse.tcf.te.runtime.persistence.utils.DataHelper;
import org.eclipse.tcf.te.runtime.stepper.FullQualifiedId;
import org.eclipse.tcf.te.runtime.stepper.StepperManager;
import org.eclipse.tcf.te.runtime.stepper.activator.CoreBundleActivator;
import org.eclipse.tcf.te.runtime.stepper.extensions.StepExecutor;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IStep;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepAttributes;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepExecutor;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepGroup;
@@ -45,7 +48,7 @@ import org.eclipse.tcf.te.runtime.stepper.nls.Messages;
import org.eclipse.tcf.te.runtime.utils.StatusHelper;
/**
- * An abstract stepper implementation.
+ * Stepper implementation.
*/
public class Stepper implements IStepper {
@@ -169,6 +172,13 @@ public class Stepper implements IStepper {
// but not finished yet
this.finished = false;
+ if (!data.containsKey(IStepAttributes.ATTR_HISTORY_DATA)) {
+ data.setProperty(IStepAttributes.ATTR_HISTORY_DATA, DataHelper.encodePropertiesContainer(data));
+ }
+ if (!data.containsKey(IStepAttributes.ATTR_HISTORY_ID)) {
+ data.setProperty(IStepAttributes.ATTR_HISTORY_ID, stepGroupId + "@" + context.getId()); //$NON-NLS-1$
+ }
+
// call the hook for the subclasses to initialize themselves
onInitialize(this.data, fullQualifiedId, this.monitor);
@@ -343,6 +353,19 @@ public class Stepper implements IStepper {
// Severe status objects are errors or cancellation.
List<IStatus> statusContainer = new ArrayList<IStatus>();
+ // save execution to history
+ String historyId = data.getStringProperty(IStepAttributes.ATTR_HISTORY_ID);
+ String historyData = data.getStringProperty(IStepAttributes.ATTR_HISTORY_DATA);
+ int historyCount = data.getIntProperty(IStepAttributes.ATTR_HISTORY_COUNT);
+ if (historyId != null && historyData != null) {
+ if (historyCount > 0) {
+ HistoryManager.getInstance().add(historyId, historyData, historyCount);
+ }
+ else {
+ HistoryManager.getInstance().add(historyId, historyData);
+ }
+ }
+
// start execution
internalExecute(statusContainer);

Back to the top