public final class DirtyShareFactory
extends java.lang.Object
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)
database
- Primary database which is the key for the dirty share context
in the local cache.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.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 maanger.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.