public synchronized Session getJmsSession(final int acknowledgeMode) throws CourierException {
if(jmsSession == null) {
try {
jmsSession = getConnectionPool().getSession(acknowledgeMode);
} catch (NamingException e) {
throw new CourierServiceBindException("Failed to get JMS Session from pool.", e);
} catch (JMSException e) {
throw new CourierServiceBindException("Failed to get JMS Session from pool.", e);
} catch (ConnectionException e) {
throw new CourierServiceBindException("Failed to get JMS Session from pool.", e);
}
}
return jmsSession;
}