/** * Convenience method for obtaining the key created for the opList serial tests may put this key * on the BB for other threads to use for opList access */ public static String getOpListKey() { return OpListKey + Thread.currentThread().getName(); }
/** Convenience method for reading the list of operations for the current client thread. */ public static OpList getOpList() { Object key = OpListKey + Thread.currentThread().getName(); OpList opList = (OpList) (AsyncMsgBB.getBB().getSharedMap().get(key)); Log.getLogWriter().info("AsyncBB read from shared map key " + key + ", value " + opList); return opList; }
/** * Return the expected commit success/failure for the current thread. * * @returns true if the current thread should succeed in its commit, false otherwise. */ public static boolean getCommitStatus() { Object key = TxBB.CommitStatusKey + Thread.currentThread().getName(); Object result = TxBB.getBB().getSharedMap().get(key); if (result instanceof Boolean) return ((Boolean) result).booleanValue(); else throw new TestException("Unknown value " + result + " for TxBB sharedMap key " + key); }
/** Convenience method for writing a list of operations for the current client thread. */ public static void putOpList(OpList opList) { Object key = OpListKey + Thread.currentThread().getName(); AsyncMsgBB.getBB().getSharedMap().put(key, opList); Log.getLogWriter().info("AsyncBB put into shared map key " + key + ", value " + opList); }
/** * Write to the blackboard the expected commit success/failure for the current thread. * * @param expectCommitStatus True if we expect the current thread to successfully commit, false * otherwise. */ public static void recordCommitStatus(boolean expectCommitStatus) { Object key = TxBB.CommitStatusKey + Thread.currentThread().getName(); TxBB.getBB().getSharedMap().put(key, new Boolean(expectCommitStatus)); Log.getLogWriter().info("Written to TxBB: " + key + ", " + expectCommitStatus); }