Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 3.4.1 generated on May 30 2006
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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.
`Object` | `fetchInitialField(int field)` Return the value of the field at the specified index as of the beginning of the transaction.
`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.
`BitSet` | `getFlushed()` Return a read-only mask of the indexes of all fields that have been flushed since they were last changed.
`Object` | `getId()` Return the identifier for this state manager.
`Object` | `getImplData()` An object that concrete back ends can associate with each instance.
`Object` | `getImplData(int field)` Field-level impl data.
`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.
`Object` | `getLock()` The lock object set for this instance.
`ClassMetaData` | `getMetaData()` Get the metadata for this instance.
`Object` | `getObjectId()` Return the managed object's id.
`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.
`BitSet` | `getUnloaded(FetchConfiguration fetch)` Return a mutable mask of the unloaded fields that need loading based on the given fetch configuration.
`Object` | `getVersion()` Return the current version indicator for this instance.
`void` | `initialize(Class forType, JDOState state)` Initialize the state manager with a new instance of the given persistence capable type and the proper JDO lifecycle state.
`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` | `isFlushedDirty()` Return whether this object has been flushed, then dirtied again.
`boolean` | `isImplDataCacheable()` Whether the instance-level impl data can be shared among instances in different persistence managers if L2 caching is enabled.
`boolean` | `isImplDataCacheable(int field)` Whether the field's impl data is loaded and can be shared among instances in different persistence managers if L2 caching is enabled.
`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` | `newFieldProxy(int field)` Create a new hollow proxy instance for the given field.
`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` | `setImplData(int field, Object data)` Field-level impl data.
`Object` | `setImplData(Object data, boolean cacheable)` An object that concrete back ends can associate with each 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` | `setLock(Object lock)` The lock object set for this instance.
`void` | `setNextVersion(Object version)` Set the next version indicator in the datastore pending a successful flush.
`void` | `setObjectId(Object oid)` Set the object id for the managed 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. Invoking this method may change the metadata for the state manager, as the instance specified in the parameter may be a subclass of the expected type.

### initialize

    public void initialize(Class forType,
                           JDOState state)

  Initialize the state manager with a new instance of the given persistence capable type and the proper JDO lifecycle state. Invoking this method may change the object id and metadata for the state manager, as the concrete type specified in the parameter may be a subclass of the expected type.
  Parameters:
    `forType` - the type for which to create a new instance
    `state` - the initial state to which to set the instance
  Since:
    3.1.2

### 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.

### isFlushedDirty

    public boolean isFlushedDirty()

  Return whether this object has been flushed, then dirtied again.

### 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.

### getUnloaded

    public BitSet getUnloaded(FetchConfiguration fetch)

  Return a mutable mask of 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.

### newFieldProxy

    public Object newFieldProxy(int field)

  Create a new hollow proxy instance for the given field. This method differs from `newProxy(int)` in that it returns a proxy for the field's declared type, not its externalized type.
  See Also:
    `newProxy(int)`

### getPersistenceManager

    public KodoPersistenceManager getPersistenceManager()

  Return the managing persistence manager.

### getId

    public Object getId()

  Return the identifier for this state manager. This may return a temporary identifier for new unflushed instances that have not been assigned an object id, or for non-persistent or embedded instances. For all other instances this method is the same as `getObjectId()`.

### getObjectId

    public Object getObjectId()

  Return the managed object's id. This method may return null if no id has been assigned. Ids are assigned to new instances when the user first asks for the id, or on flush.

### setObjectId

    public void setObjectId(Object oid)

  Set the object id for the managed instance. Some back ends may not be able to assign a permanent oid until flush. Do not call this method on application identity instances; changing the primary key fields of application identity objects through the `storeXXXField` methods will automatically change the oid.

### getLock

    public Object getLock()

  The lock object set for this instance. This object is generally managed by the system lock manager.

### setLock

    public void setLock(Object lock)

  The lock object set for this instance. This object is generally managed by the system lock manager.

### 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. Version objects should be serializable and should not require vendor-specific classes, because they are transferred to detached objects.

### 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.

### getJDOState

    public JDOState getJDOState()

  Return the JDO state that this object is in.

### getImplData

    public Object getImplData()

  An object that concrete back ends can associate with each instance. This object is not used or modified in any way by the generic JDO layer.

### setImplData

    public Object setImplData(Object data,
                              boolean cacheable)

  An object that concrete back ends can associate with each instance. This object is not used or modified in any way by the generic JDO layer.
  Parameters:
    `cacheable` - whether the impl data can be shared among instances in different persistence managers if L2 caching is enabled
  Returns:
    the previous impl data value, if any

### isImplDataCacheable

    public boolean isImplDataCacheable()

  Whether the instance-level impl data can be shared among instances in different persistence managers if L2 caching is enabled.

### getImplData

    public Object getImplData(int field)

  Field-level impl data. Field-level data only applies to loaded fields, and is cleared when the field is cleared.

### setImplData

    public Object setImplData(int field,
                              Object data)

  Field-level impl data. Field-level data only applies to loaded fields, and is cleared when the field is cleared. Whether the data is cached across instances depends on the corresponding field metadata's response to `FieldMetaData.usesImplData()`.
  Returns:
    the previous impl data value, if any

### isImplDataCacheable

    public boolean isImplDataCacheable(int field)

  Whether the field's impl data is loaded and can be shared among instances in different persistence managers if L2 caching is enabled.

### 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.

### 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)`.

### fetchInitialField

    public Object fetchInitialField(int field)

  Return the value of the field at the specified index as of the beginning of the transaction.
  Since:
    3.1.1

Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 3.4.1 generated on May 30 2006
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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