org.exolab.castor.mapping
Class AccessMode

java.lang.Object
  extended byorg.exolab.castor.mapping.AccessMode

public class AccessMode
extends java.lang.Object

The access mode for a class. This object is used by class descriptors to specify the access mode for a class.

In persistent storage each class is defined as having one of three access modes:

Transactions typically access objects based on the specified access mode. A transaction may be requested to access any object as read only or exclusive, but may not access exclusive objects as shared.

Version:
$Revision: 1.1.1.1 $ $Date: 2003/03/03 07:08:26 $
Author:
Assaf Arkin

Field Summary
static AccessMode DbLocked
          DbLocked access.
static AccessMode Exclusive
          Exclusive access.
static AccessMode ReadOnly
          Read only access.
static AccessMode Shared
          Shared access.
 
Method Summary
static AccessMode getAccessMode(java.lang.String accessMode)
          Returns the access mode from the name.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ReadOnly

public static final AccessMode ReadOnly
Read only access. Objects can be read but are not made persistent and changes to objects are not reflected in persistent storage.


Shared

public static final AccessMode Shared
Shared access. Objects can be read by multiple concurrent transactions. Equivalent to optimistic locking.


Exclusive

public static final AccessMode Exclusive
Exclusive access. Objects can be access by a single transaction at any given time. Equivalent to pessimistic locking.


DbLocked

public static final AccessMode DbLocked
DbLocked access. Objects can be access by a single transaction at any given time, and a lock is acquired in the database.

Method Detail

getAccessMode

public static AccessMode getAccessMode(java.lang.String accessMode)
Returns the access mode from the name. If accessMode is null, return the default access mode (Shared). Otherwise returns the named access mode.

Parameters:
accessMode - The access mode name
Returns:
The access mode

toString

public java.lang.String toString()


Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com