public class ConnectionFactoryContextWrapper extends Object
ConnectionFactory
context binding and unbinding when executing instructions.Constructor and Description |
---|
ConnectionFactoryContextWrapper(ConnectionFactory connectionFactory) |
Modifier and Type | Method and Description |
---|---|
<T> T |
call(Callable<T> callable)
Execute a
Callable binding to the default ConnectionFactory and finally unbinding it. |
<T> T |
call(String contextName,
Callable<T> callable)
Execute a
Callable binding the given ConnectionFactory and finally unbinding it. |
void |
run(Runnable runnable)
Execute a
Runnable binding to the default ConnectionFactory and finally unbinding it. |
void |
run(String contextName,
Runnable runnable)
Execute a
Runnable binding the given ConnectionFactory and finally unbinding it. |
public ConnectionFactoryContextWrapper(ConnectionFactory connectionFactory)
public <T> T call(Callable<T> callable)
Callable
binding to the default ConnectionFactory
and finally unbinding it.public <T> T call(@Nullable String contextName, Callable<T> callable)
Callable
binding the given ConnectionFactory
and finally unbinding it.public void run(Runnable runnable)
Runnable
binding to the default ConnectionFactory
and finally unbinding it.runnable
- the Runnable
object to be executed.RuntimeException
- when a RuntimeException is thrown by the Runnable
.public void run(@Nullable String contextName, 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.RuntimeException
- when a RuntimeException is thrown by the Runnable
.