List of usage examples for javax.jms JMSException JMSException
public JMSException(String reason)
From source file:org.wso2.carbon.transport.jms.factory.PooledJMSConnectionFactory.java
@Override public Connection createConnection() throws JMSException { PooledConnectionKey key = new PooledConnectionKey(null, null); Connection connection;//from www .j a va 2 s .c o m try { connection = keyedObjectPool.borrowObject(key); if (!validateObject(key, new DefaultPooledObject<>(connection))) { keyedObjectPool.invalidateObject(key, connection); throw new JMSException("Could not create a valid connection"); } return connection; } catch (Exception e) { throw new JMSException("Error occurred creating connection : " + e.getMessage()); } }
From source file:org.wso2.carbon.transport.jms.factory.PooledJMSConnectionFactory.java
@Override public Connection createConnection(String userName, String password) throws JMSException { PooledConnectionKey key = new PooledConnectionKey(userName, password); try {//w w w . j a v a2s . c o m return keyedObjectPool.borrowObject(key); } catch (Exception e) { throw new JMSException("Error occurred creating connection : " + e.getMessage()); } }