public class ConnectionFactoryContextWrapper
extends java.lang.Object
ConnectionFactory context binding and unbinding when executing instructions.| Constructor and Description |
|---|
ConnectionFactoryContextWrapper(ConnectionFactory connectionFactory) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
call(java.util.concurrent.Callable<T> callable)
Execute a
Callable binding to the default ConnectionFactory and finally unbinding it. |
<T> T |
call(java.lang.String contextName,
java.util.concurrent.Callable<T> callable)
Execute a
Callable binding the given ConnectionFactory and finally unbinding it. |
void |
run(java.lang.Runnable runnable)
Execute a
Runnable binding to the default ConnectionFactory and finally unbinding it. |
void |
run(java.lang.String contextName,
java.lang.Runnable runnable)
Execute a
Runnable binding the given ConnectionFactory and finally unbinding it. |
public ConnectionFactoryContextWrapper(ConnectionFactory connectionFactory)
public <T> T call(java.util.concurrent.Callable<T> callable)
Callable binding to the default ConnectionFactory and finally unbinding it.T - the return type.callable - the Callable object to be executed.Callable.public <T> T call(@Nullable
java.lang.String contextName,
java.util.concurrent.Callable<T> callable)
Callable binding the given ConnectionFactory and finally unbinding it.T - the return type.contextName - the name of the context. In null, empty or blank, default context is bound.callable - the Callable object to be executed.Callable.public void run(java.lang.Runnable runnable)
Runnable binding to the default ConnectionFactory and finally unbinding it.runnable - the Runnable object to be executed.java.lang.RuntimeException - when a RuntimeException is thrown by the Runnable.public void run(@Nullable
java.lang.String contextName,
java.lang.Runnable runnable)
Runnable binding the given ConnectionFactory and finally unbinding it.contextName - the name of the context. In null, empty or blank, default context is bound.runnable - the Runnable object to be executed.java.lang.RuntimeException - when a RuntimeException is thrown by the Runnable.