public static final class XAThreadPool.MultiRunner
extends java.lang.Object
implements java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.Callable |
callable |
private java.util.concurrent.CyclicBarrier |
endBarrier |
private java.lang.Exception |
exception |
private boolean |
released |
private java.lang.Object |
result |
private java.util.concurrent.CyclicBarrier |
startBarrier |
Modifier | Constructor and Description |
---|---|
private |
MultiRunner() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
execute(java.util.concurrent.Callable callable)
Execute a Callable on the wrapped thread and return its result
|
void |
release()
Release the wrapped thread back the the containing thread pool
|
void |
run() |
private final java.util.concurrent.CyclicBarrier startBarrier
private final java.util.concurrent.CyclicBarrier endBarrier
private volatile java.util.concurrent.Callable callable
private volatile boolean released
private volatile java.lang.Object result
private volatile java.lang.Exception exception
public java.lang.Object execute(java.util.concurrent.Callable callable) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
callable
- The Callable to executejava.util.concurrent.ExecutionException
- thrown when something went wrong during executionjava.lang.InterruptedException
- thrown when the executing thread got interruptedpublic void release()
public void run()
run
in interface java.lang.Runnable