org.objectweb.speedo.mim.api
Class LifeCycle

java.lang.Object
  extended byorg.objectweb.speedo.mim.api.LifeCycle

public abstract class LifeCycle
extends java.lang.Object

Representation of the life cycle of a JDO Instance.

Author:
S.Chassande-Barrioz

Field Summary
static byte ACTION_COMMIT
           
static byte ACTION_COMMIT_RETAINVALUES
           
static byte ACTION_DELETEPERSISTENT
           
static byte ACTION_EVICT
           
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 java.lang.String actionToString(byte action)
           
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
static java.lang.String statusToString(byte status)
           
 
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
See Also:
Constant Field Values

ERROR

public static final byte ERROR
See Also:
Constant Field Values

TRANSIENT

public static final byte TRANSIENT
See Also:
Constant Field Values

TRANSIENT_CLEAN

public static final byte TRANSIENT_CLEAN
See Also:
Constant Field Values

TRANSIENT_DIRTY

public static final byte TRANSIENT_DIRTY
See Also:
Constant Field Values

PERSISTENT_NEW

public static final byte PERSISTENT_NEW
See Also:
Constant Field Values

PERSISTENT_NONTRANSACTIONAL

public static final byte PERSISTENT_NONTRANSACTIONAL
See Also:
Constant Field Values

PERSISTENT_CLEAN

public static final byte PERSISTENT_CLEAN
See Also:
Constant Field Values

PERSISTENT_DIRTY

public static final byte PERSISTENT_DIRTY
See Also:
Constant Field Values

HOLLOW

public static final byte HOLLOW
See Also:
Constant Field Values

PERSISTENT_DELETED

public static final byte PERSISTENT_DELETED
See Also:
Constant Field Values

PERSISTENT_NEW_DELETED

public static final byte PERSISTENT_NEW_DELETED
See Also:
Constant Field Values

ACTION_MAKEPERSISTENT

public static final byte ACTION_MAKEPERSISTENT
See Also:
Constant Field Values

ACTION_DELETEPERSISTENT

public static final byte ACTION_DELETEPERSISTENT
See Also:
Constant Field Values

ACTION_MAKETRANSACTIONAL

public static final byte ACTION_MAKETRANSACTIONAL
See Also:
Constant Field Values

ACTION_MAKENONTRANSACTIONAL

public static final byte ACTION_MAKENONTRANSACTIONAL
See Also:
Constant Field Values

ACTION_MAKETRANSIENT

public static final byte ACTION_MAKETRANSIENT
See Also:
Constant Field Values

ACTION_COMMIT

public static final byte ACTION_COMMIT
See Also:
Constant Field Values

ACTION_COMMIT_RETAINVALUES

public static final byte ACTION_COMMIT_RETAINVALUES
See Also:
Constant Field Values

ACTION_ROLLBACK

public static final byte ACTION_ROLLBACK
See Also:
Constant Field Values

ACTION_ROLLBACK_RETAINVALUES

public static final byte ACTION_ROLLBACK_RETAINVALUES
See Also:
Constant Field Values

ACTION_REFRESH_ACTIVEDATASTORETRANSACTION

public static final byte ACTION_REFRESH_ACTIVEDATASTORETRANSACTION
See Also:
Constant Field Values

ACTION_REFRESH_ACTIVEOPTIMISTICTRANSACTION

public static final byte ACTION_REFRESH_ACTIVEOPTIMISTICTRANSACTION
See Also:
Constant Field Values

ACTION_EVICT

public static final byte ACTION_EVICT
See Also:
Constant Field Values

ACTION_READFIELD_OUTSIDETRANSACTION

public static final byte ACTION_READFIELD_OUTSIDETRANSACTION
See Also:
Constant Field Values

ACTION_READFIELD_ACTIVEOPTIMISTICTRANSACTION

public static final byte ACTION_READFIELD_ACTIVEOPTIMISTICTRANSACTION
See Also:
Constant Field Values

ACTION_READFIELD_ACTIVEDATASTORETRANSACTION

public static final byte ACTION_READFIELD_ACTIVEDATASTORETRANSACTION
See Also:
Constant Field Values

ACTION_WRITEFIELD_ACTIVEDATASTORETRANSACTION

public static final byte ACTION_WRITEFIELD_ACTIVEDATASTORETRANSACTION
See Also:
Constant Field Values

ACTION_WRITEFIELD_OUTSIDETRANSACTION

public static final byte ACTION_WRITEFIELD_OUTSIDETRANSACTION
See Also:
Constant Field Values
Constructor Detail

LifeCycle

public LifeCycle()
Method Detail

actionToString

public static java.lang.String actionToString(byte action)

statusToString

public static java.lang.String statusToString(byte status)

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