1 /*******************************************************************************
2  * Copyright (c) 1997, 2008 by ProSyst Software GmbH
3  * http://www.prosyst.com
4  *
5  * This program and the accompanying materials
6  * are made available under the terms of the Eclipse Public License 2.0
7  * which accompanies this distribution, and is available at
8  * https://www.eclipse.org/legal/epl-2.0/
9  *
10  * SPDX-License-Identifier: EPL-2.0
11  *
12  * Contributors:
13  *    ProSyst Software GmbH - initial API and implementation
14  *******************************************************************************/
15 package org.eclipse.equinox.internal.util.threadpool;
16 
17 /**
18  * Gives access to the user-provided Runnable object of the thread. All threads
19  * created by the ThreadPoolManager service implement that interface, so that in
20  * a method called by such a thread you can get the Runnable object provided in
21  * <code>
22  * ThreadPoolManager.execute(Runnable job, String threadName)</code>
23  * with the following line:
24  * <p>
25  * <code><ul> Runnable runnable = ((ThreadContext) Thread.currentThread()).getRunnable();</ul></code>
26  *
27  * @author Pavlin Dobrev
28  * @version 1.0
29  */
30 
31 public interface ThreadContext {
32 	/**
33 	 * Returns the Runnable object provided in the
34 	 * <code>ThreadPoolManager.execute(Runnable job, String threadName)</code>
35 	 * method.
36 	 */
getRunnable()37 	public Runnable getRunnable();
38 }
39