org.apache.jdo.impl.fostore
Class FieldFetcher

java.lang.Object
  extended byorg.apache.jdo.impl.fostore.AbstractFieldManager
      extended byorg.apache.jdo.impl.fostore.FieldFetcher
All Implemented Interfaces:
FieldManager

class FieldFetcher
extends AbstractFieldManager

Extend AbstractFieldManager overriding only fetchABCField methods

Author:
Dave Bristor

Field Summary
private  java.lang.ClassLoader candidateLoader
          ClassLoader to use for loading the class of the instance.
private  java.lang.Class cls
          Class of instance being fetched.
private  int currNum
           
private  FOStoreInput fin
          Read values from here.
(package private) static org.apache.commons.logging.Log logger
          Logger
private  FOStoreModel model
           
private static I18NHelper msg
          I18N support.
private  OID oid
           
private  OID oldOID
           
private  PersistenceManagerInternal pm
          PM on whose behalf we read
private  boolean skip
           
private  StateManagerInternal sm
           
 
Constructor Summary
(package private) FieldFetcher(FOStoreInput fin, FOStoreModel model, PersistenceManagerInternal pm, java.lang.ClassLoader candidateLoader)
           
(package private) FieldFetcher(FOStoreInput fin, FOStoreModel model, PersistenceManagerInternal pm, java.lang.ClassLoader candidateLoader, boolean skip)
          Called by AID when PK fields are written sequentially independent of their actual field numbers.
 
Method Summary
private  void fetch()
          Fetches data from input, resulting in an PersistenceCapable object with state from the datastore.
(package private)  StateManagerInternal fetch(OID oid)
          Invoke this if you have an OID for the object that you're fetching.
(package private)  void fetch(StateManagerInternal sm, OID oid)
          Invoke this if you have a StateManagerInternal for the object that you're fetching.
 boolean fetchBooleanField(int fieldNum)
           
 byte fetchByteField(int fieldNum)
           
 char fetchCharField(int fieldNum)
           
 double fetchDoubleField(int fieldNum)
           
 float fetchFloatField(int fieldNum)
           
 int fetchIntField(int fieldNum)
           
 long fetchLongField(int fieldNum)
           
 java.lang.Object fetchObjectField(int fieldNum)
           
 short fetchShortField(int fieldNum)
           
 java.lang.String fetchStringField(int fieldNum)
           
(package private)  void setPCClass(java.lang.Class pcClass)
           
private  void skipFields(int fieldNum)
           
 void storeBooleanField(int fieldNum, boolean value)
          Provides the means by which the value of a boolean field can be given by a StateManager to an object that needs the value.
 void storeByteField(int fieldNum, byte value)
          Provides the means by which the value of a byte field can be given by a StateManager to an object that needs the value.
 void storeCharField(int fieldNum, char value)
          Provides the means by which the value of a char field can be given by a StateManager to an object that needs the value.
 void storeDoubleField(int fieldNum, double value)
          Provides the means by which the value of a double field can be given by a StateManager to an object that needs the value.
 void storeFloatField(int fieldNum, float value)
          Provides the means by which the value of a field can be given by a StateManager to an object that needs the value.
 void storeIntField(int fieldNum, int value)
          Provides the means by which the value of a int field can be given by a StateManager to an object that needs the value.
 void storeLongField(int fieldNum, long value)
          Provides the means by which the value of a long field can be given by a StateManager to an object that needs the value.
 void storeObjectField(int fieldNum, java.lang.Object value)
          Provides the means by which the value of an Object field can be given by a StateManager to an object that needs the value.
 void storeShortField(int fieldNum, short value)
          Provides the means by which the value of a short field can be given by a StateManager to an object that needs the value.
 void storeStringField(int fieldNum, java.lang.String value)
          Provides the means by which the value of a String field can be given by a StateManager to an object that needs the value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fin

private final FOStoreInput fin
Read values from here.


pm

private final PersistenceManagerInternal pm
PM on whose behalf we read


model

private final FOStoreModel model

candidateLoader

private final java.lang.ClassLoader candidateLoader
ClassLoader to use for loading the class of the instance.


cls

private java.lang.Class cls
Class of instance being fetched.


sm

private StateManagerInternal sm

oid

private OID oid

oldOID

private OID oldOID

currNum

private int currNum

skip

private boolean skip

msg

private static final I18NHelper msg
I18N support.


logger

static final org.apache.commons.logging.Log logger
Logger

Constructor Detail

FieldFetcher

FieldFetcher(FOStoreInput fin,
             FOStoreModel model,
             PersistenceManagerInternal pm,
             java.lang.ClassLoader candidateLoader)

FieldFetcher

FieldFetcher(FOStoreInput fin,
             FOStoreModel model,
             PersistenceManagerInternal pm,
             java.lang.ClassLoader candidateLoader,
             boolean skip)
Called by AID when PK fields are written sequentially independent of their actual field numbers.

Method Detail

fetch

void fetch(StateManagerInternal sm,
           OID oid)
     throws java.io.IOException
Invoke this if you have a StateManagerInternal for the object that you're fetching. For example, see FetchRequest.handleReply().

Throws:
java.io.IOException

fetch

StateManagerInternal fetch(OID oid)
                     throws java.io.IOException
Invoke this if you have an OID for the object that you're fetching. For example, see GetExtentRequest.handleReply().

Throws:
java.io.IOException

fetch

private void fetch()
            throws java.io.IOException
Fetches data from input, resulting in an PersistenceCapable object with state from the datastore. The format of the data is as per that described in InsertRequest.

Throws:
java.io.IOException

setPCClass

void setPCClass(java.lang.Class pcClass)

fetchBooleanField

public boolean fetchBooleanField(int fieldNum)
Specified by:
fetchBooleanField in interface FieldManager
Overrides:
fetchBooleanField in class AbstractFieldManager
See Also:
FieldManager.fetchBooleanField(int fieldNum)

fetchCharField

public char fetchCharField(int fieldNum)
Specified by:
fetchCharField in interface FieldManager
Overrides:
fetchCharField in class AbstractFieldManager
See Also:
FieldManager.fetchCharField(int fieldNum)

fetchByteField

public byte fetchByteField(int fieldNum)
Specified by:
fetchByteField in interface FieldManager
Overrides:
fetchByteField in class AbstractFieldManager
See Also:
FieldManager.fetchByteField(int fieldNum)

fetchShortField

public short fetchShortField(int fieldNum)
Specified by:
fetchShortField in interface FieldManager
Overrides:
fetchShortField in class AbstractFieldManager
See Also:
FieldManager.fetchShortField(int fieldNum)

fetchIntField

public int fetchIntField(int fieldNum)
Specified by:
fetchIntField in interface FieldManager
Overrides:
fetchIntField in class AbstractFieldManager
See Also:
FieldManager.fetchIntField(int fieldNum)

fetchLongField

public long fetchLongField(int fieldNum)
Specified by:
fetchLongField in interface FieldManager
Overrides:
fetchLongField in class AbstractFieldManager
See Also:
FieldManager.fetchLongField(int fieldNum)

fetchFloatField

public float fetchFloatField(int fieldNum)
Specified by:
fetchFloatField in interface FieldManager
Overrides:
fetchFloatField in class AbstractFieldManager
See Also:
FieldManager.fetchFloatField(int fieldNum)

fetchDoubleField

public double fetchDoubleField(int fieldNum)
Specified by:
fetchDoubleField in interface FieldManager
Overrides:
fetchDoubleField in class AbstractFieldManager
See Also:
FieldManager.fetchDoubleField(int fieldNum)

fetchStringField

public java.lang.String fetchStringField(int fieldNum)
Specified by:
fetchStringField in interface FieldManager
Overrides:
fetchStringField in class AbstractFieldManager
See Also:
FieldManager.fetchStringField(int fieldNum)

fetchObjectField

public java.lang.Object fetchObjectField(int fieldNum)
Specified by:
fetchObjectField in interface FieldManager
Overrides:
fetchObjectField in class AbstractFieldManager
See Also:
FieldManager.fetchObjectField(int fieldNum)

skipFields

private void skipFields(int fieldNum)

storeBooleanField

public void storeBooleanField(int fieldNum,
                              boolean value)
Description copied from interface: FieldManager
Provides the means by which the value of a boolean field can be given by a StateManager to an object that needs the value.

Specified by:
storeBooleanField in interface FieldManager
Parameters:
fieldNum - Field number of the field in the object whose value is given.
value - Boolean that is the value of a particular field.
See Also:
FieldManager.storeBooleanField(int fieldNum, boolean value)

storeCharField

public void storeCharField(int fieldNum,
                           char value)
Description copied from interface: FieldManager
Provides the means by which the value of a char field can be given by a StateManager to an object that needs the value.

Specified by:
storeCharField in interface FieldManager
Parameters:
fieldNum - Field number of the field in the object whose value is given.
value - Char that is the value of a particular field.
See Also:
FieldManager.storeCharField(int fieldNum, char value)

storeByteField

public void storeByteField(int fieldNum,
                           byte value)
Description copied from interface: FieldManager
Provides the means by which the value of a byte field can be given by a StateManager to an object that needs the value.

Specified by:
storeByteField in interface FieldManager
Parameters:
fieldNum - Field number of the field in the object whose value is given.
value - Byte that is the value of a particular field.
See Also:
FieldManager.storeByteField(int fieldNum, byte value)

storeShortField

public void storeShortField(int fieldNum,
                            short value)
Description copied from interface: FieldManager
Provides the means by which the value of a short field can be given by a StateManager to an object that needs the value.

Specified by:
storeShortField in interface FieldManager
Parameters:
fieldNum - Field number of the field in the object whose value is given.
value - Short that is the value of a particular field.
See Also:
FieldManager.storeShortField(int fieldNum, short value)

storeIntField

public void storeIntField(int fieldNum,
                          int value)
Description copied from interface: FieldManager
Provides the means by which the value of a int field can be given by a StateManager to an object that needs the value.

Specified by:
storeIntField in interface FieldManager
Parameters:
fieldNum - Field number of the field in the object whose value is given.
value - Int that is the value of a particular field.
See Also:
FieldManager.storeIntField(int fieldNum, int value)

storeLongField

public void storeLongField(int fieldNum,
                           long value)
Description copied from interface: FieldManager
Provides the means by which the value of a long field can be given by a StateManager to an object that needs the value.

Specified by:
storeLongField in interface FieldManager
Parameters:
fieldNum - Field number of the field in the object whose value is given.
value - Long that is the value of a particular field.
See Also:
FieldManager.storeLongField(int fieldNum, long value)

storeFloatField

public void storeFloatField(int fieldNum,
                            float value)
Description copied from interface: FieldManager
Provides the means by which the value of a field can be given by a StateManager to an object that needs the value.

Specified by:
storeFloatField in interface FieldManager
Parameters:
fieldNum - Field number of the field in the object whose value is given.
value - that is the value of a particular field.
See Also:
FieldManager.storeFloatField(int fieldNum, float value)

storeDoubleField

public void storeDoubleField(int fieldNum,
                             double value)
Description copied from interface: FieldManager
Provides the means by which the value of a double field can be given by a StateManager to an object that needs the value.

Specified by:
storeDoubleField in interface FieldManager
Parameters:
fieldNum - Field number of the field in the object whose value is given.
value - Double that is the value of a particular field.
See Also:
FieldManager.storeDoubleField(int fieldNum, double value)

storeStringField

public void storeStringField(int fieldNum,
                             java.lang.String value)
Description copied from interface: FieldManager
Provides the means by which the value of a String field can be given by a StateManager to an object that needs the value.

Specified by:
storeStringField in interface FieldManager
Parameters:
fieldNum - Field number of the field in the object whose value is given.
value - String that is the value of a particular field.
See Also:
FieldManager.storeStringField(int fieldNum, String value)

storeObjectField

public void storeObjectField(int fieldNum,
                             java.lang.Object value)
Description copied from interface: FieldManager
Provides the means by which the value of an Object field can be given by a StateManager to an object that needs the value.

Specified by:
storeObjectField in interface FieldManager
Parameters:
fieldNum - Field number of the field in the object whose value is given.
value - Object that is the value of a particular field.
See Also:
FieldManager.storeObjectField(int fieldNum, Object value)