Search in sources :

Example 16 with TransactionInfo

use of com.sun.messaging.jmq.jmsserver.persist.api.TransactionInfo in project openmq by eclipse-ee4j.

the class TidList method getAllTransactionStates.

/**
 * Retrieve all local and cluster transaction ids with their state in the store.
 *
 * @return A HashMap. The key is a TransactionUID. The value is a TransactionState.
 * @exception IOException if an error occurs while getting the data
 */
HashMap getAllTransactionStates() throws IOException {
    HashMap map = new HashMap(tidMap.size());
    Iterator itr = tidMap.entrySet().iterator();
    while (itr.hasNext()) {
        Map.Entry entry = (Map.Entry) itr.next();
        TransactionInfo txnInfo = (TransactionInfo) entry.getValue();
        int type = txnInfo.getType();
        if (type == TransactionInfo.TXN_LOCAL || type == TransactionInfo.TXN_CLUSTER) {
            map.put(entry.getKey(), (new TransactionInfo(txnInfo)));
        }
    }
    return map;
}
Also used : PHashMap(com.sun.messaging.jmq.io.disk.PHashMap) TransactionInfo(com.sun.messaging.jmq.jmsserver.persist.api.TransactionInfo) PHashMap(com.sun.messaging.jmq.io.disk.PHashMap)

Example 17 with TransactionInfo

use of com.sun.messaging.jmq.jmsserver.persist.api.TransactionInfo in project openmq by eclipse-ee4j.

the class TidList method getAllRemoteTransactionStates.

/**
 * Retrieve all remote transaction ids with their state in the store.
 *
 * @return A HashMap. The key is a TransactionUID. The value is a TransactionState.
 * @exception IOException if an error occurs while getting the data
 */
HashMap getAllRemoteTransactionStates() throws IOException {
    HashMap map = new HashMap(tidMap.size());
    Iterator itr = tidMap.entrySet().iterator();
    while (itr.hasNext()) {
        Map.Entry entry = (Map.Entry) itr.next();
        TransactionInfo txnInfo = (TransactionInfo) entry.getValue();
        int type = txnInfo.getType();
        if (type == TransactionInfo.TXN_REMOTE) {
            map.put(entry.getKey(), (new TransactionState(txnInfo.getTransactionState())));
        }
    }
    return map;
}
Also used : TransactionState(com.sun.messaging.jmq.jmsserver.data.TransactionState) PHashMap(com.sun.messaging.jmq.io.disk.PHashMap) TransactionInfo(com.sun.messaging.jmq.jmsserver.persist.api.TransactionInfo) PHashMap(com.sun.messaging.jmq.io.disk.PHashMap)

Aggregations

TransactionInfo (com.sun.messaging.jmq.jmsserver.persist.api.TransactionInfo)17 TransactionState (com.sun.messaging.jmq.jmsserver.data.TransactionState)8 LoadException (com.sun.messaging.jmq.jmsserver.persist.api.LoadException)6 PHashMapLoadException (com.sun.messaging.jmq.io.disk.PHashMapLoadException)5 PHashMap (com.sun.messaging.jmq.io.disk.PHashMap)4 TransactionBroker (com.sun.messaging.jmq.jmsserver.data.TransactionBroker)4 TransactionUID (com.sun.messaging.jmq.jmsserver.data.TransactionUID)4 IOException (java.io.IOException)4 SysMessageID (com.sun.messaging.jmq.io.SysMessageID)3 ConsumerUID (com.sun.messaging.jmq.jmsserver.core.ConsumerUID)3 Iterator (java.util.Iterator)3 JMSBridgeStore (com.sun.messaging.bridge.api.JMSBridgeStore)2 Packet (com.sun.messaging.jmq.io.Packet)2 PHashMapMMF (com.sun.messaging.jmq.io.disk.PHashMapMMF)2 Consumer (com.sun.messaging.jmq.jmsserver.core.Consumer)2 Destination (com.sun.messaging.jmq.jmsserver.core.Destination)2 DestinationUID (com.sun.messaging.jmq.jmsserver.core.DestinationUID)2 TransactionAcknowledgement (com.sun.messaging.jmq.jmsserver.data.TransactionAcknowledgement)2 ChangeRecordInfo (com.sun.messaging.jmq.jmsserver.persist.api.ChangeRecordInfo)2 HABrokerInfo (com.sun.messaging.jmq.jmsserver.persist.api.HABrokerInfo)2