/** * Get transacted * * @return True if transacted; otherwise false * @throws JMSException Thrown if an error occurs */ @Override public boolean getTransacted() throws JMSException { if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("getTransacted()"); } getSessionInternal(); return cri.isTransacted(); }
/** * Get transacted * * @return True if transacted; otherwise false * @throws JMSException Thrown if an error occurs */ @Override public boolean getTransacted() throws JMSException { if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("getTransacted()"); } getSessionInternal(); return cri.isTransacted(); }
/** * Recover * * @throws JMSException Failed to close session. */ @Override public void recover() throws JMSException { lock(); try { Session session = getSessionInternal(); if (cri.isTransacted()) { throw new IllegalStateException("Session is transacted"); } if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("Recover session " + this); } session.recover(); } finally { unlock(); } }
/** * Recover * * @throws JMSException Failed to close session. */ @Override public void recover() throws JMSException { lock(); try { Session session = getSessionInternal(); if (cri.isTransacted()) { throw new IllegalStateException("Session is transacted"); } if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("Recover session " + this); } session.recover(); } finally { unlock(); } }
/** * Indicates whether some other object is "equal to" this one. * * @param obj Object with which to compare * @return True if this object is the same as the obj argument; false otherwise. */ @Override public boolean equals(final Object obj) { if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("equals(" + obj + ")"); } if (obj == null) { return false; } if (obj instanceof ActiveMQRAConnectionRequestInfo) { ActiveMQRAConnectionRequestInfo you = (ActiveMQRAConnectionRequestInfo) obj; return ActiveMQRaUtils.compare(userName, you.getUserName()) && ActiveMQRaUtils.compare(password, you.getPassword()) && ActiveMQRaUtils.compare(clientID, you.getClientID()) && type == you.getType() && transacted == you.isTransacted() && acknowledgeMode == you.getAcknowledgeMode(); } else { return false; } }
/** * Indicates whether some other object is "equal to" this one. * * @param obj Object with which to compare * @return True if this object is the same as the obj argument; false otherwise. */ @Override public boolean equals(final Object obj) { if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("equals(" + obj + ")"); } if (obj == null) { return false; } if (obj instanceof ActiveMQRAConnectionRequestInfo) { ActiveMQRAConnectionRequestInfo you = (ActiveMQRAConnectionRequestInfo) obj; return ActiveMQRaUtils.compare(userName, you.getUserName()) && ActiveMQRaUtils.compare(password, you.getPassword()) && ActiveMQRaUtils.compare(clientID, you.getClientID()) && type == you.getType() && transacted == you.isTransacted() && acknowledgeMode == you.getAcknowledgeMode(); } else { return false; } }
/** * Commit * * @throws JMSException Failed to close session. */ @Override public void commit() throws JMSException { if (cri.getType() == ActiveMQRAConnectionFactory.XA_CONNECTION || cri.getType() == ActiveMQRAConnectionFactory.XA_QUEUE_CONNECTION || cri.getType() == ActiveMQRAConnectionFactory.XA_TOPIC_CONNECTION) { throw new TransactionInProgressException("XA connection"); } lock(); try { Session session = getSessionInternal(); if (cri.isTransacted() == false) { throw new IllegalStateException("Session is not transacted"); } if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("Commit session " + this); } session.commit(); } finally { unlock(); } }
/** * Rollback * * @throws JMSException Failed to close session. */ @Override public void rollback() throws JMSException { if (cri.getType() == ActiveMQRAConnectionFactory.XA_CONNECTION || cri.getType() == ActiveMQRAConnectionFactory.XA_QUEUE_CONNECTION || cri.getType() == ActiveMQRAConnectionFactory.XA_TOPIC_CONNECTION) { throw new TransactionInProgressException("XA connection"); } lock(); try { Session session = getSessionInternal(); if (cri.isTransacted() == false) { throw new IllegalStateException("Session is not transacted"); } if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("Rollback session " + this); } session.rollback(); } finally { unlock(); } }
/** * Commit * * @throws JMSException Failed to close session. */ @Override public void commit() throws JMSException { if (cri.getType() == ActiveMQRAConnectionFactory.XA_CONNECTION || cri.getType() == ActiveMQRAConnectionFactory.XA_QUEUE_CONNECTION || cri.getType() == ActiveMQRAConnectionFactory.XA_TOPIC_CONNECTION) { throw new TransactionInProgressException("XA connection"); } lock(); try { Session session = getSessionInternal(); if (cri.isTransacted() == false) { throw new IllegalStateException("Session is not transacted"); } if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("Commit session " + this); } session.commit(); } finally { unlock(); } }
/** * Rollback * * @throws JMSException Failed to close session. */ @Override public void rollback() throws JMSException { if (cri.getType() == ActiveMQRAConnectionFactory.XA_CONNECTION || cri.getType() == ActiveMQRAConnectionFactory.XA_QUEUE_CONNECTION || cri.getType() == ActiveMQRAConnectionFactory.XA_TOPIC_CONNECTION) { throw new TransactionInProgressException("XA connection"); } lock(); try { Session session = getSessionInternal(); if (cri.isTransacted() == false) { throw new IllegalStateException("Session is not transacted"); } if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("Rollback session " + this); } session.rollback(); } finally { unlock(); } }
boolean transacted = cri.isTransacted(); int acknowledgeMode = Session.AUTO_ACKNOWLEDGE; if (cri.getType() == ActiveMQRAConnectionFactory.TOPIC_CONNECTION) {
boolean transacted = cri.isTransacted(); int acknowledgeMode = Session.AUTO_ACKNOWLEDGE; if (cri.getType() == ActiveMQRAConnectionFactory.TOPIC_CONNECTION) {