SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

com.solarmetric.kodo.runtime
Class JDOState

java.lang.Object
  |
  +--com.solarmetric.kodo.runtime.JDOState
Direct Known Subclasses:
HollowState, PCleanState, PDeletedState, PDirtyState, PNewDeletedState, PNewFlushedDeletedState, PNewState, PNonTransState, TCleanState, TDirtyState, TransientState

public class JDOState
extends Object

Base class for all JDO lifecycle states. Each JDO instance is managed by a StateManagerImpl, which in turn keeps a reference to its current state.

The state governs the behavior of the instance during all JDO lifecycle events. The class itself is stateless, and is provided its context on each method call. This base class provides no-op implementations of all methods and maintains static singelton shared references to each possible JDO state.


Field Summary
static JDOState HOLLOW
          Hollow; exists in data store
static JDOState PCLEAN
          Persistent-Clean
static JDOState PDELETED
          Persistent-Deleted
static JDOState PDELETEDFLUSHED
          Persistent-Deleted-Flushed
static JDOState PDIRTY
          Persistent-Dirty
static JDOState PNEW
          Persistent-New
static JDOState PNEWDELETED
          Persistent-New-Deleted
static JDOState PNEWDELETEDFLUSHED
          Persistent-New-Deleted
static JDOState PNEWFLUSHED
          Persistent-New-Flushed
static JDOState PNEWFLUSHEDDELETED
          Persistent-New-Flushed-Deleted
static JDOState PNEWFLUSHEDDELETEDFLUSHED
          Persistent-New-Flushed-Deleted-Flushed
static JDOState PNONTRANS
          Persistent-Nontransactinoal
static JDOState TCLEAN
          Transient-Clean
static JDOState TDIRTY
          Transient-Dirty
static JDOState TRANSIENT
          Transient; unmanaged instance
 
Constructor Summary
JDOState()
           
 
Method Summary
(package private)  JDOState afterNontransactionalRefresh()
          Return the state to transition to after refresh.
(package private)  JDOState afterOptimisticRefresh()
          Return the state to transition to after refresh.
(package private)  JDOState afterRefresh()
          Return the state to transition to after refresh.
(package private)  void beforeCommit(StateManagerImpl context)
          Called before the state is committed.
(package private)  void beforeFlush(StateManagerImpl context)
          Called before the state is flushed.
(package private)  JDOState beforeNontransactionalRead(StateManagerImpl context)
          Perform any actions necesssary and return the proper lifecycle state prior to the state of the given instance being read outside of an active transaction.
(package private)  JDOState beforeNontransactionalWrite(StateManagerImpl context)
          Perform any actions necesssary and return the proper lifecycle state prior to the state of the given instance being written outside of an active transaction.
(package private)  JDOState beforeOptimisticRead(StateManagerImpl context)
          Perform any actions necesssary and return the proper lifecycle state prior to the state of the given instance being read in an optimistic transaction.
(package private)  JDOState beforeOptimisticWrite(StateManagerImpl context)
          Perform any actions necesssary and return the proper lifecycle state prior to the state of the given instance being written within an optimistic transaction.
(package private)  JDOState beforeRead(StateManagerImpl context)
          Perform any actions necesssary and return the proper lifecycle state prior to the state of the given instance being read within an active transaction.
(package private)  JDOState beforeWrite(StateManagerImpl context)
          Perform any actions necesssary and return the proper lifecycle state prior to the state of the given instance being written within an active transaction.
(package private)  JDOState commit(StateManagerImpl context)
          Perform any actions necesssary and return the proper lifecycle state on transaction commit.
(package private)  JDOState commitRetain(StateManagerImpl context)
          Perform any actions necesssary and return the proper lifecycle state on transaction commit with the retainValues flag set.
(package private)  JDOState deletePersistent(StateManagerImpl context)
          Perform any actions necesssary and return the proper lifecycle state on a call to PersistenceManager.deletePersistent(java.lang.Object) with the given instance.
(package private)  JDOState error(String key, StateManagerImpl context)
          Throw an error with a localized message identified by the given key.
(package private)  JDOState evict(StateManagerImpl context)
          Perform any actions necesssary and return the proper lifecycle state on a call to PersistenceManager.evict(java.lang.Object) with the given instance.
(package private)  JDOState flush(StateManagerImpl context)
          Perform any actions necesssary and return the proper lifecycle state on transaction flush.
(package private)  void initialize(StateManagerImpl context)
          Called when this state is first assigned to the given state manager.
(package private)  boolean isDeleted()
          Return whether this is a deleted state.
(package private)  boolean isDirty()
          Return whether this is a dirty state.
(package private)  boolean isFlushed()
          Return whether this is a flushed state.
(package private)  boolean isNew()
          Return whether this is a new state.
(package private)  boolean isPersistent()
          Return whether this is a persistent state.
(package private)  boolean isTransactional()
          Return whether this is a transactional state.
(package private)  JDOState makeNontransactional(StateManagerImpl context)
          Perform any actions necesssary and return the proper lifecycle state on a call to PersistenceManager.makeNontransactional(java.lang.Object) with the given instance.
(package private)  JDOState makePersistent(StateManagerImpl context)
          Perform any actions necesssary and return the proper lifecycle state on a call to PersistenceManager.makePersistent(java.lang.Object) with the given instance.
(package private)  JDOState makeTransactional(StateManagerImpl context)
          Perform any actions necesssary and return the proper lifecycle state on a call to PersistenceManager.makeNontransactional(java.lang.Object) with the given instance.
(package private)  JDOState makeTransient(StateManagerImpl context)
          Perform any actions necesssary and return the proper lifecycle state on a call to PersistenceManager.makeTransient(java.lang.Object) with the given instance.
(package private)  JDOState rollback(StateManagerImpl context)
          Perform any actions necesssary and return the proper lifecycle state on transaction rollback.
(package private)  JDOState rollbackRetain(StateManagerImpl context)
          Perform any actions necesssary and return the proper lifecycle state on transaction rollback with the retainValues flag set.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PNEW

public static final JDOState PNEW
Persistent-New

PNEWFLUSHED

public static final JDOState PNEWFLUSHED
Persistent-New-Flushed

PNEWFLUSHEDDELETED

public static final JDOState PNEWFLUSHEDDELETED
Persistent-New-Flushed-Deleted

PNEWFLUSHEDDELETEDFLUSHED

public static final JDOState PNEWFLUSHEDDELETEDFLUSHED
Persistent-New-Flushed-Deleted-Flushed

PCLEAN

public static final JDOState PCLEAN
Persistent-Clean

PDIRTY

public static final JDOState PDIRTY
Persistent-Dirty

PDELETED

public static final JDOState PDELETED
Persistent-Deleted

PDELETEDFLUSHED

public static final JDOState PDELETEDFLUSHED
Persistent-Deleted-Flushed

PNEWDELETED

public static final JDOState PNEWDELETED
Persistent-New-Deleted

PNEWDELETEDFLUSHED

public static final JDOState PNEWDELETEDFLUSHED
Persistent-New-Deleted

PNONTRANS

public static final JDOState PNONTRANS
Persistent-Nontransactinoal

HOLLOW

public static final JDOState HOLLOW
Hollow; exists in data store

TRANSIENT

public static final JDOState TRANSIENT
Transient; unmanaged instance

TCLEAN

public static final JDOState TCLEAN
Transient-Clean

TDIRTY

public static final JDOState TDIRTY
Transient-Dirty
Constructor Detail

JDOState

public JDOState()
Method Detail

initialize

void initialize(StateManagerImpl context)
Called when this state is first assigned to the given state manager.

beforeFlush

void beforeFlush(StateManagerImpl context)
Called before the state is flushed. This is only invoked when the user explicitly invokes PersistenceManagerImpl.flush(). That is, it is not invoked when flushing due to a commit operation.

flush

JDOState flush(StateManagerImpl context)
Perform any actions necesssary and return the proper lifecycle state on transaction flush. This is only invoked when the user explicitly invokes PersistenceManagerImpl.flush(). That is, it is not invoked when flushing due to a commit operation. That is Returns the this pointer by default.

beforeCommit

void beforeCommit(StateManagerImpl context)
Called before the state is committed.

commit

JDOState commit(StateManagerImpl context)
Perform any actions necesssary and return the proper lifecycle state on transaction commit. Returns the this pointer by default.

commitRetain

JDOState commitRetain(StateManagerImpl context)
Perform any actions necesssary and return the proper lifecycle state on transaction commit with the retainValues flag set. Returns the this pointer by default.

rollback

JDOState rollback(StateManagerImpl context)
Perform any actions necesssary and return the proper lifecycle state on transaction rollback. Returns the this pointer by default.

rollbackRetain

JDOState rollbackRetain(StateManagerImpl context)
Perform any actions necesssary and return the proper lifecycle state on transaction rollback with the retainValues flag set. Returns the this pointer by default.

makePersistent

JDOState makePersistent(StateManagerImpl context)
Perform any actions necesssary and return the proper lifecycle state on a call to PersistenceManager.makePersistent(java.lang.Object) with the given instance. Returns the this pointer by default.

deletePersistent

JDOState deletePersistent(StateManagerImpl context)
Perform any actions necesssary and return the proper lifecycle state on a call to PersistenceManager.deletePersistent(java.lang.Object) with the given instance. Returns the this pointer by default.

makeNontransactional

JDOState makeNontransactional(StateManagerImpl context)
Perform any actions necesssary and return the proper lifecycle state on a call to PersistenceManager.makeNontransactional(java.lang.Object) with the given instance. Returns the this pointer by default.

makeTransactional

JDOState makeTransactional(StateManagerImpl context)
Perform any actions necesssary and return the proper lifecycle state on a call to PersistenceManager.makeNontransactional(java.lang.Object) with the given instance. Returns the this pointer by default.

makeTransient

JDOState makeTransient(StateManagerImpl context)
Perform any actions necesssary and return the proper lifecycle state on a call to PersistenceManager.makeTransient(java.lang.Object) with the given instance. Returns the this pointer by default.

evict

JDOState evict(StateManagerImpl context)
Perform any actions necesssary and return the proper lifecycle state on a call to PersistenceManager.evict(java.lang.Object) with the given instance. Returns the this pointer by default.

afterRefresh

JDOState afterRefresh()
Return the state to transition to after refresh. The context is not given because no actions should be taken.

afterOptimisticRefresh

JDOState afterOptimisticRefresh()
Return the state to transition to after refresh. The context is not given because no actions should be taken.

afterNontransactionalRefresh

JDOState afterNontransactionalRefresh()
Return the state to transition to after refresh. The context is not given because no actions should be taken.

beforeRead

JDOState beforeRead(StateManagerImpl context)
Perform any actions necesssary and return the proper lifecycle state prior to the state of the given instance being read within an active transaction. Returns the this pointer by default.

beforeNontransactionalRead

JDOState beforeNontransactionalRead(StateManagerImpl context)
Perform any actions necesssary and return the proper lifecycle state prior to the state of the given instance being read outside of an active transaction. Returns the this pointer by default.

beforeOptimisticRead

JDOState beforeOptimisticRead(StateManagerImpl context)
Perform any actions necesssary and return the proper lifecycle state prior to the state of the given instance being read in an optimistic transaction. Returns the this pointer by default.

beforeWrite

JDOState beforeWrite(StateManagerImpl context)
Perform any actions necesssary and return the proper lifecycle state prior to the state of the given instance being written within an active transaction. Returns the this pointer by default.

beforeOptimisticWrite

JDOState beforeOptimisticWrite(StateManagerImpl context)
Perform any actions necesssary and return the proper lifecycle state prior to the state of the given instance being written within an optimistic transaction. Returns the this pointer by default.

beforeNontransactionalWrite

JDOState beforeNontransactionalWrite(StateManagerImpl context)
Perform any actions necesssary and return the proper lifecycle state prior to the state of the given instance being written outside of an active transaction. Returns the this pointer by default.

isTransactional

boolean isTransactional()
Return whether this is a transactional state. Returns false by default.

isPersistent

boolean isPersistent()
Return whether this is a persistent state. Returns false by default.

isNew

boolean isNew()
Return whether this is a new state. Returns false by default.

isDeleted

boolean isDeleted()
Return whether this is a deleted state. Returns false by default.

isDirty

boolean isDirty()
Return whether this is a dirty state. Returns false by default.

isFlushed

boolean isFlushed()
Return whether this is a flushed state. Returns false by default. Flushed states are those for which PersistenceManagerImpl.flush() has been invoked at least once. That is, PNewFlushed returns true, and so does PNewFlushedDeleted. So, it is not sufficient to check if this returns true to know if there are outstanding changes that need to be flushed.

error

JDOState error(String key,
               StateManagerImpl context)
Throw an error with a localized message identified by the given key.

SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.