org.objectweb.speedo.api
Class LifeCycle

java.lang.Object
  |
  +--org.objectweb.speedo.api.LifeCycle

public abstract class LifeCycle
extends java.lang.Object

Representation of the life cycle of a JDO Instance.

Author:
Y. Devaux

Field Summary
static byte ACTION_COMMIT
           
static byte ACTION_COMMIT_RETAINVALUES
           
static byte ACTION_DELETEPERSISTENT
           
static byte ACTION_EVICT
           
static byte ACTION_MAKEDIRTY
           
static byte ACTION_MAKENONTRANSACTIONAL
           
static byte ACTION_MAKEPERSISTENT
           
static byte ACTION_MAKETRANSACTIONAL
           
static byte ACTION_MAKETRANSIENT
           
static byte ACTION_READFIELD_ACTIVEDATASTORETRANSACTION
           
static byte ACTION_READFIELD_ACTIVEOPTIMISTICTRANSACTION
           
static byte ACTION_READFIELD_OUTSIDETRANSACTION
           
static byte ACTION_REFRESH_ACTIVEDATASTORETRANSACTION
           
static byte ACTION_REFRESH_ACTIVEOPTIMISTICTRANSACTION
           
static byte ACTION_ROLLBACK
           
static byte ACTION_ROLLBACK_RETAINVALUES
           
static byte ACTION_WRITEFIELD_ACTIVEDATASTORETRANSACTION
           
static byte ACTION_WRITEFIELD_OUTSIDETRANSACTION
           
static byte ERROR
           
static byte HOLLOW
           
static byte NOT_APPLICABLE
           
static byte PERSISTENT_CLEAN
           
static byte PERSISTENT_DELETED
           
static byte PERSISTENT_DIRTY
           
static byte PERSISTENT_NEW
           
static byte PERSISTENT_NEW_DELETED
           
static byte PERSISTENT_NONTRANSACTIONAL
           
static byte TRANSIENT
           
static byte TRANSIENT_CLEAN
           
static byte TRANSIENT_DIRTY
           
 
Constructor Summary
LifeCycle()
           
 
Method Summary
static byte initState()
          Gets the initial state
static boolean isDeleted(byte status)
          Indicates if the instance is deleted
static boolean isDirty(byte status)
          Indicates if the instance is dirty
static boolean isNew(byte status)
          Indicates if the instance is new
static boolean isPersistent(byte status)
          Indicates if the instance is persistent
static boolean isTransactional(byte status)
          Indicates if the instance is transactional
static boolean isTransient(byte status)
          Indicates if the instance is transient
static byte makeDirty(byte status)
          Make the instance dirty.
static byte nextStatePersistenceCapable(byte status, byte action)
          Gets the state transition in the JDO instances life cycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOT_APPLICABLE

public static final byte NOT_APPLICABLE

ERROR

public static final byte ERROR

TRANSIENT

public static final byte TRANSIENT

TRANSIENT_CLEAN

public static final byte TRANSIENT_CLEAN

TRANSIENT_DIRTY

public static final byte TRANSIENT_DIRTY

PERSISTENT_NEW

public static final byte PERSISTENT_NEW

PERSISTENT_NONTRANSACTIONAL

public static final byte PERSISTENT_NONTRANSACTIONAL

PERSISTENT_CLEAN

public static final byte PERSISTENT_CLEAN

PERSISTENT_DIRTY

public static final byte PERSISTENT_DIRTY

HOLLOW

public static final byte HOLLOW

PERSISTENT_DELETED

public static final byte PERSISTENT_DELETED

PERSISTENT_NEW_DELETED

public static final byte PERSISTENT_NEW_DELETED

ACTION_MAKEPERSISTENT

public static final byte ACTION_MAKEPERSISTENT

ACTION_DELETEPERSISTENT

public static final byte ACTION_DELETEPERSISTENT

ACTION_MAKETRANSACTIONAL

public static final byte ACTION_MAKETRANSACTIONAL

ACTION_MAKENONTRANSACTIONAL

public static final byte ACTION_MAKENONTRANSACTIONAL

ACTION_MAKETRANSIENT

public static final byte ACTION_MAKETRANSIENT

ACTION_COMMIT

public static final byte ACTION_COMMIT

ACTION_COMMIT_RETAINVALUES

public static final byte ACTION_COMMIT_RETAINVALUES

ACTION_ROLLBACK

public static final byte ACTION_ROLLBACK

ACTION_ROLLBACK_RETAINVALUES

public static final byte ACTION_ROLLBACK_RETAINVALUES

ACTION_REFRESH_ACTIVEDATASTORETRANSACTION

public static final byte ACTION_REFRESH_ACTIVEDATASTORETRANSACTION

ACTION_REFRESH_ACTIVEOPTIMISTICTRANSACTION

public static final byte ACTION_REFRESH_ACTIVEOPTIMISTICTRANSACTION

ACTION_EVICT

public static final byte ACTION_EVICT

ACTION_READFIELD_OUTSIDETRANSACTION

public static final byte ACTION_READFIELD_OUTSIDETRANSACTION

ACTION_READFIELD_ACTIVEOPTIMISTICTRANSACTION

public static final byte ACTION_READFIELD_ACTIVEOPTIMISTICTRANSACTION

ACTION_READFIELD_ACTIVEDATASTORETRANSACTION

public static final byte ACTION_READFIELD_ACTIVEDATASTORETRANSACTION

ACTION_WRITEFIELD_ACTIVEDATASTORETRANSACTION

public static final byte ACTION_WRITEFIELD_ACTIVEDATASTORETRANSACTION

ACTION_WRITEFIELD_OUTSIDETRANSACTION

public static final byte ACTION_WRITEFIELD_OUTSIDETRANSACTION

ACTION_MAKEDIRTY

public static final byte ACTION_MAKEDIRTY
Constructor Detail

LifeCycle

public LifeCycle()
Method Detail

nextStatePersistenceCapable

public static byte nextStatePersistenceCapable(byte status,
                                               byte action)
Gets the state transition in the JDO instances life cycle
Parameters:
status - current instance status
action - method that is currently invoked
Returns:
the next state according to JDO rules

makeDirty

public static byte makeDirty(byte status)
Make the instance dirty.
Parameters:
status - current status
Returns:
new status

isPersistent

public static boolean isPersistent(byte status)
Indicates if the instance is persistent
Parameters:
status - current instance status
Returns:
true if the instance is persistent

isTransactional

public static boolean isTransactional(byte status)
Indicates if the instance is transactional
Parameters:
status - current instance status
Returns:
true if the instance is transactional

isNew

public static boolean isNew(byte status)
Indicates if the instance is new
Parameters:
status - current instance status
Returns:
true if the instance is bew

isDirty

public static boolean isDirty(byte status)
Indicates if the instance is dirty
Parameters:
status - current instance status
Returns:
true if the instance is dirty

isDeleted

public static boolean isDeleted(byte status)
Indicates if the instance is deleted
Parameters:
status - current instance status
Returns:
true if the instance is deleted

initState

public static byte initState()
Gets the initial state
Returns:
TRANSIENT

isTransient

public static boolean isTransient(byte status)
Indicates if the instance is transient
Parameters:
status - current instance status
Returns:
true if the instance is transient