org.exist.collections.triggers
Class TriggerStatePerThread
java.lang.Object
org.exist.collections.triggers.TriggerStatePerThread
- public class TriggerStatePerThread
- extends java.lang.Object
Finite State Machine, managing the state of a Running trigger;
allows to avoid infinite recursions by forbidding another trigger to run
where there is allready one; feature trigger_update .
I implemented that when a trigger is running , another trigger in the same
Thread cannot be fired .
There is a second condition that when a trigger is running triggered by
some document d, even the same trigger cannot run on a different document .
maybe TODO: apply "state" design pattern
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NO_TRIGGER_RUNNING
public static final int NO_TRIGGER_RUNNING
- See Also:
- Constant Field Values
TRIGGER_RUNNING_PREPARE
public static final int TRIGGER_RUNNING_PREPARE
- See Also:
- Constant Field Values
TRIGGER_RUNNING_FINISH
public static final int TRIGGER_RUNNING_FINISH
- See Also:
- Constant Field Values
TriggerStatePerThread
public TriggerStatePerThread()
verifyUniqueTriggerPerThreadBeforePrepare
public static boolean verifyUniqueTriggerPerThreadBeforePrepare(DocumentTrigger trigger,
DocumentImpl modifiedDocument)
verifyUniqueTriggerPerThreadBeforeFinish
public static boolean verifyUniqueTriggerPerThreadBeforeFinish(DocumentTrigger trigger,
DocumentImpl modifiedDocument)
- Parameters:
modifiedDocument
- the document whose modification triggered the trigger
getTriggerRunningState
public static int getTriggerRunningState()
getRunningTrigger
public static DocumentTrigger getRunningTrigger()
setTriggerRunningState
public static void setTriggerRunningState(int state,
DocumentTrigger trigger,
DocumentImpl modifiedDocument)
getTransaction
public static Txn getTransaction()
setTransaction
public static void setTransaction(Txn transaction)
getModifiedDocument
public static DocumentImpl getModifiedDocument()
Copyright (C) Wolfgang Meier. All rights reserved.