com.tc.object.config
Class ConfigLockLevel

java.lang.Object
  extended by com.tc.object.config.ConfigLockLevel

public class ConfigLockLevel
extends java.lang.Object

Describe a lock level from a set of enumerated values. Use the static constants or the static factory method lockLevelByName(String) to get an instance. There are 8 types of locks defined in the config - these can all be applied to auto locks, but only the ones without AUTO_SYNCHRONIZED prefix can be used with named locks. From a concurrency perspective, there are four levels of locking that allow different amounts of access to a section:

In addition, for autolocks, there is an extra attribute called "auto-synhcronized" that indicates that the method should be made synchronized before auto-locking. This is useful in code you don't have control over that needs to be be made synchronized for use in a clustered environment.


Field Summary
static ConfigLockLevel AUTO_SYNCHRONIZED_CONCURRENT
          CONCURRENT lock, auto-synchronize=false
static ConfigLockLevel AUTO_SYNCHRONIZED_READ
          READ lock, auto-synchronize=false
static ConfigLockLevel AUTO_SYNCHRONIZED_SYNCHRONOUS_WRITE
          SYNCHRONOUS_WRITE lock, auto-synchronize=false
static ConfigLockLevel AUTO_SYNCHRONIZED_WRITE
          WRITE lock, auto-synchronize=true
static ConfigLockLevel CONCURRENT
          CONCURRENT lock, auto-synchronize=false
static ConfigLockLevel READ
          READ lock, auto-synchronize=false
static ConfigLockLevel SYNCHRONOUS_WRITE
          SYNCHRONOUS_WRITE lock, auto-synchronize=false
static ConfigLockLevel WRITE
          WRITE lock, auto-synchronize=false
 
Method Summary
 int getLockLevelAsInt()
           
static ConfigLockLevel lockLevelByName(java.lang.String typeName)
          Provide an instance of the constant for the specified name or null if name is invalid
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

WRITE

public static final ConfigLockLevel WRITE
WRITE lock, auto-synchronize=false


READ

public static final ConfigLockLevel READ
READ lock, auto-synchronize=false


CONCURRENT

public static final ConfigLockLevel CONCURRENT
CONCURRENT lock, auto-synchronize=false


SYNCHRONOUS_WRITE

public static final ConfigLockLevel SYNCHRONOUS_WRITE
SYNCHRONOUS_WRITE lock, auto-synchronize=false


AUTO_SYNCHRONIZED_WRITE

public static final ConfigLockLevel AUTO_SYNCHRONIZED_WRITE
WRITE lock, auto-synchronize=true


AUTO_SYNCHRONIZED_READ

public static final ConfigLockLevel AUTO_SYNCHRONIZED_READ
READ lock, auto-synchronize=false


AUTO_SYNCHRONIZED_CONCURRENT

public static final ConfigLockLevel AUTO_SYNCHRONIZED_CONCURRENT
CONCURRENT lock, auto-synchronize=false


AUTO_SYNCHRONIZED_SYNCHRONOUS_WRITE

public static final ConfigLockLevel AUTO_SYNCHRONIZED_SYNCHRONOUS_WRITE
SYNCHRONOUS_WRITE lock, auto-synchronize=false

Method Detail

getLockLevelAsInt

public int getLockLevelAsInt()
Returns:
Ordinal lock level value

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

lockLevelByName

public static ConfigLockLevel lockLevelByName(java.lang.String typeName)
Provide an instance of the constant for the specified name or null if name is invalid

Parameters:
typeName - Lock level name
Returns:
Lock level instance


Copyright © 2010 Terracotta, Inc.. All Rights Reserved.