public enum NoOpSynchronizer extends Enum<NoOpSynchronizer> implements Synchronizer
An implementation of the Synchronizer interface which does not perform any synchronization.
This class is the option of choice for applications that do not access configuration concurrently. All methods
required by the Synchronizer interface are just empty dummies. Therefore, this class does not have any
synchronization overhead. Of course, configurations using this Synchronizer implementation are not
thread-safe!
Implementation note: This class is an enumeration because only a single instance needs to exist. This instance can be shared between arbitrary configurations.
| Enum Constant and Description |
|---|
INSTANCE
The single shared instance of this class.
|
| Modifier and Type | Method and Description |
|---|---|
void |
beginRead()
Notifies this
Synchronizer that the current thread is going to start a read operation on the managed
configuration. |
void |
beginWrite()
Notifies this
Synchronizer that the current thread is going to start a write operation on the managed
configuration. |
void |
endRead()
Notifies this
Synchronizer that the current thread has finished its read operation. |
void |
endWrite()
Notifies this
Synchronizer that the current thread has finished its write operation. |
static NoOpSynchronizer |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static NoOpSynchronizer[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final NoOpSynchronizer INSTANCE
public static NoOpSynchronizer[] values()
for (NoOpSynchronizer c : NoOpSynchronizer.values()) System.out.println(c);
public static NoOpSynchronizer 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 void beginRead()
SynchronizerSynchronizer that the current thread is going to start a read operation on the managed
configuration. This call can block if a concrete implementation decides that the thread has to wait until a specific
condition is fulfilled.beginRead in interface Synchronizerpublic void endRead()
SynchronizerSynchronizer that the current thread has finished its read operation. This may cause other
waiting threads to be granted access to the managed configuration.endRead in interface Synchronizerpublic void beginWrite()
SynchronizerSynchronizer that the current thread is going to start a write operation on the managed
configuration. This call may block. For instance, a concrete implementation may suspend the thread until all read
operations currently active are finished,beginWrite in interface Synchronizerpublic void endWrite()
SynchronizerSynchronizer that the current thread has finished its write operation. This may cause other
waiting threads to be granted access to the managed configuration.endWrite in interface SynchronizerCopyright © 2001–2022 The Apache Software Foundation. All rights reserved.