org.datanucleus.store.fieldmanager
Class CacheRetrieveFieldManager

java.lang.Object
  extended by org.datanucleus.store.fieldmanager.AbstractFieldManager
      extended by org.datanucleus.store.fieldmanager.CacheRetrieveFieldManager
All Implemented Interfaces:
FieldConsumer, FieldManager, FieldSupplier

public class CacheRetrieveFieldManager
extends AbstractFieldManager

FieldManager to handle the retrieval of fields from a L2 cached object into a managed object. Will be called for all fields that are loaded in an L2 cached object. Any relation fields will be handled using the OIDs stored in "relationFields" in the CachedPC. These OIDs are taken and the ObjectManager.findObject() is called. This can result in getting that object from the Level2 cache also, or maybe from the Level1 if it is already present there.


Constructor Summary
CacheRetrieveFieldManager(StateManager sm, CachedPC cachedPC)
          Constructor for a field manager for retrieval from the cache.
 
Method Summary
 boolean fetchBooleanField(int fieldNumber)
          Fetch a boolean field at the specified field number, returning it.
 byte fetchByteField(int fieldNumber)
          Fetch a byte field at the specified field number, returning it.
 char fetchCharField(int fieldNumber)
          Fetch a char field at the specified field number, returning it.
 double fetchDoubleField(int fieldNumber)
          Fetch a double field at the specified field number, returning it.
 float fetchFloatField(int fieldNumber)
          Fetch a float field at the specified field number, returning it.
 int fetchIntField(int fieldNumber)
          Fetch an int field at the specified field number, returning it.
 long fetchLongField(int fieldNumber)
          Fetch a long field at the specified field number, returning it.
 java.lang.Object fetchObjectField(int fieldNumber)
          Method to fetch an object field whether it is collection, map, PC, or whatever.
 short fetchShortField(int fieldNumber)
          Fetch a short field at the specified field number, returning it.
 java.lang.String fetchStringField(int fieldNumber)
          Fetch a string field at the specified field number, returning it.
 
Methods inherited from class org.datanucleus.store.fieldmanager.AbstractFieldManager
storeBooleanField, storeByteField, storeCharField, storeDoubleField, storeFloatField, storeIntField, storeLongField, storeObjectField, storeShortField, storeStringField
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheRetrieveFieldManager

public CacheRetrieveFieldManager(StateManager sm,
                                 CachedPC cachedPC)
Constructor for a field manager for retrieval from the cache.

Parameters:
sm - StateManager of the L2 cached object (temporarily connected to allow access to field values)
Method Detail

fetchObjectField

public java.lang.Object fetchObjectField(int fieldNumber)
Method to fetch an object field whether it is collection, map, PC, or whatever.

Specified by:
fetchObjectField in interface FieldSupplier
Overrides:
fetchObjectField in class AbstractFieldManager
Parameters:
fieldNumber - Number of the field
Returns:
The object stored in this field

fetchBooleanField

public boolean fetchBooleanField(int fieldNumber)
Description copied from interface: FieldSupplier
Fetch a boolean field at the specified field number, returning it.

Specified by:
fetchBooleanField in interface FieldSupplier
Overrides:
fetchBooleanField in class AbstractFieldManager
Parameters:
fieldNumber - Number of the field
Returns:
The value

fetchByteField

public byte fetchByteField(int fieldNumber)
Description copied from interface: FieldSupplier
Fetch a byte field at the specified field number, returning it.

Specified by:
fetchByteField in interface FieldSupplier
Overrides:
fetchByteField in class AbstractFieldManager
Parameters:
fieldNumber - Number of the field
Returns:
The value

fetchCharField

public char fetchCharField(int fieldNumber)
Description copied from interface: FieldSupplier
Fetch a char field at the specified field number, returning it.

Specified by:
fetchCharField in interface FieldSupplier
Overrides:
fetchCharField in class AbstractFieldManager
Parameters:
fieldNumber - Number of the field
Returns:
The value

fetchDoubleField

public double fetchDoubleField(int fieldNumber)
Description copied from interface: FieldSupplier
Fetch a double field at the specified field number, returning it.

Specified by:
fetchDoubleField in interface FieldSupplier
Overrides:
fetchDoubleField in class AbstractFieldManager
Parameters:
fieldNumber - Number of the field
Returns:
The value

fetchFloatField

public float fetchFloatField(int fieldNumber)
Description copied from interface: FieldSupplier
Fetch a float field at the specified field number, returning it.

Specified by:
fetchFloatField in interface FieldSupplier
Overrides:
fetchFloatField in class AbstractFieldManager
Parameters:
fieldNumber - Number of the field
Returns:
The value

fetchIntField

public int fetchIntField(int fieldNumber)
Description copied from interface: FieldSupplier
Fetch an int field at the specified field number, returning it.

Specified by:
fetchIntField in interface FieldSupplier
Overrides:
fetchIntField in class AbstractFieldManager
Parameters:
fieldNumber - Number of the field
Returns:
The value

fetchLongField

public long fetchLongField(int fieldNumber)
Description copied from interface: FieldSupplier
Fetch a long field at the specified field number, returning it.

Specified by:
fetchLongField in interface FieldSupplier
Overrides:
fetchLongField in class AbstractFieldManager
Parameters:
fieldNumber - Number of the field
Returns:
The value

fetchShortField

public short fetchShortField(int fieldNumber)
Description copied from interface: FieldSupplier
Fetch a short field at the specified field number, returning it.

Specified by:
fetchShortField in interface FieldSupplier
Overrides:
fetchShortField in class AbstractFieldManager
Parameters:
fieldNumber - Number of the field
Returns:
The value

fetchStringField

public java.lang.String fetchStringField(int fieldNumber)
Description copied from interface: FieldSupplier
Fetch a string field at the specified field number, returning it.

Specified by:
fetchStringField in interface FieldSupplier
Overrides:
fetchStringField in class AbstractFieldManager
Parameters:
fieldNumber - Number of the field
Returns:
The value


Copyright © 2010. All Rights Reserved.