public class TaskContext extends Object
| Constructor | Description |
|---|---|
TaskContext() |
| Modifier and Type | Method | Description |
|---|---|---|
static Set<Thread> |
activeThreads() |
|
static TaskContext |
current() |
Gets the current execution context for this thread from the stack.
|
static TaskContext |
currentFor(Thread thread) |
Enables the application to peek into what is being executed in another thread.
|
Executor |
getDefaultExecutor() |
|
Object |
getProperty(String name) |
Returns the property with the given name registered in the current execution context,
null if there is no property by that name. |
void |
pop() |
Removes the this execution context from the context stack for the current thread.
|
protected Map<String,Object> |
properties() |
|
void |
push() |
Adds this execution context to the top of the context stack for the current thread.
|
void |
setDefaultExecutor(Executor defaultExecutor) |
|
void |
setProperty(String name,
Object value) |
Binds an object to a given property name in the current execution context.
|
String |
toString() |
|
static Runnable |
wrap(Runnable w) |
Wraps a Runnable in such a way the it will push the current execution context before any code gets executed and pop it afterwards
|
static <T,U> BiConsumer<T,U> |
wrap(BiConsumer<T,U> w) |
Wraps a BiConsumer in such a way the it will push the current execution context before any code gets executed and pop it afterwards
|
static <T,U,R> BiFunction<T,U,R> |
wrap(BiFunction<T,U,R> w) |
Wraps a Function in such a way the it will push the current execution context before any code gets executed and pop it afterwards
|
static <T> Consumer<T> |
wrap(Consumer<T> w) |
Wraps a Consumer in such a way the it will push the current execution context before any code gets executed and pop it afterwards
|
static <T,R> Function<T,R> |
wrap(Function<T,R> w) |
Wraps a Function in such a way the it will push the current execution context before any code gets executed and pop it afterwards
|
static <T> Supplier<T> |
wrap(Supplier<T> w) |
Wraps a Supplier in such a way the it will push the current execution context before any code gets executed and pop it afterwards
|
public Executor getDefaultExecutor()
public void setDefaultExecutor(Executor defaultExecutor)
public void push()
public void pop()
public static TaskContext current()
public static TaskContext currentFor(Thread thread)
public static Set<Thread> activeThreads()
public static Runnable wrap(Runnable w)
w - the functional interface to be wrappedpublic static <T,U> BiConsumer<T,U> wrap(BiConsumer<T,U> w)
w - the functional interface to be wrappedpublic static <T> Consumer<T> wrap(Consumer<T> w)
w - the functional interface to be wrappedpublic static <T,R> Function<T,R> wrap(Function<T,R> w)
w - the functional interface to be wrappedpublic static <T,U,R> BiFunction<T,U,R> wrap(BiFunction<T,U,R> w)
w - the functional interface to be wrappedpublic static <T> Supplier<T> wrap(Supplier<T> w)
w - the functional interface to be wrappedpublic Object getProperty(String name)
null if there is no property by that name.
A property allows orbit extensions to exchange custom information.
name - the name of the propertyObject or
null if no property exists matching the given name.public void setProperty(String name, Object value)
A property allows orbit extensions to exchange custom information.
A null value will work to remove the property.
name - a String the name of the property.value - an Object may be nullCopyright © 2018 Electronic Arts Inc. All rights reserved.