Class ConnectionFactoryContextWrapper


  • public class ConnectionFactoryContextWrapper
    extends Object
    Helper class to handle ConnectionFactory context binding and unbinding when executing instructions.
    Since:
    2.3
    Author:
    Wander Costa, Artem Bilan
    • Constructor Detail

      • ConnectionFactoryContextWrapper

        public ConnectionFactoryContextWrapper​(ConnectionFactory connectionFactory)
    • Method Detail

      • call

        public <T> T call​(Callable<T> callable)
        Execute a Callable binding to the default ConnectionFactory and finally unbinding it.
        Type Parameters:
        T - the return type.
        Parameters:
        callable - the Callable object to be executed.
        Returns:
        the result of the Callable.
      • call

        public <T> T call​(@Nullable
                          String contextName,
                          Callable<T> callable)
        Execute a Callable binding the given ConnectionFactory and finally unbinding it.
        Type Parameters:
        T - the return type.
        Parameters:
        contextName - the name of the context. In null, empty or blank, default context is bound.
        callable - the Callable object to be executed.
        Returns:
        the result of the Callable.