com.j_spaces.core.client
Class ReadModifiers

java.lang.Object
  extended by com.j_spaces.core.client.ReadModifiers

public class ReadModifiers
extends Object

The ReadModifiers class provides static methods and constants to decode Read type modifiers. The sets of modifiers are represented as integers with distinct bit positions representing different modifiers.

You could use bitwise or operator "|" to unite different modifiers.
Note that REPEATABLE_READ, DIRTY_READ and READ_COMMITTED are mutually exclusive (i.e. can't be used together). While EXCLUSIVE_READ_LOCK can be joined with any of them.

These modifiers can be set either at the proxy level IProxyAdmin.setReadModifiers(int) or at the operation level (e.g. using one of IJSpace read/readIfExists/readMultiple/count methods with a modifiers parameter )

The default behavior is that of the REPEATABLE_READ modifier (as defined by the JavaSpace specification ).

Since:
6.0
See Also:
IProxyAdmin.setReadModifiers(int)

Field Summary
static int DIRTY_READ
          Allows non-transactional read operations to have full visibility of the entities in the space, including entities that are exclusively-locked.
static int EXCLUSIVE_READ_LOCK
          Allows read operations to have exclusive visibility of entities that are not locked by active transactions.
static int MATCH_BY_ID
          The int value required matching to be done only by UID if provided (not in POJO) modifier.
static int READ_COMMITTED
          Allows read operations to have visibility of already committed entities, regardless of the fact that these entities might be updated (with a newer version) or taken under an uncommitted transaction.
static int REPEATABLE_READ
          Allows read operations to have visibility of entities that are not write-locked or exclusively-locked by active transactions.
static int THROW_PARTIAL_FAILURE
          A modifier passed to read multiple and take multiple operations.
 
Method Summary
static boolean isDirtyRead(int mod)
          Checks if the DIRTY_READ bit was set for this modifier.
static boolean isExclusiveReadLock(int mod)
          Checks if the EXCLUSIVE_READ_LOCK bit was set for this modifier.
static boolean isMatchByID(int mod)
           
static boolean isReadCommitted(int mod)
          Checks if the READ_COMMITTED bit was set for this modifier.
static boolean isThrowPartialFailure(int mod)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REPEATABLE_READ

public static final int REPEATABLE_READ
Allows read operations to have visibility of entities that are not write-locked or exclusively-locked by active transactions.
This is the default read isolation-level.

See Also:
Constant Field Values

DIRTY_READ

public static final int DIRTY_READ
Allows non-transactional read operations to have full visibility of the entities in the space, including entities that are exclusively-locked.

See Also:
Constant Field Values

EXCLUSIVE_READ_LOCK

public static final int EXCLUSIVE_READ_LOCK
Allows read operations to have exclusive visibility of entities that are not locked by active transactions. Once exclusively locked, no other transactional operation is allowed. This supports the ability to perform reads in a "SELECT FOR UPDATE" fashion.

See Also:
Constant Field Values

READ_COMMITTED

public static final int READ_COMMITTED
Allows read operations to have visibility of already committed entities, regardless of the fact that these entities might be updated (with a newer version) or taken under an uncommitted transaction.

See Also:
Constant Field Values

MATCH_BY_ID

public static final int MATCH_BY_ID
The int value required matching to be done only by UID if provided (not in POJO) modifier.

See Also:
Constant Field Values

THROW_PARTIAL_FAILURE

public static final int THROW_PARTIAL_FAILURE
A modifier passed to read multiple and take multiple operations. The modifier will cause QueryMultiplePartialFailureException to be thrown when not all of the requested number of entries are returned and one or more cluster members are not available.

See Also:
Constant Field Values
Method Detail

isDirtyRead

public static boolean isDirtyRead(int mod)
Checks if the DIRTY_READ bit was set for this modifier.

Parameters:
mod - a set of modifiers
Returns:
true if mod includes the DIRTY_READ bit is set.

isExclusiveReadLock

public static boolean isExclusiveReadLock(int mod)
Checks if the EXCLUSIVE_READ_LOCK bit was set for this modifier.

Parameters:
mod - a set of modifiers
Returns:
true if mod includes the EXCLUSIVE_READ_LOCK bit is set.

isReadCommitted

public static boolean isReadCommitted(int mod)
Checks if the READ_COMMITTED bit was set for this modifier.

Parameters:
mod - a set of modifiers
Returns:
true if mod includes the READ_COMMITTED bit is set.

isMatchByID

public static boolean isMatchByID(int mod)
Parameters:
mod - a set of modifiers
Returns:
true if mod includes the MATCH_BY_UID modifier; false otherwise.

isThrowPartialFailure

public static boolean isThrowPartialFailure(int mod)