Author: michiel Date: 2010-03-23 18:51:00 +0100 (Tue, 23 Mar 2010) New Revision: 41576
Modified: mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/module/core/TransactionManager.java Log: forgot to send also the Cancel event. Also removed the anonymous implementation of Map. Modified: mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/module/core/TransactionManager.java =================================================================== --- mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/module/core/TransactionManager.java 2010-03-23 17:40:50 UTC (rev 41575) +++ mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/module/core/TransactionManager.java 2010-03-23 17:51:00 UTC (rev 41576) @@ -10,6 +10,7 @@ package org.mmbase.module.core; import java.util.*; +import org.mmbase.util.BijectiveMap; import org.mmbase.module.corebuilders.*; import org.mmbase.core.event.*; @@ -208,6 +209,7 @@ if (log.isDebugEnabled()) { log.debug("Removed transaction (after cancel) " + transactionName + "\n" + transaction); } + EventManager.getInstance().propagateEvent(new TransactionEvent.Cancel(transactionName)); return transactionName; } @@ -223,32 +225,12 @@ if (transaction instanceof Vector) { // a bit of a trick to see if it is committed already try { final Map<String, Integer> resolution = getTransactionResolver().resolve(transaction); - Map<Integer, Integer> integerResolution = new AbstractMap<Integer, Integer>() { - public Set<Map.Entry<Integer, Integer>> entrySet() { - return new AbstractSet<Map.Entry<Integer, Integer>>() { - public int size() { - return resolution.size(); - } - public Iterator<Map.Entry<Integer, Integer>> iterator() { - return new Iterator<Map.Entry<Integer, Integer>>() { - private final Iterator<Map.Entry<String, Integer>> i = resolution.entrySet().iterator(); - public boolean hasNext() { - return i.hasNext(); - } - public Map.Entry<Integer, Integer> next() { - Map.Entry<String, Integer> e = i.next(); - return new org.mmbase.util.Entry<Integer, Integer>(Integer.parseInt(e.getKey().substring(transactionName.length() + 1)), - e.getValue()); - } - public void remove() { - throw new UnsupportedOperationException(); - } - }; - } - }; - } - }; + // as resolution, but where the keys are integers (so not prefixed with the transaction name) + BijectiveMap<Integer, Integer> integerResolution = new BijectiveMap<Integer, Integer>(); + for (Map.Entry<String, Integer> e : resolution.entrySet()) { + integerResolution.put(Integer.parseInt(e.getKey().substring(transactionName.length() + 1)), e.getValue()); + } EventManager.getInstance().propagateEvent(new TransactionEvent.Resolve(transactionName, integerResolution)); } catch (TransactionManagerException te) { throw new TransactionManagerException("Can't resolve transaction " + transactionName + " (it has " + transaction.size() + " nodes)", te); _______________________________________________ Cvs mailing list Cvs@lists.mmbase.org http://lists.mmbase.org/mailman/listinfo/cvs