boolean reattached = sessionContext.reattachOnNewConnection(backupConnection); sessionContext.resetName(name); sessionContext.recreateSession(username, password, minLargeMessageSize, xa, autoCommitSends, autoCommitAcks, preAcknowledge); sessionContext.recreateConsumerOnServer(consumerInternal, entryx.getKey().getId(), started); sessionContext.xaFailed(currentXID); rollbackOnly = true; sessionContext.restartSession(); sessionContext.returnBlocking(cause); sessionContext.releaseCommunications(); sessionContext.resetMetadata(metaDataToSend);
@Override public void addMetaData(String key, String data) throws ActiveMQException { synchronized (metadata) { metadata.put(key, data); } sessionContext.addSessionMetadata(key, data); }
@Override public void addUniqueMetaData(String key, String data) throws ActiveMQException { sessionContext.addUniqueMetaData(key, data); }
/** * @param queueName * @param filterString * @param windowSize * @param browseOnly * @return * @throws ActiveMQException */ private ClientConsumer internalCreateConsumer(final SimpleString queueName, final SimpleString filterString, final int windowSize, final int maxRate, final boolean browseOnly) throws ActiveMQException { checkClosed(); ClientConsumerInternal consumer = sessionContext.createConsumer(queueName, filterString, windowSize, maxRate, ackBatchSize, browseOnly, executor, flowControlExecutor); addConsumer(consumer); // Now we send window size credits to start the consumption // We even send it if windowSize == -1, since we need to start the // consumer // TODO: this could semantically change on other servers. I know for instance on stomp this is just an ignore if (windowSize != 0) { sessionContext.sendConsumerCredits(consumer, windowSize); } return consumer; }
@Override public void createAddress(final SimpleString address, EnumSet<RoutingType> routingTypes, boolean autoCreated) throws ActiveMQException { checkClosed(); startCall(); try { sessionContext.createAddress(address, routingTypes, autoCreated); } finally { endCall(); } }
private void doCleanup(boolean failingOver) { if (logger.isDebugEnabled()) { logger.debug("calling cleanup on " + this); } synchronized (this) { closed = true; sessionContext.cleanup(); } sessionFactory.removeSession(this, failingOver); }
@Override public AddressQuery addressQuery(final SimpleString address) throws ActiveMQException { checkClosed(); return sessionContext.addressQuery(address); }
@Override public boolean setTransactionTimeout(final int seconds) throws XAException { checkXA(); try { return sessionContext.configureTransactionTimeout(seconds); } catch (Throwable t) { markRollbackOnly(); // The TM will ignore any errors from here, if things are this screwed up we mark rollbackonly // This could occur if the TM interrupts the thread XAException xaException = new XAException(XAException.XAER_RMFAIL); xaException.initCause(t); throw xaException; } }
sessionContext.closeConsumer(this);
sessionContext.createQueue(address, routingType, queueName,
private void stopSessionFailover() { XASession xaSource = (XASession) sourceSession; XASession xaTarget = (XASession) targetSession; ((ClientSessionInternal) xaSource.getXAResource()).getSessionContext().releaseCommunications(); ((ClientSessionInternal) xaTarget.getXAResource()).getSessionContext().releaseCommunications(); }
/** * @param queueName * @param filterString * @param windowSize * @param browseOnly * @return * @throws ActiveMQException */ private ClientConsumer internalCreateConsumer(final SimpleString queueName, final SimpleString filterString, final int windowSize, final int maxRate, final boolean browseOnly) throws ActiveMQException { checkClosed(); ClientConsumerInternal consumer = sessionContext.createConsumer(queueName, filterString, windowSize, maxRate, ackBatchSize, browseOnly, executor, flowControlExecutor); addConsumer(consumer); // Now we send window size credits to start the consumption // We even send it if windowSize == -1, since we need to start the // consumer // TODO: this could semantically change on other servers. I know for instance on stomp this is just an ignore if (windowSize != 0) { sessionContext.sendConsumerCredits(consumer, windowSize); } return consumer; }
@Override public void createAddress(final SimpleString address, EnumSet<RoutingType> routingTypes, boolean autoCreated) throws ActiveMQException { checkClosed(); startCall(); try { sessionContext.createAddress(address, routingTypes, autoCreated); } finally { endCall(); } }
private void doCleanup(boolean failingOver) { if (logger.isDebugEnabled()) { logger.debug("calling cleanup on " + this); } synchronized (this) { closed = true; sessionContext.cleanup(); } sessionFactory.removeSession(this, failingOver); }
@Override public AddressQuery addressQuery(final SimpleString address) throws ActiveMQException { checkClosed(); return sessionContext.addressQuery(address); }
@Override public boolean setTransactionTimeout(final int seconds) throws XAException { checkXA(); try { return sessionContext.configureTransactionTimeout(seconds); } catch (Throwable t) { markRollbackOnly(); // The TM will ignore any errors from here, if things are this screwed up we mark rollbackonly // This could occur if the TM interrupts the thread XAException xaException = new XAException(XAException.XAER_RMFAIL); xaException.initCause(t); throw xaException; } }
sessionContext.closeConsumer(this);
private void internalCreateQueue(final SimpleString address, final SimpleString queueName, final boolean temp, final boolean autoCreated, final QueueAttributes queueAttributes) throws ActiveMQException { checkClosed(); if (queueAttributes.getDurable() && temp) { throw ActiveMQClientMessageBundle.BUNDLE.queueMisConfigured(); } startCall(); try { sessionContext.createQueue(address, queueName, temp, autoCreated, queueAttributes); } finally { endCall(); } }
boolean reattached = sessionContext.reattachOnNewConnection(backupConnection); sessionContext.resetName(name); sessionContext.recreateSession(username, password, minLargeMessageSize, xa, autoCommitSends, autoCommitAcks, preAcknowledge); sessionContext.recreateConsumerOnServer(consumerInternal, entryx.getKey().getId(), started); sessionContext.xaFailed(currentXID); rollbackOnly = true; sessionContext.restartSession(); sessionContext.returnBlocking(cause); sessionContext.releaseCommunications(); sessionContext.resetMetadata(metaDataToSend);
/** * @param queueName * @param filterString * @param windowSize * @param browseOnly * @return * @throws ActiveMQException */ private ClientConsumer internalCreateConsumer(final SimpleString queueName, final SimpleString filterString, final int windowSize, final int maxRate, final boolean browseOnly) throws ActiveMQException { checkClosed(); ClientConsumerInternal consumer = sessionContext.createConsumer(queueName, filterString, windowSize, maxRate, ackBatchSize, browseOnly, executor, flowControlExecutor); addConsumer(consumer); // Now we send window size credits to start the consumption // We even send it if windowSize == -1, since we need to start the // consumer // TODO: this could semantically change on other servers. I know for instance on stomp this is just an ignore if (windowSize != 0) { sessionContext.sendConsumerCredits(consumer, windowSize); } return consumer; }