public void rollback() { if (oldValue != null) { NodeSPI targetNode = dataContainer.peek(fqn, false, true); if (targetNode != null) targetNode.putDirect(key, oldValue); } } }
public void rollback() { NodeSPI n = dataContainer.peek(fqn, false, false); if (n == null) throw new CacheException("node " + fqn + " not found for rollback!"); if (oldValue == null) { n.removeDirect(key); } else { n.putDirect(key, oldValue); } } }
public void rollback() { NodeSPI n = dataContainer.peek(fqn, false, false); if (n == null) throw new CacheException("node " + fqn + " not found for rollback!"); if (oldValue == null) { n.removeDirect(key); } else { n.putDirect(key, oldValue); } } }
/** * Puts the specified key and value into the data map in the node referenced by the specified Fqn. * * @param ctx invocation context * @return the value being overwritten, if any, otherwise a null. */ public Object perform(InvocationContext ctx) { if (trace) log.trace("Perform('" + globalTransaction + "', '" + fqn + "', k='" + key + "', v='" + value + "')"); NodeSPI n = ctx.lookUpNode(fqn); if (n == null) throw new NodeNotExistsException("Node " + fqn + " does not exist!"); if (notifier.shouldNotifyOnNodeModified()) { notifier.notifyNodeModified(fqn, true, NodeModifiedEvent.ModificationType.PUT_DATA, n.getDataDirect(), ctx); } Object oldValue = n.putDirect(key, value); if (trace) log.trace("Old value is " + oldValue + ", dataLoaded=" + n.isDataLoaded()); if (notifier.shouldNotifyOnNodeModified()) { Map newData = Collections.singletonMap(key, value); notifier.notifyNodeModified(fqn, false, NodeModifiedEvent.ModificationType.PUT_DATA, newData, ctx); } return oldValue; }