/** * Receives a new MarketTransaction. We look to see whether an order we have placed has cleared. */ public synchronized void handleMessage(MarketTransaction tx) { // reset price escalation when a trade fully clears. Order lastTry = lastOrder.get(tx.getTimeslotIndex()); if (lastTry == null) // should not happen log.error("order corresponding to market tx " + tx + " is null"); else if (tx.getMWh() == lastTry.getMWh()) // fully cleared lastOrder.put(tx.getTimeslotIndex(), null); }