private Session getSession() {

        if (!sessionOption.isPresent()) {
            try {
                sessionOption = Optional.of(getConnection().createSession(transacted, acknowledgeMode));
            } catch (JMSException e) {
                throw new JmsException("Unable to get JMS session", e);
            }
        }
        return sessionOption.get();
    }
private Session getSession() {

        if (!sessionOption.isPresent()) {
            try {
                sessionOption = Optional.of(getConnection().createSession(transacted, acknowledgeMode));
            } catch (JMSException e) {
                throw new JmsException("Unable to get JMS session", e);
            }
        }
        return sessionOption.get();
    }
private Session getSession ( ) { if ( ! sessionOption . isPresent ( ) ) { try { sessionOption = Optional . of ( getConnection ( ) . createSession ( transacted , acknowledgeMode ) ) ; } catch ( JMSException e ) { throw new JmsException ( "Unable to get JMS session" , e ) ; } } return sessionOption . get ( ) ; }
Get the current session or create one from the JMS connection.

@return JMS Session
Get the current session or create one from the JMS connection .