public enum LocalLockMediators extends Enum<LocalLockMediators> implements LocalLockMediatorProvider
LocalLockMediator
instances.LocalLockMediatorProvider
Enum Constant and Description |
---|
INSTANCE |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Only use this in testing.
|
void |
clear(String namespace)
Only use this in testing.
|
<T> LocalLockMediator<T> |
get(String namespace,
TimestampProvider times)
Returns a the single
LocalLockMediator responsible for the
specified namespace . |
static LocalLockMediators |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static LocalLockMediators[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final LocalLockMediators INSTANCE
public static LocalLockMediators[] values()
for (LocalLockMediators c : LocalLockMediators.values()) System.out.println(c);
public static LocalLockMediators valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic <T> LocalLockMediator<T> get(String namespace, TimestampProvider times)
LocalLockMediatorProvider
LocalLockMediator
responsible for the
specified namespace
.
For any given namespace
, the same object must be returned every
time get(n)
is called, no matter what thread calls it or how many
times.
For any two unequal namespace strings n
and m
,
get(n)
must not equal get(m)
. in other words, each
namespace must have a distinct mediator.
get
in interface LocalLockMediatorProvider
namespace
- the arbitrary identifier for a local lock mediatornamespace
LocalLockMediator
public void clear()
This deletes the global map of namespaces to mediators. Calling this in production would result in undetected locking failures and data corruption.
public void clear(String namespace)
This deletes all entries in the global map of namespaces to mediators whose namespace key equals the argument.
namespace
- Copyright © 2012–2023. All rights reserved.