org.electrocodeogram.cpc.core.api.provider.store
Enum IStoreProvider.LockMode

java.lang.Object
  extended by java.lang.Enum<IStoreProvider.LockMode>
      extended by org.electrocodeogram.cpc.core.api.provider.store.IStoreProvider.LockMode
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<IStoreProvider.LockMode>
Enclosing interface:
IStoreProvider

public static enum IStoreProvider.LockMode
extends java.lang.Enum<IStoreProvider.LockMode>

Determines the behaviour of the IStoreProvider.acquireWriteLock(LockMode) exclusive write lock.

See Also:
IStoreProvider.acquireWriteLock(LockMode), IStoreProvider.releaseWriteLock()

Enum Constant Summary
DEFAULT
          The default locking behaviour.
NO_MODIFICATION_EVENT
          A registered IStoreProviderWriteLockHook will be notified and will be given the opportunity to transfer any dirty clone data back to the store provider before this lock request is granted.
NO_WRITE_LOCK_HOOK_NOTIFY
          CloneModificationEvents for all modified clones will be generated when the lock is released.
NO_WRITE_LOCK_HOOK_NOTIFY_NO_MODIFICATION_EVENT
          Combination of NO_WRITE_LOCK_HOOK_NOTIFY and NO_MODIFICATION_EVENT.
 
Method Summary
static IStoreProvider.LockMode valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static IStoreProvider.LockMode[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

DEFAULT

public static final IStoreProvider.LockMode DEFAULT
The default locking behaviour.
A registered IStoreProviderWriteLockHook will be notified and will be given the opportunity to transfer any dirty clone data back to the store provider before this lock request is granted.
CloneModificationEvents for all modified clones will be generated when the lock is released.


NO_MODIFICATION_EVENT

public static final IStoreProvider.LockMode NO_MODIFICATION_EVENT
A registered IStoreProviderWriteLockHook will be notified and will be given the opportunity to transfer any dirty clone data back to the store provider before this lock request is granted.
No CloneModificationEvents will be generated. It is up to the caller to ensure that such events are generated and dispatched as required.


NO_WRITE_LOCK_HOOK_NOTIFY

public static final IStoreProvider.LockMode NO_WRITE_LOCK_HOOK_NOTIFY
CloneModificationEvents for all modified clones will be generated when the lock is released.
Does not notify a registered IStoreProviderWriteLockHook about the lock request.

IMPORTANT: This mode may only be used by the module which owns the currently registered write lock hook (in practice this means that it should not be used outside of CPC Track).

Rationale:

This mode allows the owner of the write lock hook which was registered via IStoreProvider.setWriteLockHook(IStoreProviderWriteLockHook) to acquire a lock without having to filter out its own lock requests in the write lock hook.


NO_WRITE_LOCK_HOOK_NOTIFY_NO_MODIFICATION_EVENT

public static final IStoreProvider.LockMode NO_WRITE_LOCK_HOOK_NOTIFY_NO_MODIFICATION_EVENT
Combination of NO_WRITE_LOCK_HOOK_NOTIFY and NO_MODIFICATION_EVENT.
Neither are CloneModificationEvents generated nor is any registered IStoreProviderWriteLockHook notified about this request.

Method Detail

values

public static IStoreProvider.LockMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (IStoreProvider.LockMode c : IStoreProvider.LockMode.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static IStoreProvider.LockMode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null