public final class DirtyShareFactory
extends java.lang.Object
DirtyShareContext
and DirtyShareManager
instances. The manager keeps a cache of
one of these instances for each database and provides the values at request until they are expressly
unregistered.Modifier and Type | Field and Description |
---|---|
private static java.util.Map<Database,DirtyShareManager> |
cache
Cache of
DefaultDirtyShareManager instances by database |
private static ContextLocal<java.util.Map<Database,DirtyShareContext>> |
local
Context local map of Databases to DirtyShareContext instances
|
private static java.util.Map<DirtyShareManager,Session> |
sessions
Map of DirtyShareManager to Session instances.
|
Constructor and Description |
---|
DirtyShareFactory() |
Modifier and Type | Method and Description |
---|---|
static DirtyShareContext |
getContextInstance(Database database)
Get the dirty share context for the given, primary database.
|
static DirtyShareManager |
getManagerInstance(Database database)
Get the dirty share manager for the given, primary database.
|
static boolean |
isUsedByManager(Database database,
Session session)
Determines whether the given session for the given database is used by the dirty share manager for this
database.
|
static void |
unregisterContextInstance(Database database)
Removes the dirty share share context for the given database from the local cache, if any.
|
static void |
unregisterManagerForDatabase(Database database)
Removes the dirty share manager for the given database from the shared cache, if any.
|
private static final java.util.Map<Database,DirtyShareManager> cache
DefaultDirtyShareManager
instances by databaseprivate static final java.util.Map<DirtyShareManager,Session> sessions
private static final ContextLocal<java.util.Map<Database,DirtyShareContext>> local
public static DirtyShareContext getContextInstance(Database database)
null
is returned.database
- Primary database which is the key for the dirty share context in the local cache. Use
PRIMARY_NON_DIRTY
database type to request a NOP context for primary permanent tables
that are marked as non DIRTY-READ.public static void unregisterContextInstance(Database database)
database
- Primary database which is the key for the dirty share context in the local cache.public static DirtyShareManager getManagerInstance(Database database)
DefaultDirtyShareManager
is returned. For remote databases,
an instance of RemoteDirtyShareManager
is returned.database
- Primary database which is the key for the dirty share manager in the shared cache. Use
PRIMARY_NON_DIRTY
database type to request a NOP context for primary permanent tables
that are marked as non DIRTY-READ.public static boolean isUsedByManager(Database database, Session session)
database
- Primary database which is the key for the dirty share manager in the shared cache.session
- Candidate for checking whether it is used by the shared manager.true
of the session is used by the dirty share manager for this database, false
otherwise.public static void unregisterManagerForDatabase(Database database)
database
- Primary database which is the key for the dirty share manager in the shared cache.