-
- All Superinterfaces:
ExclusiveSessionProvider,SessionTaskDispatcher,org.tentackle.task.TaskDispatcher,org.tentackle.daemon.Terminatable
public interface ModificationTracker extends SessionTaskDispatcher, ExclusiveSessionProvider
Tracks global PDO changes.The pro tracker maintains its own session. The application can request an exclusive use of this session for a (short) period of time and release it afterwards.
- Author:
- harald
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddModificationListener(ModificationListener listener)Adds a modification listener.voidaddShutdownRunnable(java.lang.Runnable runnable)Registers a pure runnable to be executed if the pdo tracker is terminated due to severe errors.longcountModification(Session session, java.lang.String name)Counts the modification for a given name.
Used to trigger modification events.static ModificationTrackergetInstance()The tracker singleton.longgetSerial(java.lang.Class<?> clazz)Gets the serial for a given class.longgetSerial(java.lang.String name)Gets the serial for a given modification name.voidinvalidate()Invalidates the tracker.
Forces the tracking info to be rebuilt.booleanremoveModificationListener(ModificationListener listener)Removes a modification listener.booleanremoveShutdownRunnable(java.lang.Runnable runnable)Unregisters a shutdown runnable.-
Methods inherited from interface org.tentackle.session.ExclusiveSessionProvider
releaseSession, requestSession
-
Methods inherited from interface org.tentackle.session.SessionTaskDispatcher
getSession, isSessionClosedOnTermination, isSessionKeptAlive, setSession, setSessionClosedOnTermination, setSessionKeptAlive
-
Methods inherited from interface org.tentackle.task.TaskDispatcher
addTask, addTaskAndWait, addTaskListener, getAllTasks, getDeadInterval, getQueueSize, getShutdownIdleTimeout, getSleepInterval, getTask, isAlive, isInstanceOfTaskPending, isQueueEmpty, isTaskPending, isUsingMutexLocking, lock, removeTask, removeTaskListener, setDeadInterval, setShutdownIdleTimeout, setSleepInterval, setUsingMutexLocking, start, toDiagnosticString, unlock, waitForTask
-
-
-
-
Method Detail
-
getInstance
static ModificationTracker getInstance()
The tracker singleton.- Returns:
- the singleton
-
addModificationListener
void addModificationListener(ModificationListener listener)
Adds a modification listener.- Parameters:
listener- the listener to add
-
removeModificationListener
boolean removeModificationListener(ModificationListener listener)
Removes a modification listener.- Parameters:
listener- to remove- Returns:
- true if removed
-
countModification
long countModification(Session session, java.lang.String name)
Counts the modification for a given name.
Used to trigger modification events.- Parameters:
session- the session persisting the modification, null if threadlocal sessionname- a unique name to track modifications- Returns:
- the modification serial
-
addShutdownRunnable
void addShutdownRunnable(java.lang.Runnable runnable)
Registers a pure runnable to be executed if the pdo tracker is terminated due to severe errors.- Parameters:
runnable- the runnable
-
removeShutdownRunnable
boolean removeShutdownRunnable(java.lang.Runnable runnable)
Unregisters a shutdown runnable.- Parameters:
runnable- the runnable- Returns:
- true if runnable removed
-
getSerial
long getSerial(java.lang.Class<?> clazz)
Gets the serial for a given class.- Parameters:
clazz- the tracked class- Returns:
- the table serial
-
getSerial
long getSerial(java.lang.String name)
Gets the serial for a given modification name.- Parameters:
name- the modification name- Returns:
- the table serial
-
invalidate
void invalidate()
Invalidates the tracker.
Forces the tracking info to be rebuilt.
-
-