Example usage for javax.jms ConnectionMetaData getJMSVersion

List of usage examples for javax.jms ConnectionMetaData getJMSVersion

Introduction

In this page you can find the example usage for javax.jms ConnectionMetaData getJMSVersion.

Prototype


String getJMSVersion() throws JMSException;

Source Link

Document

Gets the JMS API version.

Usage

From source file:nl.nn.adapterframework.jms.JmsMessagingSourceFactory.java

public String getConnectionFactoryInfo(ConnectionFactory connectionFactory) {
    if (IbisContext.getApplicationServerType().equals("TIBCOAMX")) {
        // Workaround to prevent the following exception:
        // [org.apache.geronimo.connector.outbound.MCFConnectionInterceptor] - Error occurred creating ManagedConnection for org.apache.geronimo.connector.outbound.ConnectionInfo@#######
        // javax.resource.ResourceException: JMSJCA-E084: Failed to create session: The JNDI name is null
        return null;
    }// w w  w.j  a  v  a2s .  c  o  m
    String info = null;
    Connection connection = null;
    try {
        connection = connectionFactory.createConnection();
        ConnectionMetaData metaData = connection.getMetaData();
        info = "jms provider name [" + metaData.getJMSProviderName() + "] jms provider version ["
                + metaData.getProviderVersion() + "] jms version [" + metaData.getJMSVersion() + "]";
    } catch (JMSException e) {
        log.warn("Exception determining connection factory info", e);
    } finally {
        if (connection != null) {
            try {
                connection.close();
            } catch (JMSException e1) {
                log.warn("Exception closing connection for metadata", e1);
            }
        }
    }
    return info;
}