/** * Send the asynchronous command. * * @param command - command to be executed. * @throws JMSException */ public void asyncSendPacket(Command command) throws JMSException { connection.asyncSendPacket(command); }
public synchronized void dispose() { if (!closed) { try { this.connection.asyncSendPacket(info.createRemoveCommand()); } catch (JMSException e) { LOG.debug("Failed to send remove command: " + e, e); } this.connection.removeDispatcher(info.getConsumerId()); closed = true; } }
/** * Closes the connection consumer. <p/> * <P> * Since a provider may allocate some resources on behalf of a connection * consumer outside the Java virtual machine, clients should close these * resources when they are not needed. Relying on garbage collection to * eventually reclaim these resources may not be timely enough. * * @throws JMSException */ public void close() throws JMSException { if (!closed) { dispose(); this.connection.asyncSendPacket(this.consumerInfo.createRemoveCommand()); } }
private void doClose() throws JMSException { dispose(); RemoveInfo removeCommand = info.createRemoveCommand(); removeCommand.setLastDeliveredSequenceId(lastDeliveredSequenceId); connection.asyncSendPacket(removeCommand); }
public void dispatch(MessageDispatch md) { // Auto ack messages when we reach 75% of the prefetch deliveredCounter++; if (deliveredCounter > (0.75 * info.getPrefetchSize())) { try { MessageAck ack = new MessageAck(md, MessageAck.STANDARD_ACK_TYPE, deliveredCounter); connection.asyncSendPacket(ack); deliveredCounter = 0; } catch (JMSException e) { connection.onClientInternalException(e); } } DataStructure o = md.getMessage().getDataStructure(); if (o != null && o.getClass() == DestinationInfo.class) { processDestinationInfo((DestinationInfo)o); } else { //This can happen across networks if (LOG.isDebugEnabled()) { LOG.debug("Unexpected message was dispatched to the AdvisoryConsumer: "+md); } } }
this.connection.asyncSendPacket(info); LOG.debug("{} started XA transaction {}", this, transactionId); } catch (JMSException e) {
/** * Start a local transaction. * @throws javax.jms.JMSException on internal error */ public void begin() throws JMSException { if (isInXATransaction()) { throw new TransactionInProgressException("Cannot start local transaction. XA transaction is already in progress."); } if (transactionId == null) { synchronizations = null; beforeEndIndex = 0; setRollbackOnly(false); this.transactionId = new LocalTransactionId(getConnectionId(), localTransactionIdGenerator.getNextSequenceId()); TransactionInfo info = new TransactionInfo(getConnectionId(), transactionId, TransactionInfo.BEGIN); this.connection.ensureConnectionInfoSent(); this.connection.asyncSendPacket(info); // Notify the listener that the tx was started. if (localTransactionEventListener != null) { localTransactionEventListener.beginEvent(); } LOG.debug("Begin:{}", transactionId); } }
asyncSendPacket(msg); } else { syncSendPacket(msg);
/** * Construct the Session * * @param connection * @param sessionId * @param acknowledgeMode n.b if transacted - the acknowledgeMode == * Session.SESSION_TRANSACTED * @param asyncDispatch * @param sessionAsyncDispatch * @throws JMSException on internal error */ protected ActiveMQSession(ActiveMQConnection connection, SessionId sessionId, int acknowledgeMode, boolean asyncDispatch, boolean sessionAsyncDispatch) throws JMSException { this.debug = LOG.isDebugEnabled(); this.connection = connection; this.acknowledgementMode = acknowledgeMode; this.asyncDispatch = asyncDispatch; this.sessionAsyncDispatch = sessionAsyncDispatch; this.info = new SessionInfo(connection.getConnectionInfo(), sessionId.getValue()); setTransactionContext(new TransactionContext(connection)); stats = new JMSSessionStatsImpl(producers, consumers); this.connection.asyncSendPacket(info); setTransformer(connection.getTransformer()); setBlobTransferPolicy(connection.getBlobTransferPolicy()); this.connectionExecutor=connection.getExecutor(); this.executor = new ActiveMQSessionExecutor(this); connection.addSession(this); if (connection.isStarted()) { start(); } }
this.connection.asyncSendPacket(msg); if (producerWindow != null) {
/** * Send the asynchronous command. * * @param command - command to be executed. * @throws JMSException */ public void asyncSendPacket(Command command) throws JMSException { connection.asyncSendPacket(command); }
/** * Send the asynchronous command. * * @param command - command to be executed. * @throws JMSException */ public void asyncSendPacket(Command command) throws JMSException { connection.asyncSendPacket(command); }
/** * Send the asynchronous command. * * @param command - command to be executed. * @throws JMSException */ public void asyncSendPacket(Command command) throws JMSException { connection.asyncSendPacket(command); }
public synchronized void dispose() { if (!closed) { try { this.connection.asyncSendPacket(info.createRemoveCommand()); } catch (JMSException e) { LOG.debug("Failed to send remove command: " + e, e); } this.connection.removeDispatcher(info.getConsumerId()); closed = true; } }
public synchronized void dispose() { if (!closed) { try { this.connection.asyncSendPacket(info.createRemoveCommand()); } catch (JMSException e) { LOG.debug("Failed to send remove command: " + e, e); } this.connection.removeDispatcher(info.getConsumerId()); closed = true; } }
public synchronized void dispose() { if (!closed) { try { this.connection.asyncSendPacket(info.createRemoveCommand()); } catch (JMSException e) { LOG.debug("Failed to send remove command: " + e, e); } this.connection.removeDispatcher(info.getConsumerId()); closed = true; } }
public synchronized void dispose() { if (!closed) { try { this.connection.asyncSendPacket(info.createRemoveCommand()); } catch (JMSException e) { LOG.debug("Failed to send remove command: " + e, e); } this.connection.removeDispatcher(info.getConsumerId()); closed = true; } }
private void doClose() throws JMSException { dispose(); RemoveInfo removeCommand = info.createRemoveCommand(); removeCommand.setLastDeliveredSequenceId(lastDeliveredSequenceId); connection.asyncSendPacket(removeCommand); }
private void doClose() throws JMSException { dispose(); RemoveInfo removeCommand = info.createRemoveCommand(); removeCommand.setLastDeliveredSequenceId(lastDeliveredSequenceId); connection.asyncSendPacket(removeCommand); }
private void doClose() throws JMSException { dispose(); RemoveInfo removeCommand = info.createRemoveCommand(); removeCommand.setLastDeliveredSequenceId(lastDeliveredSequenceId); connection.asyncSendPacket(removeCommand); }