/** * @return Returns the clientID of the connection, forcing one to be * generated if one has not yet been configured. */ public String getInitializedClientID() throws JMSException { ensureConnectionInfoSent(); return info.getClientId(); }
/** * Starts (or restarts) a connection's delivery of incoming messages. A call * to <CODE>start</CODE> on a connection that has already been started is * ignored. * * @throws JMSException if the JMS provider fails to start message delivery * due to some internal error. * @see javax.jms.Connection#stop() */ @Override public void start() throws JMSException { checkClosedOrFailed(); ensureConnectionInfoSent(); if (started.compareAndSet(false, true)) { for (Iterator<ActiveMQSession> i = sessions.iterator(); i.hasNext();) { ActiveMQSession session = i.next(); session.start(); } } }
@Override public Xid[] recover(int flag) throws XAException { LOG.debug("recover({})", flag); XATransactionId[] answer; if (XAResource.TMNOFLAGS == flag) { // signal next in cursor scan, which for us is always the end b/c we don't maintain any cursor state // allows looping scan to complete answer = new XATransactionId[0]; } else { TransactionInfo info = new TransactionInfo(getConnectionId(), null, TransactionInfo.RECOVER); try { this.connection.checkClosedOrFailed(); this.connection.ensureConnectionInfoSent(); DataArrayResponse receipt = (DataArrayResponse) this.connection.syncSendPacket(info); DataStructure[] data = receipt.getData(); if (data instanceof XATransactionId[]) { answer = (XATransactionId[]) data; } else { answer = new XATransactionId[data.length]; System.arraycopy(data, 0, answer, 0, data.length); } } catch (JMSException e) { throw toXAException(e); } } LOG.debug("recover({})={}", flag, answer); return answer; }
this.connection.ensureConnectionInfoSent();
this.connection.ensureConnectionInfoSent();
this.connection.ensureConnectionInfoSent(); } catch (JMSException e) { disassociate();
public void destroyDestination(ActiveMQDestination destination) throws JMSException { checkClosedOrFailed(); ensureConnectionInfoSent(); DestinationInfo info = new DestinationInfo(); info.setConnectionId(this.info.getConnectionId()); info.setOperationType(DestinationInfo.REMOVE_OPERATION_TYPE); info.setDestination(destination); info.setTimeout(0); syncSendPacket(info); }
/** * 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); } }
public Session createSession(boolean transacted, int acknowledgeMode) throws JMSException { checkClosedOrFailed(); ensureConnectionInfoSent(); if (!transacted) { if (acknowledgeMode == Session.SESSION_TRANSACTED) {
public ConnectionConsumer createConnectionConsumer(Destination destination, String messageSelector, ServerSessionPool sessionPool, int maxMessages, boolean noLocal) throws JMSException { checkClosedOrFailed(); ensureConnectionInfoSent(); ConsumerId consumerId = createConsumerId(); ConsumerInfo consumerInfo = new ConsumerInfo(consumerId); consumerInfo.setDestination(ActiveMQMessageTransformation.transformDestination(destination)); consumerInfo.setSelector(messageSelector); consumerInfo.setPrefetchSize(maxMessages); consumerInfo.setNoLocal(noLocal); consumerInfo.setDispatchAsync(isDispatchAsync()); // Allows the options on the destination to configure the consumerInfo if (consumerInfo.getDestination().getOptions() != null) { Map<String, String> options = new HashMap<>(consumerInfo.getDestination().getOptions()); IntrospectionSupport.setProperties(consumerInfo, options, "consumer."); } return new ActiveMQConnectionConsumer(this, sessionPool, consumerInfo); }
ensureConnectionInfoSent(); SessionId sessionId = new SessionId(info.getConnectionId(), -1); ConsumerInfo info = new ConsumerInfo(new ConsumerId(sessionId, consumerIdGenerator.getNextSequenceId()));
/** * @return Returns the clientID of the connection, forcing one to be * generated if one has not yet been configured. */ public String getInitializedClientID() throws JMSException { ensureConnectionInfoSent(); return info.getClientId(); }
/** * @return Returns the clientID of the connection, forcing one to be * generated if one has not yet been configured. */ public String getInitializedClientID() throws JMSException { ensureConnectionInfoSent(); return info.getClientId(); }
/** * @return Returns the clientID of the connection, forcing one to be * generated if one has not yet been configured. */ public String getInitializedClientID() throws JMSException { ensureConnectionInfoSent(); return info.getClientId(); }
/** * @return Returns the clientID of the connection, forcing one to be * generated if one has not yet been configured. */ public String getInitializedClientID() throws JMSException { ensureConnectionInfoSent(); return info.getClientId(); }
private InputStream doCreateInputStream(Destination dest, String messageSelector, boolean noLocal, String subName, long timeout) throws JMSException { checkClosedOrFailed(); ensureConnectionInfoSent(); return new ActiveMQInputStream(this, createConsumerId(), ActiveMQDestination.transform(dest), messageSelector, noLocal, subName, prefetchPolicy.getInputStreamPrefetch(), timeout); }
public void destroyDestination(ActiveMQDestination destination) throws JMSException { checkClosedOrFailed(); ensureConnectionInfoSent(); DestinationInfo info = new DestinationInfo(); info.setConnectionId(this.info.getConnectionId()); info.setOperationType(DestinationInfo.REMOVE_OPERATION_TYPE); info.setDestination(destination); info.setTimeout(0); syncSendPacket(info); }
public void destroyDestination(ActiveMQDestination destination) throws JMSException { checkClosedOrFailed(); ensureConnectionInfoSent(); DestinationInfo info = new DestinationInfo(); info.setConnectionId(this.info.getConnectionId()); info.setOperationType(DestinationInfo.REMOVE_OPERATION_TYPE); info.setDestination(destination); info.setTimeout(0); syncSendPacket(info); }
public void destroyDestination(ActiveMQDestination destination) throws JMSException { checkClosedOrFailed(); ensureConnectionInfoSent(); DestinationInfo info = new DestinationInfo(); info.setConnectionId(this.info.getConnectionId()); info.setOperationType(DestinationInfo.REMOVE_OPERATION_TYPE); info.setDestination(destination); info.setTimeout(0); syncSendPacket(info); }