|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.openjpa.kernel.PCState
public class PCState
Base class for all lifecycle states. Each instance is managed by
a OpenJPAStateManager
, which in turn keeps a reference to its current
state.
The state governs the behavior of the instance during all 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 state.
Field Summary | |
---|---|
static PCState |
ECLEAN
Embedded-Clean |
static PCState |
ECOPY
Embedded-Copy |
static PCState |
EDELETED
Embedded-Deleted |
static PCState |
EDIRTY
Embedded-Dirty |
static PCState |
ENONTRANS
Embedded-Nontransactional |
static PCState |
HOLLOW
Hollow; exists in data store |
static PCState |
PCLEAN
Persistent-Clean |
static PCState |
PDELETED
Persistent-Deleted |
static PCState |
PDELETEDFLUSHED
Persistent-Deleted-Flushed |
static PCState |
PDIRTY
Persistent-Dirty |
static PCState |
PNEW
Persistent-New |
static PCState |
PNEWDELETED
Persistent-New-Deleted |
static PCState |
PNEWFLUSHEDDELETED
Persistent-New-Flushed-Deleted |
static PCState |
PNEWFLUSHEDDELETEDFLUSHED
Persistent-New-Flushed-Deleted-Flushed |
static PCState |
PNEWPROVISIONAL
Persistent-New-Provisional |
static PCState |
PNONTRANS
Persistent-Nontransactinoal |
static PCState |
PNONTRANSDELETED
Persistent-Deleted-Nontransactional |
static PCState |
PNONTRANSDIRTY
Persistent-Dirty-Nontransactinoal |
static PCState |
PNONTRANSNEW
Persistent-New-Nontransactional |
static PCState |
TCLEAN
Transient-Clean |
static PCState |
TDIRTY
Transient-Dirty |
static PCState |
TLOADED
Transient-Loaded |
static PCState |
TRANSIENT
Transient; unmanaged instance |
Constructor Summary | |
---|---|
PCState()
|
Method Summary | |
---|---|
(package private) PCState |
afterNontransactionalRefresh()
Return the state to transition to after refresh. |
(package private) PCState |
afterOptimisticRefresh()
Return the state to transition to after refresh. |
(package private) PCState |
afterRefresh()
Return the state to transition to after refresh. |
(package private) void |
beforeFlush(StateManagerImpl context,
boolean logical,
OpCallbacks call)
Called before the state is flushed. |
(package private) PCState |
beforeNontransactionalRead(StateManagerImpl context,
int field)
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) PCState |
beforeNontransactionalWrite(StateManagerImpl context,
int field,
boolean mutate)
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) PCState |
beforeOptimisticRead(StateManagerImpl context,
int field)
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) PCState |
beforeOptimisticWrite(StateManagerImpl context,
int field,
boolean mutate)
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) PCState |
beforeRead(StateManagerImpl context,
int field)
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) PCState |
beforeWrite(StateManagerImpl context,
int field,
boolean mutate)
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) PCState |
commit(StateManagerImpl context)
Perform any actions necesssary and return the proper lifecycle state on transaction commit. |
(package private) PCState |
commitRetain(StateManagerImpl context)
Perform any actions necesssary and return the proper lifecycle state on transaction commit with the retainValues flag set. |
(package private) PCState |
delete(StateManagerImpl context)
Perform any actions necesssary and return the proper lifecycle state on a call to Broker.delete(java.lang.Object, org.apache.openjpa.kernel.OpCallbacks) with the given instance. |
(package private) PCState |
error(String key,
StateManagerImpl context)
Throw an error with a localized message identified by the given key. |
(package private) PCState |
evict(StateManagerImpl context)
Perform any actions necesssary and return the proper lifecycle state on a call to Broker.evict(java.lang.Object, org.apache.openjpa.kernel.OpCallbacks) with the given instance. |
(package private) PCState |
flush(StateManagerImpl context)
Perform any actions necessary and return the proper lifecycle state on fush. |
(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 |
isNew()
Return whether this is a new state. |
(package private) boolean |
isPendingTransactional()
Return whether this is a state that will become transactional upon the begin of the next transaction. |
(package private) boolean |
isPersistent()
Return whether this is a persistent state. |
(package private) boolean |
isProvisional()
Return whether this is a state that will become transient at the end of the next transaction. |
(package private) boolean |
isTransactional()
Return whether this is a transactional state. |
(package private) boolean |
isVersionCheckRequired(StateManagerImpl context)
Whether this state requires a version check when being flushed, assuming the system is configured for version checks. |
(package private) PCState |
nonprovisional(StateManagerImpl context,
boolean logical,
OpCallbacks call)
Return the state to transition to after making no longer provisional. |
(package private) PCState |
nontransactional(StateManagerImpl context)
Perform any actions necesssary and return the proper lifecycle state on a call to StoreContext.nontransactional(java.lang.Object, org.apache.openjpa.kernel.OpCallbacks) with the given
instance. |
(package private) PCState |
persist(StateManagerImpl context)
Perform any actions necesssary and return the proper lifecycle state on a call to Broker.persist(java.lang.Object, org.apache.openjpa.kernel.OpCallbacks) with the given instance. |
protected Object |
readResolve()
|
(package private) PCState |
release(StateManagerImpl context)
Perform any actions necesssary and return the proper lifecycle state on a call to Broker#makeTransient with the given instance. |
(package private) PCState |
rollback(StateManagerImpl context)
Perform any actions necesssary and return the proper lifecycle state on transaction rollback. |
(package private) PCState |
rollbackRestore(StateManagerImpl context)
Perform any actions necesssary and return the proper lifecycle state on transaction rollback with the restoreValues flag set. |
(package private) PCState |
transactional(StateManagerImpl context)
Perform any actions necesssary and return the proper lifecycle state on a call to StoreContext.nontransactional(java.lang.Object, org.apache.openjpa.kernel.OpCallbacks) with the given
instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final PCState PNEW
public static final PCState PCLEAN
public static final PCState PDIRTY
public static final PCState PDELETED
public static final PCState PNEWDELETED
public static final PCState PNEWPROVISIONAL
public static final PCState PNONTRANS
public static final PCState PNONTRANSDIRTY
public static final PCState PNONTRANSNEW
public static final PCState PNONTRANSDELETED
public static final PCState HOLLOW
public static final PCState TRANSIENT
public static final PCState TCLEAN
public static final PCState TDIRTY
public static final PCState TLOADED
public static final PCState ECOPY
public static final PCState ECLEAN
public static final PCState EDIRTY
public static final PCState EDELETED
public static final PCState ENONTRANS
public static final PCState PNEWFLUSHEDDELETED
public static final PCState PNEWFLUSHEDDELETEDFLUSHED
public static final PCState PDELETEDFLUSHED
Constructor Detail |
---|
public PCState()
Method Detail |
---|
void initialize(StateManagerImpl context)
void beforeFlush(StateManagerImpl context, boolean logical, OpCallbacks call)
PCState flush(StateManagerImpl context)
this
pointer by default.
PCState commit(StateManagerImpl context)
this
pointer by default.
PCState commitRetain(StateManagerImpl context)
this
pointer by default.
PCState rollback(StateManagerImpl context)
this
pointer by default.
PCState rollbackRestore(StateManagerImpl context)
this
pointer by default.
PCState persist(StateManagerImpl context)
Broker.persist(java.lang.Object, org.apache.openjpa.kernel.OpCallbacks)
with the given instance.
Returns the this
pointer by default. Note: this method
is not called for embedded states, and is only called when an
existing managed instance is the target of a persist call.
PCState delete(StateManagerImpl context)
Broker.delete(java.lang.Object, org.apache.openjpa.kernel.OpCallbacks)
with the given instance.
Returns the this
pointer by default.
PCState nonprovisional(StateManagerImpl context, boolean logical, OpCallbacks call)
this
pointer by default.
PCState nontransactional(StateManagerImpl context)
StoreContext.nontransactional(java.lang.Object, org.apache.openjpa.kernel.OpCallbacks)
with the given
instance. Returns the this
pointer by default.
PCState transactional(StateManagerImpl context)
StoreContext.nontransactional(java.lang.Object, org.apache.openjpa.kernel.OpCallbacks)
with the given
instance. Returns the this
pointer by default.
PCState release(StateManagerImpl context)
Broker#makeTransient
with the given instance.
Returns the this
pointer by default.
PCState evict(StateManagerImpl context)
Broker.evict(java.lang.Object, org.apache.openjpa.kernel.OpCallbacks)
with the given instance.
Returns the this
pointer by default.
PCState afterRefresh()
PCState afterOptimisticRefresh()
PCState afterNontransactionalRefresh()
PCState beforeRead(StateManagerImpl context, int field)
this
pointer by default.
PCState beforeNontransactionalRead(StateManagerImpl context, int field)
this
pointer by default.
PCState beforeOptimisticRead(StateManagerImpl context, int field)
this
pointer by default.
PCState beforeWrite(StateManagerImpl context, int field, boolean mutate)
this
pointer by default.
PCState beforeOptimisticWrite(StateManagerImpl context, int field, boolean mutate)
this
pointer by default.
PCState beforeNontransactionalWrite(StateManagerImpl context, int field, boolean mutate)
this
pointer by default.
boolean isTransactional()
false
by default.
boolean isPersistent()
false
by default.
boolean isNew()
false
by default.
boolean isDeleted()
false
by default.
boolean isDirty()
false
by default.
boolean isPendingTransactional()
false
by default.
boolean isProvisional()
false
by default.
boolean isVersionCheckRequired(StateManagerImpl context)
PCState error(String key, StateManagerImpl context)
protected Object readResolve() throws ObjectStreamException
ObjectStreamException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |