org.apache.jdo.impl.fostore
Class FOStoreModel

java.lang.Object
  extended byorg.apache.jdo.impl.fostore.FOStoreModel

class FOStoreModel
extends java.lang.Object

Provides model information required by fostore: mapping between CLID's and the java.lang.Class's.

Author:
Dave Bristor

Field Summary
private  java.util.HashMap clids
           
private static org.apache.jdo.impl.model.java.runtime.RuntimeJavaModelFactory javaModelFactory
          RuntimeJavaModelFactory.
(package private) static org.apache.commons.logging.Log logger
          Logger
private static org.apache.jdo.util.I18NHelper msg
          I18N support.
private  java.util.HashMap provisionalCLIDs
          Maps from provisional CLID's to java.lang.Class's.
private  FOStoreTranscriberFactory transcriberFactory
          Convenience; so that we don't have to getInstance() all the time.
private  java.util.HashMap transcribers
          Map from jdoClass to an array of FOStoreTranscribers.
 
Constructor Summary
(package private) FOStoreModel()
          Constructor
 
Method Summary
(package private)  OID bind(java.lang.Class cls, int type, javax.jdo.spi.PersistenceCapable pc, java.lang.Object oid, org.apache.jdo.pm.PersistenceManagerInternal pm, FOStorePMF pmf)
          Causes the given class mapped to an OID.
(package private)  java.lang.Class getClass(CLID clid)
          Return the class corresponding to the given CLID.
(package private)  CLID getCLID(java.lang.Class cls)
          Provides the class id for the given class.
(package private)  java.util.Map.Entry getEntry(CLID clid)
           
(package private)  org.apache.jdo.model.jdo.JDOClass getJDOClass(java.lang.Class c)
           
(package private)  FOStoreTranscriber getTranscriber(java.lang.Class c, int fieldNum)
          Provides a transcriber for the field in the given JDOClass indicated by fieldNum.
(package private)  void print(java.lang.Class c)
           
(package private)  void print(java.lang.Object o)
           
(package private)  void put(java.lang.Class cls, CLID clid)
          Add a mapping from ClassMetaData to CLID.
(package private)  void updateCLID(CLID pCLID, CLID rCLID)
          Changes the class id by which this metadata is known.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clids

private java.util.HashMap clids

provisionalCLIDs

private java.util.HashMap provisionalCLIDs
Maps from provisional CLID's to java.lang.Class's. See updateCLID and getClass.


transcribers

private final java.util.HashMap transcribers
Map from jdoClass to an array of FOStoreTranscribers.


transcriberFactory

private final FOStoreTranscriberFactory transcriberFactory
Convenience; so that we don't have to getInstance() all the time.


javaModelFactory

private static final org.apache.jdo.impl.model.java.runtime.RuntimeJavaModelFactory javaModelFactory
RuntimeJavaModelFactory.


msg

private static final org.apache.jdo.util.I18NHelper msg
I18N support.


logger

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

Constructor Detail

FOStoreModel

FOStoreModel()
Constructor

Method Detail

getCLID

CLID getCLID(java.lang.Class cls)
Provides the class id for the given class.

Parameters:
cls - The class for which the corresponding class id is needed.
Returns:
CLID for the given class, or null if there is no metadata for that class.

put

void put(java.lang.Class cls,
         CLID clid)
Add a mapping from ClassMetaData to CLID.


bind

OID bind(java.lang.Class cls,
         int type,
         javax.jdo.spi.PersistenceCapable pc,
         java.lang.Object oid,
         org.apache.jdo.pm.PersistenceManagerInternal pm,
         FOStorePMF pmf)
Causes the given class mapped to an OID.

Parameters:
cls - Class to be mapped.
type - JDOIdentityType as an int.
pc - PersistenceCapable instance to copy fields from if available.
oid - Object Id instance to copy fields from if available.
pm - PersistenceManagerInternal that requested the operation.
pmf - FOStorePMF that requested the operation.
Returns:
ObjectId corresponding to given class.

updateCLID

void updateCLID(CLID pCLID,
                CLID rCLID)
Changes the class id by which this metadata is known.

Parameters:
pCLID - The class id by which the class was previously known.
rCLID - The class id by which the class should be known from now on in this JVM.

getClass

java.lang.Class getClass(CLID clid)
Return the class corresponding to the given CLID.

Parameters:
clid - The CLID for which a class is wanted.
Returns:
The java.lang.Class corresponding to the given CLID, or null if none is found.

getEntry

java.util.Map.Entry getEntry(CLID clid)

getJDOClass

org.apache.jdo.model.jdo.JDOClass getJDOClass(java.lang.Class c)
Parameters:
c - Class whose corresponding JDOClass is needed.
Returns:
The JDOClass for the given class.

getTranscriber

FOStoreTranscriber getTranscriber(java.lang.Class c,
                                  int fieldNum)
Provides a transcriber for the field in the given JDOClass indicated by fieldNum.

Parameters:
c - JDOClass for which a transcriber is needed.
fieldNum - The absolute fieldNumber in the class modeled by jdoClass that is to be transcribed.
Returns:
a FOStoreTranscriber appropriate for the type of field in the class modeled by field fieldNum in the class corresponding to jdoClass.

print

void print(java.lang.Object o)

print

void print(java.lang.Class c)