- All Superinterfaces:
ExclusiveSessionProvider,SessionTaskDispatcher,TaskDispatcher,Terminatable
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 afterward.
- Author:
- harald
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddModificationListener(ModificationListener listener) Adds a modification listener.voidaddShutdownRunnable(Runnable runnable) Registers a pure runnable to be executed if the pdo tracker is terminated due to severe errors.longcountModification(Session session, String name) Counts the modification for a given name.
Used to trigger modification events.static ModificationTrackerThe tracker singleton.longGets the serial for a given class.longGets the serial for a given modification name.voidInvalidates the tracker.
Forces the tracking info to be rebuilt.booleanRemoves a modification listener.booleanremoveShutdownRunnable(Runnable runnable) Unregisters a shutdown runnable.static voidSubmits a task invoking given runnable.static voidtransaction(Runnable runnable) Submits a session task invoking the given runnable within a transaction of the tracker's session.static voidtransaction(String txName, Runnable runnable) Submits a session task invoking the given runnable within a transaction of the tracker's session.Methods inherited from interface org.tentackle.session.ExclusiveSessionProvider
releaseSession, requestSessionMethods inherited from interface org.tentackle.session.SessionTaskDispatcher
getSession, isSessionClosedOnTermination, isSessionKeptAlive, setSession, setSessionClosedOnTermination, setSessionKeptAliveMethods inherited from interface org.tentackle.task.TaskDispatcher
addTask, addTaskAndWait, addTaskListener, getAllTasks, getDeadInterval, getQueueSize, getShutdownIdleTimeout, getSleepInterval, getTask, getWaitInterval, isAlive, isInstanceOfTaskPending, isQueueEmpty, isTaskPending, isUsingMutexLocking, lock, removeTask, removeTaskListener, setDeadInterval, setShutdownIdleTimeout, setSleepInterval, setUsingMutexLocking, setWaitInterval, start, toDiagnosticString, unlock, waitForTaskMethods inherited from interface org.tentackle.daemon.Terminatable
isTerminationRequested, requestTermination, terminate
-
Method Details
-
getInstance
The tracker singleton.- Returns:
- the singleton
-
submit
Submits a task invoking given runnable.- Parameters:
runnable- the runnable to be executed once
-
transaction
Submits a session task invoking the given runnable within a transaction of the tracker's session.- Parameters:
txName- the transaction name, null if default"<ModificationTracker>"runnable- the runnable to be executed once
-
transaction
Submits a session task invoking the given runnable within a transaction of the tracker's session.- Parameters:
runnable- the runnable to be executed once
-
addModificationListener
Adds a modification listener.- Parameters:
listener- the listener to add
-
removeModificationListener
Removes a modification listener.- Parameters:
listener- to remove- Returns:
- true if removed
-
countModification
Counts the modification for a given name.
Used to trigger modification events.- Parameters:
session- the session persisting the modification, null if thread-local sessionname- a unique name to track modifications- Returns:
- the modification serial
-
addShutdownRunnable
Registers a pure runnable to be executed if the pdo tracker is terminated due to severe errors.- Parameters:
runnable- the runnable
-
removeShutdownRunnable
Unregisters a shutdown runnable.- Parameters:
runnable- the runnable- Returns:
- true if runnable removed
-
getSerial
Gets the serial for a given class.- Parameters:
clazz- the tracked class- Returns:
- the table serial
-
getSerial
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.
-