Example usage for javax.jms QueueRequestor close

List of usage examples for javax.jms QueueRequestor close

Introduction

In this page you can find the example usage for javax.jms QueueRequestor close.

Prototype


public void close() throws JMSException 

Source Link

Document

Closes the QueueRequestor and its session.

Usage

From source file:org.springframework.jms.support.JmsUtils.java

/**
 * Close the given JMS QueueRequestor and ignore any thrown exception.
 * This is useful for typical {@code finally} blocks in manual JMS code.
 * @param requestor the JMS QueueRequestor to close (may be {@code null})
 *///  ww w  .j  a v  a2 s. c om
public static void closeQueueRequestor(@Nullable QueueRequestor requestor) {
    if (requestor != null) {
        try {
            requestor.close();
        } catch (JMSException ex) {
            logger.trace("Could not close JMS QueueRequestor", ex);
        } catch (Throwable ex) {
            // We don't trust the JMS provider: It might throw RuntimeException or Error.
            logger.trace("Unexpected exception on closing JMS QueueRequestor", ex);
        }
    }
}