SolarMetric Kodo JDO 3.0.3 generated on February 20 2004

kodo.runtime
Interface KodoStateManager

All Superinterfaces:
PersistenceCapable.ObjectIdFieldConsumer, PersistenceCapable.ObjectIdFieldManager, PersistenceCapable.ObjectIdFieldSupplier, StateManager
All Known Subinterfaces:
KodoStateManagerSPI

public interface KodoStateManager
extends StateManager, PersistenceCapable.ObjectIdFieldManager

Interface implemented by Kodo state managers. Each state manager manages the state of a single persistence capable instance. The state manager is also responsible for all communications about the instance to the StoreManager.

The fetchXXXField and storeXXXField methods can be used to get and set fields of the managed persistent object. Most back-end code, however, should use the similar fetchXXX and storeXXX methods in place of the field methods. These methods function just like the field methods, but also pass the value through the externalizer and factory the field may have.


Method Summary
 Object fetch(int field)
          Return the externalized value of the field with the given index as an object.
 boolean fetchBoolean(int field)
          Fetch the external value of the given field.
 byte fetchByte(int field)
          Fetch the external value of the given field.
 char fetchChar(int field)
          Fetch the external value of the given field.
 double fetchDouble(int field)
          Fetch the external value of the given field.
 Object fetchField(int field, boolean transitions)
          Return the value of the field with the given index as an object.
 float fetchFloat(int field)
          Fetch the external value of the given field.
 int fetchInt(int field)
          Fetch the external value of the given field.
 long fetchLong(int field)
          Fetch the external value of the given field.
 Object fetchObject(int field)
          Fetch the external value of the given field.
 short fetchShort(int field)
          Fetch the external value of the given field.
 String fetchString(int field)
          Fetch the external value of the given field.
 BitSet getDirty()
          Return a read-only mask of the indexes of all dirty fields.
 Collection getDirtyFields()
          Return a set of FieldMetaDatas for all dirty fields; this operation is slower than getDirty().
 BitSet getFlushed()
          Return a read-only mask of the indexes of all fields that have been flushed since they were last changed.
 Collection getFlushedFields()
          Return a set of FieldMetaDatas for all flushed fields; this operation is slower than getFlushed().
 Object getImplData(Object key)
          Return the associated implementation object for the given key, if any.
 Object getIntermediate(int field)
          Use intermediate field data to store intermediate information that might be available before the field is fully loaded.
 JDOState getJDOState()
          Return the JDO state that this object is in.
 BitSet getLoaded()
          Return a read-only mask of the indexes of all loaded fields.
 Collection getLoadedFields()
          Return a set of FieldMetaDatas for all loaded fields; this operation is slower than getLoaded().
 ClassMetaData getMetaData()
          Get the metadata for this instance.
 Object getObjectId(boolean trans, boolean owner)
          Return this state manager's object id as of the beginning of the transaction.
 KodoStateManager getOwner()
          Return the owning state if this is an embedded instance.
 int getOwnerField()
          Return the field number of the owning object if this is an embedded instance.
 PersistenceCapable getPersistenceCapable()
          Return the managed instance.
 KodoPersistenceManager getPersistenceManager()
          Return the managing persistence manager.
 Collection getUnloadedFields(FetchConfiguration fetch)
          Return the unloaded fields that need loading based on the given fetch configuration.
 Object getVersion()
          Return the current version indicator for this instance.
 void initialize(PersistenceCapable pc, JDOState state)
          Initialize the state manager with its managed persistence capable object the proper JDO lifecycle state.
 boolean isDeleted()
          Equivalent to same-named StateManager method.
 boolean isDirty()
          Equivalent to same-named StateManager method.
 boolean isEmbedded()
          Return true if this instance has an owner, meaning it is an embedded value.
 boolean isFlushed()
          Return whether this object has been flushed to the database in this transaction.
 boolean isNew()
          Equivalent to same-named StateManager method.
 boolean isPersistent()
          Equivalent to same-named StateManager method.
 boolean isTransactional()
          Equivalent to same-named StateManager method.
 void makeDirty(int field)
          Mark the field with the given index as dirty.
 Object newProxy(int field)
          Create a new hollow proxy instance for the given field.
 void removed(int field, Object removed, boolean key)
          Notification given by proxies that the given object was removed from the given container field, and whether removed from its key set or from its elements/values.
 Object removeImplData(Object key)
          Remove the given key from the store of implementation-specific data, returning the key's value (if any).
 void setImplData(Object key, Object value, boolean sticky)
          This method is provided to the concrete JDO implementation to allow the association of arbitrary extra data with an instance.
 void setIntermediate(int field, Object value)
          Use intermediate field data to store intermediate information that might be available before the field is fully loaded.
 void setNextVersion(Object version)
          Set the next version indicator in the datastore pending a successful flush.
 void setTransactionalObjectId(Object oid)
          Set the transactional object id for this instance.
 void setVersion(Object version)
          Set the version indicator for this instance, as loaded from the data store.
 void store(int field, Object value)
          Set the value of the field with the given index as from the external object value.
 void storeBoolean(int field, boolean externalVal)
          Store the given external value back into the given field.
 void storeByte(int field, byte externalVal)
          Store the given external value back into the given field.
 void storeChar(int field, char externalVal)
          Store the given external value back into the given field.
 void storeDouble(int field, double externalVal)
          Store the given external value back into the given field.
 void storeField(int field, Object value)
          Set the value of the field with the given index as an object.
 void storeFloat(int field, float externalVal)
          Store the given external value back into the given field.
 void storeInt(int field, int externalVal)
          Store the given external value back into the given field.
 void storeLong(int field, long externalVal)
          Store the given external value back into the given field.
 void storeObject(int field, Object externalVal)
          Store the given external value back into the given field.
 void storeShort(int field, short externalVal)
          Store the given external value back into the given field.
 void storeString(int field, String externalVal)
          Store the given external value back into the given field.
 
Methods inherited from interface javax.jdo.spi.StateManager
getBooleanField, getByteField, getCharField, getDoubleField, getFloatField, getIntField, getLongField, getObjectField, getObjectId, getPersistenceManager, getShortField, getStringField, getTransactionalObjectId, isDeleted, isDirty, isLoaded, isNew, isPersistent, isTransactional, makeDirty, preSerialize, providedBooleanField, providedByteField, providedCharField, providedDoubleField, providedFloatField, providedIntField, providedLongField, providedObjectField, providedShortField, providedStringField, replacingBooleanField, replacingByteField, replacingCharField, replacingDoubleField, replacingFlags, replacingFloatField, replacingIntField, replacingLongField, replacingObjectField, replacingShortField, replacingStateManager, replacingStringField, setBooleanField, setByteField, setCharField, setDoubleField, setFloatField, setIntField, setLongField, setObjectField, setShortField, setStringField
 
Methods inherited from interface javax.jdo.spi.PersistenceCapable.ObjectIdFieldConsumer
storeBooleanField, storeByteField, storeCharField, storeDoubleField, storeFloatField, storeIntField, storeLongField, storeObjectField, storeShortField, storeStringField
 
Methods inherited from interface javax.jdo.spi.PersistenceCapable.ObjectIdFieldSupplier
fetchBooleanField, fetchByteField, fetchCharField, fetchDoubleField, fetchFloatField, fetchIntField, fetchLongField, fetchObjectField, fetchShortField, fetchStringField
 

Method Detail

initialize

public void initialize(PersistenceCapable pc,
                       JDOState state)
Initialize the state manager with its managed persistence capable object the proper JDO lifecycle state.

getPersistenceCapable

public PersistenceCapable getPersistenceCapable()
Return the managed instance.

getMetaData

public ClassMetaData getMetaData()
Get the metadata for this instance.

getOwner

public KodoStateManager getOwner()
Return the owning state if this is an embedded instance.

getOwnerField

public int getOwnerField()
Return the field number of the owning object if this is an embedded instance.

isEmbedded

public boolean isEmbedded()
Return true if this instance has an owner, meaning it is an embedded value.

isTransactional

public boolean isTransactional()
Equivalent to same-named StateManager method.

isPersistent

public boolean isPersistent()
Equivalent to same-named StateManager method.

isNew

public boolean isNew()
Equivalent to same-named StateManager method.

isDeleted

public boolean isDeleted()
Equivalent to same-named StateManager method.

isDirty

public boolean isDirty()
Equivalent to same-named StateManager method.

isFlushed

public boolean isFlushed()
Return whether this object has been flushed to the database in this transaction.

getLoaded

public BitSet getLoaded()
Return a read-only mask of the indexes of all loaded fields.

getDirty

public BitSet getDirty()
Return a read-only mask of the indexes of all dirty fields.

getFlushed

public BitSet getFlushed()
Return a read-only mask of the indexes of all fields that have been flushed since they were last changed.

getLoadedFields

public Collection getLoadedFields()
Return a set of FieldMetaDatas for all loaded fields; this operation is slower than getLoaded().

getDirtyFields

public Collection getDirtyFields()
Return a set of FieldMetaDatas for all dirty fields; this operation is slower than getDirty().

getFlushedFields

public Collection getFlushedFields()
Return a set of FieldMetaDatas for all flushed fields; this operation is slower than getFlushed().

getUnloadedFields

public Collection getUnloadedFields(FetchConfiguration fetch)
Return the unloaded fields that need loading based on the given fetch configuration. Pass in null to retrieve all unloaded fields.

makeDirty

public void makeDirty(int field)
Mark the field with the given index as dirty.

removed

public void removed(int field,
                    Object removed,
                    boolean key)
Notification given by proxies that the given object was removed from the given container field, and whether removed from its key set or from its elements/values.

newProxy

public Object newProxy(int field)
Create a new hollow proxy instance for the given field. In cases where the field externalizes to an SCO but is declared something else, the returned object may not implement Proxy. In all other cases, this method delegates to the system ProxyManager with the correct field information. The returned proxy's owner is unset so that modifications to the proxy will not be tracked while its state is initialized. Calling storeField(int, java.lang.Object) or store(int, java.lang.Object) will set the proxy's owner automatically.

getPersistenceManager

public KodoPersistenceManager getPersistenceManager()
Return the managing persistence manager.

getObjectId

public Object getObjectId(boolean trans,
                          boolean owner)
Return this state manager's object id as of the beginning of the transaction. Note this method does not return a copy like the equivalent StateManager method that takes a pc instance.
Parameters:
trans - if true, return the oid value based on the current values of the primary key fields; if false return the value as of the beginning of the transaction
owner - if true, recurse to the top-most owning state manager (if this instance is embedded) to get the oid

setTransactionalObjectId

public void setTransactionalObjectId(Object oid)
Set the transactional object id for this instance. Some back ends may not be able to assign a permanent oid until flush; those back ends can call this method on flush for datastore identity objects, or reset the primary key fields of application identity objects. through the storeXXXField methods.

getVersion

public Object getVersion()
Return the current version indicator for this instance.

setVersion

public void setVersion(Object version)
Set the version indicator for this instance, as loaded from the data store. This method is used by the StoreManager when loading instance data. On rollback, the version will be rolled back to this value.

setNextVersion

public void setNextVersion(Object version)
Set the next version indicator in the datastore pending a successful flush. The StoreManager uses this method during flush.

getImplData

public Object getImplData(Object key)
Return the associated implementation object for the given key, if any.

removeImplData

public Object removeImplData(Object key)
Remove the given key from the store of implementation-specific data, returning the key's value (if any).

setImplData

public void setImplData(Object key,
                        Object value,
                        boolean sticky)
This method is provided to the concrete JDO implementation to allow the association of arbitrary extra data with an instance. If the sticky parameter is true, then the data will remain with the state manager until you remove it. Otherwise, the data will be cleared the next time the state manager's fields are cleared.

getIntermediate

public Object getIntermediate(int field)
Use intermediate field data to store intermediate information that might be available before the field is fully loaded. The system will automatically clear this data when the field gets loaded. This data should be cacheable; the datastore cache will attempt to cache it if the field value is not available.

setIntermediate

public void setIntermediate(int field,
                            Object value)
Use intermediate field data to store intermediate information that might be available before the field is fully loaded. The system will automatically clear this data when the field gets loaded. This data should be cacheable; the datastore cache will attempt to cache it if the field value is not available.

getJDOState

public JDOState getJDOState()
Return the JDO state that this object is in.

fetchField

public Object fetchField(int field,
                         boolean transitions)
Return the value of the field with the given index as an object.
Parameters:
transitions - if true, this method will cause state transitions to occur as if the field were accessed normally

storeField

public void storeField(int field,
                       Object value)
Set the value of the field with the given index as an object.

fetchBoolean

public boolean fetchBoolean(int field)
Fetch the external value of the given field.

fetchByte

public byte fetchByte(int field)
Fetch the external value of the given field.

fetchChar

public char fetchChar(int field)
Fetch the external value of the given field.

fetchDouble

public double fetchDouble(int field)
Fetch the external value of the given field.

fetchFloat

public float fetchFloat(int field)
Fetch the external value of the given field.

fetchInt

public int fetchInt(int field)
Fetch the external value of the given field.

fetchLong

public long fetchLong(int field)
Fetch the external value of the given field.

fetchObject

public Object fetchObject(int field)
Fetch the external value of the given field.

fetchShort

public short fetchShort(int field)
Fetch the external value of the given field.

fetchString

public String fetchString(int field)
Fetch the external value of the given field.

fetch

public Object fetch(int field)
Return the externalized value of the field with the given index as an object. If there is no externalizer, this is equivalent to fetchField(int, boolean).

storeBoolean

public void storeBoolean(int field,
                         boolean externalVal)
Store the given external value back into the given field.

storeByte

public void storeByte(int field,
                      byte externalVal)
Store the given external value back into the given field.

storeChar

public void storeChar(int field,
                      char externalVal)
Store the given external value back into the given field.

storeDouble

public void storeDouble(int field,
                        double externalVal)
Store the given external value back into the given field.

storeFloat

public void storeFloat(int field,
                       float externalVal)
Store the given external value back into the given field.

storeInt

public void storeInt(int field,
                     int externalVal)
Store the given external value back into the given field.

storeLong

public void storeLong(int field,
                      long externalVal)
Store the given external value back into the given field.

storeObject

public void storeObject(int field,
                        Object externalVal)
Store the given external value back into the given field.

storeShort

public void storeShort(int field,
                       short externalVal)
Store the given external value back into the given field.

storeString

public void storeString(int field,
                        String externalVal)
Store the given external value back into the given field.

store

public void store(int field,
                  Object value)
Set the value of the field with the given index as from the external object value. If there is no externalizer, this is equivalent to storeField(int, java.lang.Object).

SolarMetric Kodo JDO 3.0.3 generated on February 20 2004

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