From 81c39c23c064a2d2ee83a2af958e858d6db1fd11 Mon Sep 17 00:00:00 2001 From: Uwe Stieber Date: Fri, 13 Mar 2015 10:32:58 +0100 Subject: Target Explorer: Add a default callback invocation delegate implemenation which does invoke the callback in the caller thread --- .../callback/CallbackInvocationDelegate.java | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/callback/CallbackInvocationDelegate.java 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. + *

+ * 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(); + } + +} -- cgit v1.2.3