org.inria.ns.reflex.processor.xcl
Class OperationsAction.Deferred

java.lang.Object
  extended by org.inria.ns.reflex.processor.core.AbstractAction
      extended by org.inria.ns.reflex.processor.xcl.OperationsAction
          extended by org.inria.ns.reflex.processor.xcl.OperationsAction.Deferred
All Implemented Interfaces:
Executable, Presentable, NamespaceContextFactory
Enclosing class:
OperationsAction

public static class OperationsAction.Deferred
extends OperationsAction

A deferred update action doesn't perform updates immediatly, but registers them. On commit request, the operations are applied. On rollback request, the operations are cancelled.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.inria.ns.reflex.processor.xcl.OperationsAction
OperationsAction.Deferred
 
Nested classes/interfaces inherited from class org.inria.ns.reflex.processor.core.AbstractAction
AbstractAction.ParameterAdapter, AbstractAction.UselessAction
 
Field Summary
 
Fields inherited from class org.inria.ns.reflex.processor.core.AbstractAction
actions, parent, processorInstance
 
Constructor Summary
OperationsAction.Deferred(Node node, AbstractAction parent)
          Creates a new instance of OperationsAction.Deferred.
 
Method Summary
static void commitOperations(DataSet dataSet)
          Apply all registered operations.
static void register(DataSet dataSet, DeferredOperation operation)
          Registers a new operation to apply later.
static void rollbackOperations(DataSet dataSet)
          Cancel all registered operations.
 void runAction(DataSet dataSet)
          Execute the action by registering update requests and performing safely all registered operations when all references have been computed.
 
Methods inherited from class org.inria.ns.reflex.processor.xcl.OperationsAction
unmarshal
 
Methods inherited from class org.inria.ns.reflex.processor.core.AbstractAction
addAction, addFallbackAction, createContext, getCanonicalPath, getFallbackAction, getLocalFallbackAction, getLogger, getNamespaceContext, getNode, getParent, recover, recover, removeFallbackAction, reorganize, run, runActions, toPrettyString, toPrettyString, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OperationsAction.Deferred

public OperationsAction.Deferred(Node node,
                                 AbstractAction parent)
Creates a new instance of OperationsAction.Deferred.

Parameters:
node - The node from which the action has been unmarshalled. Used for namespace prefix resolution when performing XPath expressions.
parent - The action depending from.
Method Detail

runAction

public void runAction(DataSet dataSet)
               throws ExecutionException,
                      XPathException
Execute the action by registering update requests and performing safely all registered operations when all references have been computed.

Overrides:
runAction in class AbstractAction
Parameters:
dataSet - The set of datas used when the action is running.
Throws:
ExecutionException - If the action can't be performed.
XPathException

commitOperations

public static void commitOperations(DataSet dataSet)
Apply all registered operations.

Parameters:
dataSet - The set of datas used when the action is running.

rollbackOperations

public static void rollbackOperations(DataSet dataSet)
Cancel all registered operations.

Parameters:
dataSet - The set of datas used when the action is running.

register

public static void register(DataSet dataSet,
                            DeferredOperation operation)
Registers a new operation to apply later.

Parameters:
dataSet - The set of datas used when the action is running.
operation - The deferred operation to apply on commit request.