Search in sources :

Example 1 with CacheHashMap

use of com.sun.messaging.jmq.util.CacheHashMap in project openmq by eclipse-ee4j.

the class TransactionHandler method cacheSetState.

/**
 * We cache the last N transactions to be committed or rolledback. This is simply to let us more easily debug problems
 * when the client sends a bogus transaction ID.
 *
 * To improve performance, this feature should be disabled by setting the "imq.transaction.debug" property to false. For
 * now, it will be disabled by default to improve direct mode benchmark performance.
 */
private void cacheSetState(TransactionUID id, TransactionState ts, IMQConnection con) {
    // Do this only if transaction debug is enabled!
    if (GlobalProperties.getGlobalProperties().TRANSACTION_DEBUG) {
        if (con == null) {
            return;
        }
        CacheHashMap cache = (CacheHashMap) con.getClientData(IMQConnection.TRANSACTION_CACHE);
        if (cache == null) {
            cache = new CacheHashMap(4);
            con.addClientData(IMQConnection.TRANSACTION_CACHE, cache);
        }
        cache.put(id, ts);
    }
}
Also used : CacheHashMap(com.sun.messaging.jmq.util.CacheHashMap)

Aggregations

CacheHashMap (com.sun.messaging.jmq.util.CacheHashMap)1