tecgraf.javautils.concurrent.locks
Enum LockPolicy

java.lang.Object
  extended by java.lang.Enum<LockPolicy>
      extended by tecgraf.javautils.concurrent.locks.LockPolicy
All Implemented Interfaces:
Serializable, Comparable<LockPolicy>

public enum LockPolicy
extends Enum<LockPolicy>

Política do Lock

Author:
Tecgraf

Enum Constant Summary
CONCURRENT_READ
          Leitor concorrente - Não pode haver locks exclusivos.
EXCLUSIVE
          Exclusivo - Não pode haver nenhum outro lock.
PROTECTED_READ
          Leitor protegido (Protected read - Shared) / Compartilhado - Não pode haver nenhum lock de escrita.
PROTECTED_WRITE
          Escritor protegido - Não pode haver nenhum outro lock de escrita (exclusiva ou protegida) e/ou de leitura protegida.
 
Method Summary
abstract  LockPolicy[] getIncompatibleLockPolicies()
          Retorna as políticas de lock incompatíveis com a política verificada
static LockPolicy valueOf(String name)
          Returns the enum constant of this type with the specified name.
static LockPolicy[] 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

EXCLUSIVE

public static final LockPolicy EXCLUSIVE
Exclusivo - Não pode haver nenhum outro lock. Porém, se houver reentrância, o usuário só obterá este tipo de lock se já tiver obtido um lock do tipo exclusivo.


PROTECTED_WRITE

public static final LockPolicy PROTECTED_WRITE
Escritor protegido - Não pode haver nenhum outro lock de escrita (exclusiva ou protegida) e/ou de leitura protegida. Porém, se houver reentrância, todos os locks de escrita devem pertencer ao usuário solicitante deste tipo de lock. Contudo, o usuário não poderá obter este tipo de lock se já tiver obtido um lock do tipo leitor protegido ou concorrente.


PROTECTED_READ

public static final LockPolicy PROTECTED_READ
Leitor protegido (Protected read - Shared) / Compartilhado - Não pode haver nenhum lock de escrita. Porém, se houver reentrância, todos os locks de escrita devem pertencer ao usuário solicitante deste tipo de lock. Contudo, o usuário não poderá obter este tipo de lock se já tiver obtido um lock do tipo leitor concorrente


CONCURRENT_READ

public static final LockPolicy CONCURRENT_READ
Leitor concorrente - Não pode haver locks exclusivos. Porém, se houver reentrância, todos os locks exclusivos devem pertencer ao usuário solicitante deste tipo de lock

Method Detail

values

public static LockPolicy[] 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 (LockPolicy c : LockPolicy.values())
    System.out.println(c);

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

valueOf

public static LockPolicy valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getIncompatibleLockPolicies

public abstract LockPolicy[] getIncompatibleLockPolicies()
Retorna as políticas de lock incompatíveis com a política verificada

Returns:
as políticas de lock incompatíveis com a política verificada


Copyright © 2014 Tecgraf/PUC-Rio. All rights reserved.