Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2015-03-13 05:32:58 -0400
committerUwe Stieber2015-03-13 05:33:43 -0400
commit81c39c23c064a2d2ee83a2af958e858d6db1fd11 (patch)
tree0bf8bf3f0f1dbd45c014306b1be3f5ae9ebc564b
parente13cf6a866ca6573c886ceb060de47e4deefed5d (diff)
downloadorg.eclipse.tcf-81c39c23c064a2d2ee83a2af958e858d6db1fd11.tar.gz
org.eclipse.tcf-81c39c23c064a2d2ee83a2af958e858d6db1fd11.tar.xz
org.eclipse.tcf-81c39c23c064a2d2ee83a2af958e858d6db1fd11.zip
Target Explorer: Add a default callback invocation delegate implemenation which does invoke the callback in the caller thread
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/callback/CallbackInvocationDelegate.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/callback/CallbackInvocationDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/callback/CallbackInvocationDelegate.java
new file mode 100644
index 000000000..16dfb0653
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/callback/CallbackInvocationDelegate.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * 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.runtime.callback;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.tcf.te.runtime.callback.AsyncCallbackCollector.ICallbackInvocationDelegate;
+
+/**
+ * Default callback invocation delegate implementation.
+ * <p>
+ * The callback will be invoked in the calling thread. No thread switch is implied.
+ */
+public class CallbackInvocationDelegate implements ICallbackInvocationDelegate {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.callback.AsyncCallbackCollector.ICallbackInvocationDelegate#invoke(java.lang.Runnable)
+ */
+ @Override
+ public void invoke(Runnable runnable) {
+ Assert.isNotNull(runnable);
+ runnable.run();
+ }
+
+}

Back to the top