|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jpox.state.LifeCycleState
Base Class representing the life cycle state. Implemented for individual states.
Field Summary | |
static int |
DETACHED_CLEAN
Detached-Clean |
static int |
DETACHED_DIRTY
Detached-Dirty |
static int |
HOLLOW
Hollow |
static int |
ILLEGAL_STATE
illegal state |
protected boolean |
isDeleted
|
protected boolean |
isDirty
|
protected boolean |
isNew
|
protected boolean |
isPersistent
|
protected boolean |
isTransactional
|
protected static Localiser |
LOCALISER
|
static int |
P_CLEAN
Persistent-Clean |
static int |
P_DELETED
Persistent-Deleted |
static int |
P_DIRTY
Persistent-Dirty |
static int |
P_NEW
Persistent-New |
static int |
P_NEW_DELETED
Persistent-New-Deleted |
static int |
P_NONTRANS
Persistent-NonTransactional |
protected int |
stateType
|
static int |
T_CLEAN
Transaction-Clean |
static int |
T_DIRTY
Transaction-Dirty |
static int |
TOTAL
total number of states |
static int |
TRANSIENT
transient |
Constructor Summary | |
LifeCycleState()
|
Method Summary | |
protected LifeCycleState |
changeState(StateManagerImpl sm,
int newStateType)
Utility to change state to a new state. |
protected LifeCycleState |
changeTransientState(StateManagerImpl sm,
int newStateType)
Utility to change state to a new state. |
static LifeCycleState |
getLifeCycleState(int stateType)
Returns the LifeCycleState for the state constant. |
boolean |
isDeleted()
Return whether the object is deleted. |
boolean |
isDirty()
Return whether the object is dirty, ie has been changed (created, updated, deleted) in this Tx. |
boolean |
isNew()
Return whether the object was newly created. |
boolean |
isPersistent()
Return whether the object is persistent. |
boolean |
isTransactional()
Return whether the object is transactional. |
int |
stateType()
Returns the type of the life cycle state |
abstract java.lang.String |
toString()
Method to return a string version of this object. |
LifeCycleState |
transitionCommit(StateManagerImpl sm,
javax.jdo.Transaction tx)
Method to transition to commit state. |
LifeCycleState |
transitionDeletePersistent(StateManagerImpl sm)
Method to transition to delete persistent state. |
LifeCycleState |
transitionDetach(StateManagerImpl sm)
Method to transition to detached-clean. |
LifeCycleState |
transitionEvict(StateManagerImpl sm)
Method to transition to evict state. |
LifeCycleState |
transitionMakeNontransactional(StateManagerImpl sm)
Method to transition to nontransactional state. |
LifeCycleState |
transitionMakePersistent(StateManagerImpl sm)
Method to transition to persistent state. |
LifeCycleState |
transitionMakeTransactional(StateManagerImpl sm)
Method to transition to transactional state. |
LifeCycleState |
transitionMakeTransient(StateManagerImpl sm,
boolean useFetchPlan)
Method to transition to transient state. |
LifeCycleState |
transitionReadField(StateManagerImpl sm,
boolean isLoaded)
Method to transition to read-field state. |
LifeCycleState |
transitionRefresh(StateManagerImpl sm)
Method to transition to refresh state. |
LifeCycleState |
transitionRetrieve(StateManagerImpl sm,
boolean fgOnly)
Method to transition to retrieve state. |
LifeCycleState |
transitionRetrieve(StateManagerImpl sm,
javax.jdo.FetchPlan fetchPlan)
Method to transition to retrieve state. |
LifeCycleState |
transitionRollback(StateManagerImpl sm,
javax.jdo.Transaction tx)
Method to transition to rollback state. |
LifeCycleState |
transitionSerialize(StateManagerImpl sm)
Method to transition when serialised. |
LifeCycleState |
transitionWriteField(StateManagerImpl sm)
Method to transition to write-field state. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static final Localiser LOCALISER
public static final int TRANSIENT
public static final int P_NEW
public static final int P_CLEAN
public static final int P_DIRTY
public static final int HOLLOW
public static final int T_CLEAN
public static final int T_DIRTY
public static final int P_NEW_DELETED
public static final int P_DELETED
public static final int P_NONTRANS
public static final int DETACHED_CLEAN
public static final int DETACHED_DIRTY
public static final int TOTAL
public static final int ILLEGAL_STATE
protected boolean isDirty
protected boolean isNew
protected boolean isDeleted
protected boolean isTransactional
protected boolean isPersistent
protected int stateType
Constructor Detail |
public LifeCycleState()
Method Detail |
public static final LifeCycleState getLifeCycleState(int stateType)
stateType
- the type as integer
public final int stateType()
protected final LifeCycleState changeState(StateManagerImpl sm, int newStateType)
sm
- The state manager.newStateType
- The new state
protected final LifeCycleState changeTransientState(StateManagerImpl sm, int newStateType)
sm
- The state manager.newStateType
- The new state
public LifeCycleState transitionMakePersistent(StateManagerImpl sm)
sm
- StateManager.
public LifeCycleState transitionDeletePersistent(StateManagerImpl sm)
sm
- StateManager.
public LifeCycleState transitionMakeTransactional(StateManagerImpl sm)
sm
- StateManager.
public LifeCycleState transitionMakeNontransactional(StateManagerImpl sm)
sm
- StateManager.
public LifeCycleState transitionMakeTransient(StateManagerImpl sm, boolean useFetchPlan)
sm
- StateManager.useFetchPlan
- to make transient the fields in the fetch plan
public LifeCycleState transitionCommit(StateManagerImpl sm, javax.jdo.Transaction tx)
sm
- StateManager.tx
- the Transaction been committed.
public LifeCycleState transitionRollback(StateManagerImpl sm, javax.jdo.Transaction tx)
sm
- StateManager.tx
- Transaction.
public LifeCycleState transitionRefresh(StateManagerImpl sm)
sm
- StateManager.
public LifeCycleState transitionEvict(StateManagerImpl sm)
sm
- StateManager.
public LifeCycleState transitionReadField(StateManagerImpl sm, boolean isLoaded)
sm
- StateManager.isLoaded
- if the field was previously loaded
public LifeCycleState transitionWriteField(StateManagerImpl sm)
sm
- StateManager.
public LifeCycleState transitionRetrieve(StateManagerImpl sm, boolean fgOnly)
sm
- StateManager.fgOnly
- only retrieve the current fetch group fields
public LifeCycleState transitionRetrieve(StateManagerImpl sm, javax.jdo.FetchPlan fetchPlan)
sm
- StateManager.fetchPlan
- the fetch plan to load fields
public LifeCycleState transitionDetach(StateManagerImpl sm)
sm
- StateManager.
public LifeCycleState transitionSerialize(StateManagerImpl sm)
sm
- State Manager
public final boolean isDirty()
public final boolean isNew()
public final boolean isDeleted()
public final boolean isTransactional()
public final boolean isPersistent()
public abstract java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |