task = new RemoveDeliveryTask(tx); txToRemoveDeliveryTasks.put(tx, task); tx.addPostCommitTask(task);
callback = new RemoveDeliveryCallback(tx); txToRemoveDeliveryTasks.put(tx, callback); tx.addCallback(callback);
   protected RemoveDeliveryTask addRemoveDeliveryTask(Transaction tx)   {      //TODO we could avoid this lookup by letting the tx object store the RemoveDeliveryTask      RemoveDeliveryTask task = (RemoveDeliveryTask)txToRemoveDeliveryTasks.get(tx);      if (task == null)      {         task = new RemoveDeliveryTask(tx);         txToRemoveDeliveryTasks.put(tx, task);         tx.addPostCommitTask(task);      }      return task;   }