|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jdo.impl.state.StateManagerImpl
This is the StoreManager independent implemetation of javax.jdo.spi.StateManager interface. Delegates state transition requests to LifeCycleState.
Field Summary | |
private boolean |
allowedChangeApplicationIdentity
|
private javax.jdo.spi.PersistenceCapable |
beforeImage
beforeImage represents state of an instance before any change or as of the call to makePersistent/deletePersistent |
private java.util.BitSet |
biFields
|
private static java.lang.String |
ChangeApplicationIdentityOption
|
private java.lang.Object |
dependency
|
private java.util.BitSet |
dirtyFields
|
private java.lang.Object |
expectedProvider
|
private int[] |
fieldArr
|
private FieldManager |
fieldManager
|
private javax.jdo.spi.PersistenceCapable |
flushedImage
flushedImage represents state of an instance as of the last flush to the datastore. |
private static StateFieldManager |
hollowFieldManager
Helper StateFieldManager instance for resetting fields in a Hollow instance at commit/rollback. |
private boolean |
inAfterCompletion
|
private static RuntimeJavaModelFactory |
javaModelFactory
RuntimeJavaModelFactory. |
private JDOClass |
jdoClass
|
private byte |
jdoFlags
|
(package private) static javax.jdo.spi.JDOImplHelper |
jdoImplHelper
|
private java.util.BitSet |
loadedFields
|
private static org.apache.commons.logging.Log |
logger
Logger instance |
private java.lang.Object |
metaData
Reference to JDO Model. |
private static I18NHelper |
msg
I18N message handler |
private LifeCycleState |
myLC
|
private javax.jdo.spi.PersistenceCapable |
myPC
|
private java.lang.Class |
myPCClass
|
private PersistenceManagerInternal |
myPM
|
private int |
numFields
|
private StateFieldManager |
objectFieldManager
Helper StateFieldManager instance for fetching Object fields values for reachability and SCO processing. |
private java.lang.Object |
objectId
|
private static ReachabilityHandler |
reachabilityHandler
|
private static SCOProcessor |
scoProcessor
|
private boolean |
transitionTransient
|
private javax.jdo.Transaction |
tx
|
private java.lang.Object |
txObjectId
|
Fields inherited from interface org.apache.jdo.state.StateManagerInternal |
FLUSHED_COMPLETE, FLUSHED_NONE, FLUSHED_PARTIAL |
Constructor Summary | |
(package private) |
StateManagerImpl(java.lang.Object uoid,
java.lang.Object ioid,
PersistenceManagerInternal pm,
java.lang.Class clazz)
Constructs a new StateManagerImpl when requested
from query processing. |
(package private) |
StateManagerImpl(javax.jdo.spi.PersistenceCapable pc,
PersistenceManagerInternal pm)
Constructs a new StateManagerImpl to process
future makePersistent request. |
Method Summary | |
void |
afterCompletion(boolean abort,
boolean retainValues,
boolean restoreValues)
Transitions LifeCycleState on afterCompletion. |
private void |
assertSCOElementType(java.lang.Object o,
int field)
Assert element type of an SCO Collection or key and value types of an SCO Map. |
protected void |
clearFields()
Clear fields on commit or rollback called by LifeCycle on commit or rollback transition. |
private void |
createAllBeforeImage()
Create beforeImage for all fields - called by transition from TRANSIENT to P_NEW |
protected void |
createBeforeImage()
Create a new beforeImage in an active optimistic transaction or an active datastore transaction with restoreValues flag set to true or for a transient-transactional instance. |
private void |
debug(java.lang.String msg)
Tracing method |
private boolean |
debugging()
Verifies if debugging is enabled. |
void |
deletePersistent()
delete persistencecapable |
protected void |
deregister()
Removes this StateManager from all the caches |
protected void |
disconnect()
Disconnect StateManager and PC. |
private boolean |
disconnectClone(javax.jdo.spi.PersistenceCapable pc)
Desconnects clone instance. |
void |
evictInstance()
Transition to Hollow |
private void |
fetch(StoreManager srm)
Fetches instance from the data store |
private void |
fetch(StoreManager srm,
int[] fetchFields)
Fetches specific fields in the instance from the data store |
private java.lang.Object |
fetchObjectField(int field)
Returns current value from the Object type field. |
boolean |
flush(StoreManager srm)
Causes the state manager to send itself to the store manager for insert, update, and so on as per its own state. |
boolean |
getBooleanField(javax.jdo.spi.PersistenceCapable pc,
int field,
boolean currentValue)
|
byte |
getByteField(javax.jdo.spi.PersistenceCapable pc,
int field,
byte currentValue)
|
char |
getCharField(javax.jdo.spi.PersistenceCapable pc,
int field,
char currentValue)
|
java.lang.Object |
getDependency()
Returns dependency object that contains dependency information specific to this instance of the StateManager |
double |
getDoubleField(javax.jdo.spi.PersistenceCapable pc,
int field,
double currentValue)
|
java.lang.Object |
getExternalObjectId()
Returns external representation of the object id that can be used by the client |
java.lang.String |
getFieldName(int field)
Returns field name for the field number. |
private int[] |
getFieldNums(java.util.BitSet bs)
Helper method to convert set bits in a BitSet to field numbers. |
private int[] |
getFields(int field)
Helper method to define the list of fields to be loaded together with this field |
float |
getFloatField(javax.jdo.spi.PersistenceCapable pc,
int field,
float currentValue)
|
java.lang.Object |
getInternalObjectId()
Return the object representing the JDO identity of the associated instance |
int |
getIntField(javax.jdo.spi.PersistenceCapable pc,
int field,
int currentValue)
|
long |
getLongField(javax.jdo.spi.PersistenceCapable pc,
int field,
long currentValue)
|
javax.jdo.spi.PersistenceCapable |
getObject()
Provides the object managed by this state manager. |
java.lang.Object |
getObjectField(javax.jdo.spi.PersistenceCapable pc,
int field,
java.lang.Object currentValue)
|
java.lang.Object |
getObjectId(javax.jdo.spi.PersistenceCapable pc)
Return the object representing the JDO identity of the calling instance. |
java.lang.Class |
getPCClass()
Returns PC Class known to this StateManager. |
PersistenceManagerInternal |
getPersistenceManager()
Return the PersistenceManager that owns this instance. |
javax.jdo.PersistenceManager |
getPersistenceManager(javax.jdo.spi.PersistenceCapable pc)
Return the PersistenceManager that owns this instance as PersistenceManager wrapper. |
short |
getShortField(javax.jdo.spi.PersistenceCapable pc,
int field,
short currentValue)
|
java.lang.String |
getStringField(javax.jdo.spi.PersistenceCapable pc,
int field,
java.lang.String currentValue)
|
private java.lang.Object |
getTransactionalObjectId()
Returns external representation of the transactional object id that can be used by the client |
java.lang.Object |
getTransactionalObjectId(javax.jdo.spi.PersistenceCapable pc)
Return the object representing the JDO identity of the calling instance. |
private int[] |
getUnloaded(int[] newfields,
java.util.BitSet set)
Helper method to convert not loaded bits to field numbers. |
void |
handleReachability(boolean commit)
Processes relationships for reachability algorithm and define the dependencies |
private void |
initializePC()
Initialize PC Class information. |
private void |
initializePM(PersistenceManagerInternal pm)
Initialize PersistenceManager related information. |
private void |
initializeSM(int newState)
Initialize SM reference in PC and Oid |
boolean |
isDeleted(javax.jdo.spi.PersistenceCapable pc)
Tests whether this object has been deleted. |
boolean |
isDirty(javax.jdo.spi.PersistenceCapable pc)
Tests whether this object is dirty. |
boolean |
isFlushed()
Returns true if current state is flushed. |
boolean |
isLoaded(javax.jdo.spi.PersistenceCapable pc,
int field)
This implementation of isLoaded will always return true. |
boolean |
isNew()
Tests whether this StateManager represents a instance made persistent object. |
boolean |
isNew(javax.jdo.spi.PersistenceCapable pc)
Tests whether this object has been newly made persistent. |
boolean |
isPersistent(javax.jdo.spi.PersistenceCapable pc)
Tests whether this object is persistent. |
protected boolean |
isSCOType(java.lang.Class type)
Verifies that this class type is a supported SCO type. |
boolean |
isStored()
Returns true if current state is present in the datastore. |
boolean |
isTransactional(javax.jdo.spi.PersistenceCapable pc)
Tests whether this object is transactional. |
private void |
loadField(int field)
Load field value if necessary |
private void |
loadingField(java.lang.Object pc,
int field)
Preparation steps for replacingXXXField operation |
protected void |
loadUnloaded()
Load all persistent fields as requested by the LifeCycle. |
protected void |
makeAutoPersistent()
Transition to Auto-Persistent-New (persistence-by-reachability) |
protected void |
makeAutoPersistent(java.lang.Object[] o)
Processes Array of referenced objects for possible auto-persistence (persistence-by-reachability). |
void |
makeDirty(int field)
Mark the associated PersistenceCapable field dirty. |
void |
makeDirty(javax.jdo.spi.PersistenceCapable pc,
java.lang.String fieldName)
Mark the associated PersistenceCapable field dirty. |
void |
makeNontransactional()
Transition to Nontransactional |
void |
makePersistent()
Transition to Persistent-New |
void |
makeTransactional()
Transition to Transactional |
void |
makeTransient()
Transition to Transient |
private void |
markAllDirty()
Mark all fields as loaded and dirty - called by transition from TRANSIENT to P_NEW and T_CLEAN |
protected void |
markAsFlushed()
Called by LifeCycleState when transition persistent instance to the corresponding flushed state. |
private void |
markPKFieldsAsLoaded()
Mark PK fields as loaded: |
private void |
notNeededByRI(java.lang.String s)
|
protected void |
postLoad()
If this class implements InstanceCallbacks, call the jdoPostLoad method. |
protected void |
preDelete()
|
private void |
prepareSetField(javax.jdo.spi.PersistenceCapable pc,
int field,
FieldManager fieldManager)
Preparation steps for setXXXField operation for non-Object type field. |
private void |
prepareSetField(javax.jdo.spi.PersistenceCapable pc,
int field,
FieldManager fieldManager,
java.lang.Object currentValue,
java.lang.Object newValue)
Preparation steps for setXXXField operation for Object type field. |
private void |
prepareSetField1(javax.jdo.spi.PersistenceCapable pc,
int field)
Verification and load part of the preparation steps for setXXXField operation. |
private void |
prepareSetField2(int field,
FieldManager fieldManager)
Transtion write access and replace value step for setXXXField operation. |
void |
preSerialize(javax.jdo.spi.PersistenceCapable pc)
Guarantee that the serializable transactional and persistent fields are loaded into the instance. |
void |
preStore()
Calls preStore on the associated object if necessary. |
private void |
processReachability(boolean commit)
Transition referenced fields to Persistent at commit (persistence-by-reachability) |
void |
providedBooleanField(javax.jdo.spi.PersistenceCapable pc,
int field,
boolean currentValue)
|
void |
providedByteField(javax.jdo.spi.PersistenceCapable pc,
int field,
byte currentValue)
|
void |
providedCharField(javax.jdo.spi.PersistenceCapable pc,
int field,
char currentValue)
|
void |
providedDoubleField(javax.jdo.spi.PersistenceCapable pc,
int field,
double currentValue)
|
void |
providedFloatField(javax.jdo.spi.PersistenceCapable pc,
int field,
float currentValue)
|
void |
providedIntField(javax.jdo.spi.PersistenceCapable pc,
int field,
int currentValue)
|
void |
providedLongField(javax.jdo.spi.PersistenceCapable pc,
int field,
long currentValue)
|
void |
providedObjectField(javax.jdo.spi.PersistenceCapable pc,
int field,
java.lang.Object currentValue)
|
void |
providedShortField(javax.jdo.spi.PersistenceCapable pc,
int field,
short currentValue)
|
void |
providedStringField(javax.jdo.spi.PersistenceCapable pc,
int field,
java.lang.String currentValue)
|
void |
provideField(int fieldNumber,
FieldManager fieldManager,
boolean identifying)
Causes the values of the field indicated by the specified field number be given to the FieldManager. |
void |
provideFields(int[] fields,
FieldManager fieldManager,
boolean identifying)
Causes the values of the fields indicated by the specified fields to be given to the FieldManager. |
protected void |
refresh()
Refresh object inside of an active transaction as requested by the LifeCycle. |
void |
refreshInstance()
Transition to Clean |
protected void |
registerNonTransactional()
Adds this StateManager to non-transactional caches |
protected void |
registerTransactional()
Adds this StateManager to all caches |
void |
reload()
Fetches or refreshes pc instance. |
void |
replace(int[] fields,
FieldManager fieldManager)
Transition the lifecycle state as if the instance is retrieved from the datastore, but use the specified field values instead of loading them from the datastore. |
void |
replaceFields(int[] fields,
FieldManager fieldManager)
For replacing field values in a PC with the ones that is provided by the FieldManager. |
private void |
replaceSCO(SCO sco,
int field)
Replace field value with tracked SCO. |
void |
replaceSCOFields()
Replaces field values that are regular SCO instances with tracked SCOs. |
private void |
replaceSCOWithClones(int[] fields)
Replaces SCO instances with clones in the before image to preserve the state. |
protected void |
replaceUnloadedFields(int[] fields,
FieldManager fieldManager)
For replacing field values in a PC with one that is provided by the FieldManager. |
boolean |
replacingBooleanField(javax.jdo.spi.PersistenceCapable pc,
int field)
|
byte |
replacingByteField(javax.jdo.spi.PersistenceCapable pc,
int field)
|
char |
replacingCharField(javax.jdo.spi.PersistenceCapable pc,
int field)
|
double |
replacingDoubleField(javax.jdo.spi.PersistenceCapable pc,
int field)
|
byte |
replacingFlags(javax.jdo.spi.PersistenceCapable pc)
The owning StateManager uses this method to supply the value of the flags to the PersistenceCapable instance. |
float |
replacingFloatField(javax.jdo.spi.PersistenceCapable pc,
int field)
|
int |
replacingIntField(javax.jdo.spi.PersistenceCapable pc,
int field)
|
long |
replacingLongField(javax.jdo.spi.PersistenceCapable pc,
int field)
|
java.lang.Object |
replacingObjectField(javax.jdo.spi.PersistenceCapable pc,
int field)
|
short |
replacingShortField(javax.jdo.spi.PersistenceCapable pc,
int field)
|
javax.jdo.spi.StateManager |
replacingStateManager(javax.jdo.spi.PersistenceCapable pc,
javax.jdo.spi.StateManager sm)
Replace the current value of jdoStateManager. |
java.lang.String |
replacingStringField(javax.jdo.spi.PersistenceCapable pc,
int field)
|
protected void |
reset()
Reset all settings |
private void |
resetDirtyFields()
Clear dirtyFields list on flush |
protected void |
resetOwner(java.util.Iterator it,
int field,
boolean set)
Set owner on elements of an Iterator of SCO objects. |
protected void |
resetOwner(java.lang.Object[] o,
int field,
boolean set)
Set owner on elements of an Array of SCO objects. |
private void |
resetOwner(java.lang.Object o,
int field,
boolean set)
Set owner on referenced SCO objects. |
private void |
resetOwner(SCO sco,
int field,
boolean set)
Set owner on referenced SCO objects. |
private void |
resetRef()
Reset all references to null |
protected void |
restoreFields()
Restore fields from beforeImage on commit or rollback called by LifeCycle on commit or rollback transition. |
void |
retrieve()
Transition on retrieve request. |
void |
setBooleanField(javax.jdo.spi.PersistenceCapable pc,
int field,
boolean currentValue,
boolean newValue)
|
void |
setByteField(javax.jdo.spi.PersistenceCapable pc,
int field,
byte currentValue,
byte newValue)
|
void |
setCharField(javax.jdo.spi.PersistenceCapable pc,
int field,
char currentValue,
char newValue)
|
java.lang.Object |
setDependency(java.lang.Object dependency)
Sets dependency object containing dependency information specific to this instance of the StateManager |
void |
setDoubleField(javax.jdo.spi.PersistenceCapable pc,
int field,
double currentValue,
double newValue)
|
void |
setFloatField(javax.jdo.spi.PersistenceCapable pc,
int field,
float currentValue,
float newValue)
|
void |
setIntField(javax.jdo.spi.PersistenceCapable pc,
int field,
int currentValue,
int newValue)
|
void |
setLongField(javax.jdo.spi.PersistenceCapable pc,
int field,
long currentValue,
long newValue)
|
void |
setObjectField(javax.jdo.spi.PersistenceCapable pc,
int field,
java.lang.Object currentValue,
java.lang.Object newValue)
|
void |
setObjectId(java.lang.Object objectId)
Allows a client to change this state manager's object Id. |
void |
setPCClass(java.lang.Class pcClass)
Allows StateManager to set the actual PC Class if it was not available at the constructor time and create a hollow instnce of that type. |
private void |
setSCOOwner(boolean set)
Change owner of all SCO fields. |
void |
setShortField(javax.jdo.spi.PersistenceCapable pc,
int field,
short currentValue,
short newValue)
|
void |
setStringField(javax.jdo.spi.PersistenceCapable pc,
int field,
java.lang.String currentValue,
java.lang.String newValue)
|
void |
trackUpdates(int field,
SCO sco)
Makes newly added instances to an SCO Collection or SCO Map auto-persistent. |
protected void |
unsetBeforeImage()
Reset beforeImage on refresh or flush |
protected void |
unsetSCOFields()
Unsets owner of tracked SCO field values and marks fields as not loaded. |
private void |
updateBeforeImage(int[] fields)
Update existing beforeImage in a transaction. |
private boolean |
verifyProvider(javax.jdo.spi.PersistenceCapable pc)
Verifies field provider |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private PersistenceManagerInternal myPM
private javax.jdo.Transaction tx
private javax.jdo.spi.PersistenceCapable myPC
private LifeCycleState myLC
private byte jdoFlags
private javax.jdo.spi.PersistenceCapable beforeImage
private javax.jdo.spi.PersistenceCapable flushedImage
private static final StateFieldManager hollowFieldManager
private StateFieldManager objectFieldManager
private java.lang.Object metaData
private java.lang.Class myPCClass
private boolean inAfterCompletion
private boolean transitionTransient
private boolean allowedChangeApplicationIdentity
private java.util.BitSet loadedFields
private java.util.BitSet dirtyFields
private java.util.BitSet biFields
private int[] fieldArr
private java.lang.Object objectId
private java.lang.Object txObjectId
private java.lang.Object dependency
private FieldManager fieldManager
private java.lang.Object expectedProvider
private JDOClass jdoClass
private int numFields
static final javax.jdo.spi.JDOImplHelper jdoImplHelper
private static final RuntimeJavaModelFactory javaModelFactory
private static final ReachabilityHandler reachabilityHandler
private static final SCOProcessor scoProcessor
private static final java.lang.String ChangeApplicationIdentityOption
private static final I18NHelper msg
private static final org.apache.commons.logging.Log logger
Constructor Detail |
StateManagerImpl(javax.jdo.spi.PersistenceCapable pc, PersistenceManagerInternal pm)
StateManagerImpl
to process
future makePersistent request.
pc
- the reference to the associated PersistenceCapable instancepm
- the reference to the associated
PersistenceManagerInternal instanceStateManagerImpl(java.lang.Object uoid, java.lang.Object ioid, PersistenceManagerInternal pm, java.lang.Class clazz)
StateManagerImpl
when requested
from query processing.
uoid
- the reference to the user object IDioid
- the reference to the internal object IDpm
- the reference to the associated
PersistenceManagerInternal instanceclazz
- Class of the PersistenceCapable instanceMethod Detail |
private void initializePC()
private void initializePM(PersistenceManagerInternal pm)
pm
- the reference to the associated
PersistenceManagerInternal instanceprivate void markPKFieldsAsLoaded()
public void afterCompletion(boolean abort, boolean retainValues, boolean restoreValues)
afterCompletion
in interface StateManagerInternal
abort
- true if rollbackretainValues
- the flag that indicates how to proceed on commit.restoreValues
- the flag that indicates how to proceed on rollback.public void makePersistent()
makePersistent
in interface StateManagerInternal
public void deletePersistent()
deletePersistent
in interface StateManagerInternal
public void makeTransactional()
makeTransactional
in interface StateManagerInternal
public void makeNontransactional()
makeNontransactional
in interface StateManagerInternal
public void makeTransient()
makeTransient
in interface StateManagerInternal
public void evictInstance()
evictInstance
in interface StateManagerInternal
public void refreshInstance()
refreshInstance
in interface StateManagerInternal
public void retrieve()
retrieve
in interface StateManagerInternal
public void replace(int[] fields, FieldManager fieldManager)
replace
in interface StateManagerInternal
fields
- Indicates which fields should be replaced in the PC.fieldManager
- FieldManager from which the field's value should be
obtained.public void reload()
reload
in interface StateManagerInternal
public boolean flush(StoreManager srm)
StateManagerInternal
flush
in interface StateManagerInternal
srm
- The StoreManager to which the instance should send itself.
StateManagerInternal.flush(StoreManager srm)
public void handleReachability(boolean commit)
StateManagerInternal
handleReachability
in interface StateManagerInternal
commit
- is true if method is called inside the flush, false otherwiseStateManagerInternal.handleReachability(
boolean flag)
public void replaceSCOFields()
replaceSCOFields
in interface StateManagerInternal
StateManagerInternal.replaceSCOFields()
protected void unsetSCOFields()
public void makeDirty(int field)
StateManagerInternal
The StateManager will make a copy of the field so it can be restored if needed later, and then mark the field as modified in the current transaction.
makeDirty
in interface StateManagerInternal
field
- the number of the field(int field)
public void trackUpdates(int field, SCO sco)
trackUpdates
in interface StateManagerInternal
field
- the number of the fieldsco
- Tracked SCO instance.(int field,
SCO sco)
public java.lang.String getFieldName(int field)
StateManagerInternal
getFieldName
in interface StateManagerInternal
field
- the number of the field
(int field)
public java.lang.Class getPCClass()
StateManagerInternal
getPCClass
in interface StateManagerInternal
()
public void setPCClass(java.lang.Class pcClass)
StateManagerInternal
setPCClass
in interface StateManagerInternal
pcClass
- the Class type of the instance.(Class pcClass)
public boolean isNew()
isNew
in interface StateManagerInternal
true
if this StateManager represents an
instance made persistent in the current transaction.()
protected void makeAutoPersistent()
protected void makeAutoPersistent(java.lang.Object[] o)
o
- Array of referenced objectsprotected void resetOwner(java.lang.Object[] o, int field, boolean set)
o
- array of referenced objects.field
- the field number.set
- true if owner field should be set, false if unset.protected void resetOwner(java.util.Iterator it, int field, boolean set)
it
- Iterator over referenced objects.field
- the field number.set
- true if owner field should be set, false if unset.protected void restoreFields()
protected void clearFields()
protected void disconnect()
protected void reset()
protected void refresh()
protected void loadUnloaded()
protected void registerTransactional()
protected void registerNonTransactional()
protected void deregister()
protected void preDelete()
InstanceCallbacks.jdoPreDelete()
protected void postLoad()
protected void markAsFlushed()
protected void unsetBeforeImage()
protected void createBeforeImage()
protected boolean isSCOType(java.lang.Class type)
type
- Class type to check.
private void replaceSCOWithClones(int[] fields)
fields
- array of field numbers to process.private java.lang.Object fetchObjectField(int field)
field
- the field number
private void processReachability(boolean commit)
commit
- true if it is called during commit.private void resetOwner(java.lang.Object o, int field, boolean set)
o
- referenced object.field
- the field number.set
- true if owner field should be set, false if unset.private void resetOwner(SCO sco, int field, boolean set)
sco
- referenced SCO object.field
- the field number.set
- true if owner field should be set, false if unset.private void loadField(int field)
field
- the field numberprivate void loadingField(java.lang.Object pc, int field)
pc
- the calling PersistenceCapable instancefield
- the field numberprivate void prepareSetField(javax.jdo.spi.PersistenceCapable pc, int field, FieldManager fieldManager)
pc
- the calling PersistenceCapable instancefield
- the field numberfieldManager
- the FieldManager that handles double-dispatchprivate void prepareSetField(javax.jdo.spi.PersistenceCapable pc, int field, FieldManager fieldManager, java.lang.Object currentValue, java.lang.Object newValue)
pc
- the calling PersistenceCapable instancefield
- the field numberfieldManager
- the FieldManager that handles double-dispatchcurrentValue
- current value of the field.newValue
- the new value of the field.private void prepareSetField1(javax.jdo.spi.PersistenceCapable pc, int field)
pc
- the calling PersistenceCapable instancefield
- the field numberprivate void prepareSetField2(int field, FieldManager fieldManager)
field
- the field numberfieldManager
- the FieldManager that handles double-dispatchprivate void updateBeforeImage(int[] fields)
private void replaceSCO(SCO sco, int field)
sco
- tracked SCO instance to be replaced.field
- the field number.private void setSCOOwner(boolean set)
set
- true if owner should be set, false if references
to this SCO instance will be nullified and owner to be set to null.private void assertSCOElementType(java.lang.Object o, int field)
o
- Object to be tested.field
- the corresponding field number.
javax.jdo.JDOUserException
- if assertion fails.private java.lang.Object getTransactionalObjectId()
private void createAllBeforeImage()
private void markAllDirty()
private void initializeSM(int newState)
private void resetDirtyFields()
private void resetRef()
private boolean disconnectClone(javax.jdo.spi.PersistenceCapable pc)
private boolean verifyProvider(javax.jdo.spi.PersistenceCapable pc)
javax.jdo.JDOUserException
- if provider is not the one expected.private void fetch(StoreManager srm)
private void fetch(StoreManager srm, int[] fetchFields)
private int[] getFields(int field)
private int[] getUnloaded(int[] newfields, java.util.BitSet set)
private int[] getFieldNums(java.util.BitSet bs)
public byte replacingFlags(javax.jdo.spi.PersistenceCapable pc)
replacingFlags
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instance
public javax.jdo.spi.StateManager replacingStateManager(javax.jdo.spi.PersistenceCapable pc, javax.jdo.spi.StateManager sm)
replacingStateManager
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instance
public PersistenceManagerInternal getPersistenceManager()
getPersistenceManager
in interface StateManagerInternal
public javax.jdo.PersistenceManager getPersistenceManager(javax.jdo.spi.PersistenceCapable pc)
getPersistenceManager
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instance
public void makeDirty(javax.jdo.spi.PersistenceCapable pc, java.lang.String fieldName)
The StateManager will make a copy of the field so it can be restored if needed later, and then mark the field as modified in the current transaction.
makeDirty
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instancefieldName
- the name of the fieldpublic java.lang.Object getObjectId(javax.jdo.spi.PersistenceCapable pc)
getObjectId
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instance
public java.lang.Object getTransactionalObjectId(javax.jdo.spi.PersistenceCapable pc)
getTransactionalObjectId
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instance
public boolean isDirty(javax.jdo.spi.PersistenceCapable pc)
Transient instances return false.
isDirty
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instance
PersistenceCapable.jdoMakeDirty(String fieldName)
public boolean isTransactional(javax.jdo.spi.PersistenceCapable pc)
Transient instances return false.
isTransactional
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instance
public boolean isPersistent(javax.jdo.spi.PersistenceCapable pc)
Transient instances return false.
isPersistent
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instance
PersistenceManager.makePersistent(Object pc)
public boolean isNew(javax.jdo.spi.PersistenceCapable pc)
Transient instances return false.
isNew
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instance
PersistenceManager.makePersistent(Object pc)
public boolean isDeleted(javax.jdo.spi.PersistenceCapable pc)
Transient instances return false.
isDeleted
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instance
PersistenceManager.deletePersistent(Object pc)
public void preSerialize(javax.jdo.spi.PersistenceCapable pc)
preSerialize
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instancepublic boolean isLoaded(javax.jdo.spi.PersistenceCapable pc, int field)
isLoaded
in interface javax.jdo.spi.StateManager
pc
- the calling PersistenceCapable instancefield
- the field number
public boolean getBooleanField(javax.jdo.spi.PersistenceCapable pc, int field, boolean currentValue)
getBooleanField
in interface javax.jdo.spi.StateManager
StateManager.getBooleanField(
PersistenceCapable pc, int field, boolean currentValue)
public char getCharField(javax.jdo.spi.PersistenceCapable pc, int field, char currentValue)
getCharField
in interface javax.jdo.spi.StateManager
StateManager.getCharField(PersistenceCapable
pc, int field, char currentValue)
public byte getByteField(javax.jdo.spi.PersistenceCapable pc, int field, byte currentValue)
getByteField
in interface javax.jdo.spi.StateManager
StateManager.getByteField(
PersistenceCapable pc, int field, byte currentValue)
public short getShortField(javax.jdo.spi.PersistenceCapable pc, int field, short currentValue)
getShortField
in interface javax.jdo.spi.StateManager
StateManager.getShortField(
PersistenceCapable pc, int field, short currentValue)
public int getIntField(javax.jdo.spi.PersistenceCapable pc, int field, int currentValue)
getIntField
in interface javax.jdo.spi.StateManager
StateManager.getIntField(
PersistenceCapable pc, int field, int currentValue)
public long getLongField(javax.jdo.spi.PersistenceCapable pc, int field, long currentValue)
getLongField
in interface javax.jdo.spi.StateManager
StateManager.getLongField(
PersistenceCapable pc, int field, long currentValue)
public float getFloatField(javax.jdo.spi.PersistenceCapable pc, int field, float currentValue)
getFloatField
in interface javax.jdo.spi.StateManager
StateManager.getFloatField(
PersistenceCapable pc, int field, float currentValue)
public double getDoubleField(javax.jdo.spi.PersistenceCapable pc, int field, double currentValue)
getDoubleField
in interface javax.jdo.spi.StateManager
StateManager.getDoubleField(
PersistenceCapable pc, int field, double currentValue)
public java.lang.String getStringField(javax.jdo.spi.PersistenceCapable pc, int field, java.lang.String currentValue)
getStringField
in interface javax.jdo.spi.StateManager
StateManager.getStringField(
PersistenceCapable pc, int field, String currentValue)
public java.lang.Object getObjectField(javax.jdo.spi.PersistenceCapable pc, int field, java.lang.Object currentValue)
getObjectField
in interface javax.jdo.spi.StateManager
StateManager.getObjectField(
PersistenceCapable pc, int field, Object currentValue)
private void notNeededByRI(java.lang.String s)
public void setBooleanField(javax.jdo.spi.PersistenceCapable pc, int field, boolean currentValue, boolean newValue)
setBooleanField
in interface javax.jdo.spi.StateManager
StateManager.setBooleanField(
PersistenceCapable pc, int field, boolean currentValue, boolean newValue)
public void setCharField(javax.jdo.spi.PersistenceCapable pc, int field, char currentValue, char newValue)
setCharField
in interface javax.jdo.spi.StateManager
StateManager.setCharField(
PersistenceCapable pc, int field, char currentValue, char newValue)
public void setByteField(javax.jdo.spi.PersistenceCapable pc, int field, byte currentValue, byte newValue)
setByteField
in interface javax.jdo.spi.StateManager
StateManager.setByteField(
PersistenceCapable pc, int field, byte currentValue, byte newValue)
public void setShortField(javax.jdo.spi.PersistenceCapable pc, int field, short currentValue, short newValue)
setShortField
in interface javax.jdo.spi.StateManager
StateManager.setShortField(
PersistenceCapable pc, int field, short currentValue, short newValue)
public void setIntField(javax.jdo.spi.PersistenceCapable pc, int field, int currentValue, int newValue)
setIntField
in interface javax.jdo.spi.StateManager
StateManager.setIntField(
PersistenceCapable pc, int field, int currentValue, int newValue)
public void setLongField(javax.jdo.spi.PersistenceCapable pc, int field, long currentValue, long newValue)
setLongField
in interface javax.jdo.spi.StateManager
StateManager.setLongField(
PersistenceCapable pc, int field, long currentValue, long newValue)
public void setFloatField(javax.jdo.spi.PersistenceCapable pc, int field, float currentValue, float newValue)
setFloatField
in interface javax.jdo.spi.StateManager
StateManager.setFloatField(
PersistenceCapable pc, int field, float currentValue, float newValue)
public void setDoubleField(javax.jdo.spi.PersistenceCapable pc, int field, double currentValue, double newValue)
setDoubleField
in interface javax.jdo.spi.StateManager
StateManager.setDoubleField(
PersistenceCapable pc, int field, double currentValue, double newValue)
public void setStringField(javax.jdo.spi.PersistenceCapable pc, int field, java.lang.String currentValue, java.lang.String newValue)
setStringField
in interface javax.jdo.spi.StateManager
StateManager.setStringField(
PersistenceCapable pc, int field, String currentValue, String newValue)
public void setObjectField(javax.jdo.spi.PersistenceCapable pc, int field, java.lang.Object currentValue, java.lang.Object newValue)
setObjectField
in interface javax.jdo.spi.StateManager
StateManager.setObjectField(
PersistenceCapable pc, int field, Object currentValue, Object newValue)
public void providedBooleanField(javax.jdo.spi.PersistenceCapable pc, int field, boolean currentValue)
providedBooleanField
in interface javax.jdo.spi.StateManager
StateManager.providedBooleanField(
PersistenceCapable pc, int field, boolean currentValue)
public void providedCharField(javax.jdo.spi.PersistenceCapable pc, int field, char currentValue)
providedCharField
in interface javax.jdo.spi.StateManager
StateManager.providedCharField(
PersistenceCapable pc, int field, char currentValue)
public void providedByteField(javax.jdo.spi.PersistenceCapable pc, int field, byte currentValue)
providedByteField
in interface javax.jdo.spi.StateManager
StateManager.providedByteField(
PersistenceCapable pc, int field, byte currentValue)
public void providedShortField(javax.jdo.spi.PersistenceCapable pc, int field, short currentValue)
providedShortField
in interface javax.jdo.spi.StateManager
StateManager.providedShortField(
PersistenceCapable pc, int field, short currentValue)
public void providedIntField(javax.jdo.spi.PersistenceCapable pc, int field, int currentValue)
providedIntField
in interface javax.jdo.spi.StateManager
StateManager.providedIntField(
PersistenceCapable pc, int field, int currentValue)
public void providedLongField(javax.jdo.spi.PersistenceCapable pc, int field, long currentValue)
providedLongField
in interface javax.jdo.spi.StateManager
StateManager.providedLongField(
PersistenceCapable pc, int field, long currentValue)
public void providedFloatField(javax.jdo.spi.PersistenceCapable pc, int field, float currentValue)
providedFloatField
in interface javax.jdo.spi.StateManager
StateManager.providedFloatField(
PersistenceCapable pc, int field, float currentValue)
public void providedDoubleField(javax.jdo.spi.PersistenceCapable pc, int field, double currentValue)
providedDoubleField
in interface javax.jdo.spi.StateManager
StateManager.providedDoubleField(
PersistenceCapable pc, int field, double currentValue)
public void providedStringField(javax.jdo.spi.PersistenceCapable pc, int field, java.lang.String currentValue)
providedStringField
in interface javax.jdo.spi.StateManager
StateManager.providedStringField(
PersistenceCapable pc, int field, String currentValue)
public void providedObjectField(javax.jdo.spi.PersistenceCapable pc, int field, java.lang.Object currentValue)
providedObjectField
in interface javax.jdo.spi.StateManager
StateManager.providedObjectField(
PersistenceCapable pc, int field, Object currentValue)
public boolean replacingBooleanField(javax.jdo.spi.PersistenceCapable pc, int field)
replacingBooleanField
in interface javax.jdo.spi.StateManager
StateManager.replacingBooleanField(
PersistenceCapable pc, int field)
public char replacingCharField(javax.jdo.spi.PersistenceCapable pc, int field)
replacingCharField
in interface javax.jdo.spi.StateManager
StateManager.replacingCharField(
PersistenceCapable pc, int field)
public byte replacingByteField(javax.jdo.spi.PersistenceCapable pc, int field)
replacingByteField
in interface javax.jdo.spi.StateManager
StateManager.replacingByteField(
PersistenceCapable pc, int field)
public short replacingShortField(javax.jdo.spi.PersistenceCapable pc, int field)
replacingShortField
in interface javax.jdo.spi.StateManager
StateManager.replacingShortField(
PersistenceCapable pc, int field)
public int replacingIntField(javax.jdo.spi.PersistenceCapable pc, int field)
replacingIntField
in interface javax.jdo.spi.StateManager
StateManager.replacingIntField(
PersistenceCapable pc, int field)
public long replacingLongField(javax.jdo.spi.PersistenceCapable pc, int field)
replacingLongField
in interface javax.jdo.spi.StateManager
StateManager.replacingLongField(
PersistenceCapable pc, int field)
public float replacingFloatField(javax.jdo.spi.PersistenceCapable pc, int field)
replacingFloatField
in interface javax.jdo.spi.StateManager
StateManager.replacingFloatField(
PersistenceCapable pc, int field)
public double replacingDoubleField(javax.jdo.spi.PersistenceCapable pc, int field)
replacingDoubleField
in interface javax.jdo.spi.StateManager
StateManager.replacingDoubleField(
PersistenceCapable pc, int field)
public java.lang.String replacingStringField(javax.jdo.spi.PersistenceCapable pc, int field)
replacingStringField
in interface javax.jdo.spi.StateManager
StateManager.replacingStringField(
PersistenceCapable pc, int field)
public java.lang.Object replacingObjectField(javax.jdo.spi.PersistenceCapable pc, int field)
replacingObjectField
in interface javax.jdo.spi.StateManager
StateManager.replacingObjectField(
PersistenceCapable pc, int field)
public boolean isStored()
isStored
in interface StateManagerInternal
public boolean isFlushed()
isFlushed
in interface StateManagerInternal
public java.lang.Object setDependency(java.lang.Object dependency)
StateManagerInternal
setDependency
in interface StateManagerInternal
dependency
- new dependency objectStateManagerInternal.setDependency(
Object dependency)
public java.lang.Object getDependency()
StateManagerInternal
getDependency
in interface StateManagerInternal
StateManagerInternal.getDependency()
public javax.jdo.spi.PersistenceCapable getObject()
StateManagerInternal
getObject
in interface StateManagerInternal
StateManagerInternal.getObject()
public void setObjectId(java.lang.Object objectId)
StateManagerInternal
setObjectId
in interface StateManagerInternal
StateManagerInternal.setObjectId(Object objectId)
public java.lang.Object getInternalObjectId()
getInternalObjectId
in interface StateManagerInternal
public java.lang.Object getExternalObjectId()
getExternalObjectId
in interface StateManagerInternal
public void provideField(int fieldNumber, FieldManager fieldManager, boolean identifying)
StateManagerInternal
provideField
in interface StateManagerInternal
fieldNumber
- Indicates which field should be provided to the
fieldManager.fieldManager
- FieldManager to which the field should be given.identifying
- If true, provides values from the before or flushed
image, as determined by this StateManager's state; if false provides
values from the current image.StateManagerInternal.provideField(
int fieldNumber,
FieldManager fieldManager, boolean identifying)
public void provideFields(int[] fields, FieldManager fieldManager, boolean identifying)
StateManagerInternal
provideFields
in interface StateManagerInternal
fields
- Indicates which fields should be provided to the
fieldManager.fieldManager
- FieldManager to which the field should be given.identifying
- If true, provides values from the before or flushed
image, as determined by this StateManager's state; if false provides
values from the current image.StateManagerInternal.provideFields(int[] fields,
FieldManager fieldManager, boolean identifying)
public void replaceFields(int[] fields, FieldManager fieldManager)
StateManagerInternal
replaceFields
in interface StateManagerInternal
fields
- Indicates which fields should be replaced in the PC.fieldManager
- FieldManager from which the field values should
be obtained.StateManagerInternal.replaceFields(int[] fields,
FieldManager fieldManager)
protected void replaceUnloadedFields(int[] fields, FieldManager fieldManager)
fields
- Indicates which fields should be replaced in the PC.fieldManager
- FieldManager from which the field values should
be obtained.public void preStore()
StateManagerInternal
preStore
in interface StateManagerInternal
private void debug(java.lang.String msg)
msg
- String to displayprivate boolean debugging()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |