org.objectweb.speedo.naming.api
Interface NamingManager

All Known Implementing Classes:
CommonLongIdNamingManager, LongIdNamingManager, NamingManagerHelper, OLongIdNamingManager, PolymorphIdNamingManager, RdbSequenceNamingManager, UserIdCompositeNamingManager, UserIdSingleNamingManager

public interface NamingManager

It defines a manager of a type of naming. This interface covers needs at compile time and at run time. In particular a naming manager is able to fill the Speedo meta information with the particularity of the a naming.

Author:
S.Chassande-Barrioz

Nested Class Summary
static class NamingManager.NamingField
          Defines the field used in an identifier and which must be set at makePersistent time.
 
Field Summary
static java.lang.Integer PNH_NULL_VALUE
           
static java.lang.Integer PNH_PFIELD
           
static java.lang.Integer PNH_REF_STATE
           
static java.lang.String SEP
           
 
Method Summary
 boolean canManage(SpeedoClass sc)
          Indicates if the naming manager is able to manage the identifier of a persistent class.
 boolean canProvidePBinder(java.lang.Object hints, java.lang.ClassLoader classLoader)
          indicates if the naming manager is able to build a PBinder instance for this hints parameter specified
 boolean canProvidePNamingContext(java.lang.Object hints, java.lang.ClassLoader classLoader)
          indicates if the naming manager is able to build a PNC instance for this hints parameter specified
 org.objectweb.jorm.naming.api.PName decode(org.objectweb.jorm.naming.api.PNameCoder pnc, java.lang.Object oid, java.lang.Class clazz, JormFactory jf)
          Decodes an object identifier into a PName.
 void defineClassIdentifierNameDef(org.objectweb.jorm.metainfo.api.NameDef nd, org.objectweb.jorm.metainfo.api.Class jc, SpeedoClass sc, org.objectweb.jorm.metainfo.api.ClassMapping cm, MIBuilderHelper mibh, JormMIMappingBuilder mb, java.util.Collection createdMOs)
          Fill the name def of a class identifier
 void defineClassReferenceNameDef(org.objectweb.jorm.metainfo.api.NameDef nd, org.objectweb.jorm.metainfo.api.ClassRef cr, SpeedoField sf, SpeedoClass currentClass, org.objectweb.jorm.metainfo.api.ClassMapping cm, MIBuilderHelper mibh, JormMIMappingBuilder mb)
          Fill the name def of the class reference from a class
 void defineClassReferenceNameDef(org.objectweb.jorm.metainfo.api.NameDef nd, org.objectweb.jorm.metainfo.api.ClassRef cr, SpeedoField sf, SpeedoClass currentClass, org.objectweb.jorm.metainfo.api.GenClassMapping gcm, MIBuilderHelper mibh, JormMIMappingBuilder mb)
          Fill the name def of the class reference from a generic class
 void defineGenClassIdentifierNameDef(org.objectweb.jorm.metainfo.api.NameDef nd, org.objectweb.jorm.metainfo.api.GenClassRef gcr, SpeedoField sf, SpeedoClass currentClass, org.objectweb.jorm.metainfo.api.GenClassMapping gcm, MIBuilderHelper mibh, JormMIMappingBuilder mb)
          Fill the name def of the gen class identifier
 void defineGenClassReferenceNameDef(org.objectweb.jorm.metainfo.api.NameDef nd, org.objectweb.jorm.metainfo.api.GenClassRef gcr, SpeedoField sf, SpeedoClass currentClass, org.objectweb.jorm.metainfo.api.ClassMapping cm, MIBuilderHelper mibh, JormMIMappingBuilder mb)
          Fill the name def of the generic class reference from a class
 java.lang.Object encode(org.objectweb.jorm.naming.api.PName pn)
          Encode a PName into an object
 SpeedoColumn[] getDefaultColumn(SpeedoClass sc)
           
 java.lang.String getGCPNameHints(SpeedoClass sc, org.objectweb.jorm.metainfo.api.NameDef nd)
          compute a string value which permit to help the building of the genclass PName (export)
 void getJormNamingConfig(org.objectweb.jorm.metainfo.api.NameDef nd, SpeedoClass targetClass, org.objectweb.jorm.metainfo.api.MetaObject sourceMO, java.lang.String key, java.util.Properties result)
          computes the naming configuration information for a class or a reference.
 NamingManager.NamingField[] getNamingfields(SpeedoClass sc)
          Retrieves the array of field used in the identifier of a persistent class and which values are not calculated by the application.
 org.objectweb.jorm.naming.api.PBinder getPBinder(java.lang.String className, java.lang.String hints, java.lang.ClassLoader classLoader, byte mappingStructureRule, java.util.Map cn2binder, java.util.Map cn2pnc)
          Build a PBinder instance for this hints parameter specified
 java.lang.String getPNameHints(SpeedoClass sc, org.objectweb.jorm.metainfo.api.NameDef nd)
          compute a string value which permit to help the building of the class PName (export)
 java.lang.Object[] getPNameHints2(SpeedoClass sc, org.objectweb.jorm.metainfo.api.NameDef nd)
           
 org.objectweb.jorm.naming.api.PNamingContext getPNamingContext(java.lang.String className, java.lang.String hints, java.lang.ClassLoader classLoader, byte mappingStructureRule, java.util.Map cn2binder, java.util.Map cn2pnc, org.objectweb.jorm.metainfo.api.Manager miManager, org.objectweb.jorm.api.PClassMapping pcm)
          Build a PNamingContext instance for this hints parameter specified
 boolean needInheritanceDiscriminator(SpeedoClass sc)
           
 void setCache(CacheManager cache)
           
 void setLogger(org.objectweb.util.monolog.api.Logger logger)
           
 void setPMapper(org.objectweb.jorm.api.PMapper mapper)
           
 void setPmf(POManagerFactoryItf pmf)
           
 boolean supportPNamingcontext()
          indicates if the use of PNamingContext is support by this mapping.
 

Field Detail

SEP

static final java.lang.String SEP
See Also:
Constant Field Values

PNH_NULL_VALUE

static final java.lang.Integer PNH_NULL_VALUE

PNH_REF_STATE

static final java.lang.Integer PNH_REF_STATE

PNH_PFIELD

static final java.lang.Integer PNH_PFIELD
Method Detail

canManage

boolean canManage(SpeedoClass sc)
Indicates if the naming manager is able to manage the identifier of a persistent class.

Parameters:
sc - The speedo meta object representing the persistent class

canProvidePBinder

boolean canProvidePBinder(java.lang.Object hints,
                          java.lang.ClassLoader classLoader)
indicates if the naming manager is able to build a PBinder instance for this hints parameter specified

Parameters:
hints - is the helper of the PBinder building
classLoader - is the classloader to use for instanciate the PBinder

canProvidePNamingContext

boolean canProvidePNamingContext(java.lang.Object hints,
                                 java.lang.ClassLoader classLoader)
indicates if the naming manager is able to build a PNC instance for this hints parameter specified

Parameters:
hints - is the helper of the PNC building
classLoader - is the classloader to use for instanciate the PNC

getPBinder

org.objectweb.jorm.naming.api.PBinder getPBinder(java.lang.String className,
                                                 java.lang.String hints,
                                                 java.lang.ClassLoader classLoader,
                                                 byte mappingStructureRule,
                                                 java.util.Map cn2binder,
                                                 java.util.Map cn2pnc)
                                                 throws org.objectweb.jorm.api.PException
Build a PBinder instance for this hints parameter specified

Parameters:
hints - is the helper of the PBinder building. This hints must be the result of the getJormConfig call.
classLoader - is the classloader to use for instanciate the PBinder
mappingStructureRule - indicates the rule to apply concerning the data strucuture. Indeed a PBinder building can require to read the data support.
cn2binder - is the map of the existing PBinder instance (key = class name, value = PBinder instance)
cn2pnc - is the map of the existing PNC instance (key = class name, value = PNC instance)
Throws:
org.objectweb.jorm.api.PException

getPNamingContext

org.objectweb.jorm.naming.api.PNamingContext getPNamingContext(java.lang.String className,
                                                               java.lang.String hints,
                                                               java.lang.ClassLoader classLoader,
                                                               byte mappingStructureRule,
                                                               java.util.Map cn2binder,
                                                               java.util.Map cn2pnc,
                                                               org.objectweb.jorm.metainfo.api.Manager miManager,
                                                               org.objectweb.jorm.api.PClassMapping pcm)
                                                               throws org.objectweb.jorm.api.PException
Build a PNamingContext instance for this hints parameter specified

Parameters:
hints - is the helper of the PBinder building. This hints must be the result of the getJormConfig call.
classLoader - is the classloader to use for instanciate the PBinder
mappingStructureRule - indicates the rule to apply concerning the data strucuture. Indeed a PBinder building can require to read the data support.
cn2binder - is the map of the existing PBinder instance (key = class name, value = PBinder instance)
cn2pnc - is the map of the existing PNC instance (key = class name, value = PNC instance)
Throws:
org.objectweb.jorm.api.PException

decode

org.objectweb.jorm.naming.api.PName decode(org.objectweb.jorm.naming.api.PNameCoder pnc,
                                           java.lang.Object oid,
                                           java.lang.Class clazz,
                                           JormFactory jf)
                                           throws org.objectweb.jorm.api.PException
Decodes an object identifier into a PName.

Parameters:
pnc - is the PNameCoder instance to use for the decoding the object identifier. The pnc parameter can be null. In this case the oid must
oid - is the object identifier
clazz - is the java.lang.Class of the persistent class identified by the oid
jf - is the JormFactory instance. It permits to
Returns:
the object identifier decode as PName
Throws:
org.objectweb.jorm.api.PException

encode

java.lang.Object encode(org.objectweb.jorm.naming.api.PName pn)
                        throws org.objectweb.jorm.api.PException
Encode a PName into an object

Parameters:
pn - is the pname to encode
Throws:
org.objectweb.jorm.api.PException

supportPNamingcontext

boolean supportPNamingcontext()
indicates if the use of PNamingContext is support by this mapping. If true then getPNamingContext method can be use, otherwise the getPBinder must be use instead. The case of PNamingContext are not supported, means the PBinder are used as PNameCoder by PBinding as reference coder.


defineClassIdentifierNameDef

void defineClassIdentifierNameDef(org.objectweb.jorm.metainfo.api.NameDef nd,
                                  org.objectweb.jorm.metainfo.api.Class jc,
                                  SpeedoClass sc,
                                  org.objectweb.jorm.metainfo.api.ClassMapping cm,
                                  MIBuilderHelper mibh,
                                  JormMIMappingBuilder mb,
                                  java.util.Collection createdMOs)
                                  throws SpeedoException,
                                         org.objectweb.jorm.api.PException
Fill the name def of a class identifier

Parameters:
nd - is the name def to fill
sc - is the speedo meta object representing the class.
jc - is the jorm meta object representing the class.
cm - if the mapping structure hosting the mapping of the class.
mibh - is a helper for the management of the JORM meta info
mb - is the mapping builder permitting the creation of the mapping objects.
createdMOs - is a result paramter. This collection must be fill with the created Jorm Meta objects representing a class or a composite name. Here only the new composite names have to be added.
Throws:
SpeedoException - if the speedo meta information is not completly defined.
org.objectweb.jorm.api.PException

defineGenClassIdentifierNameDef

void defineGenClassIdentifierNameDef(org.objectweb.jorm.metainfo.api.NameDef nd,
                                     org.objectweb.jorm.metainfo.api.GenClassRef gcr,
                                     SpeedoField sf,
                                     SpeedoClass currentClass,
                                     org.objectweb.jorm.metainfo.api.GenClassMapping gcm,
                                     MIBuilderHelper mibh,
                                     JormMIMappingBuilder mb)
                                     throws SpeedoException,
                                            org.objectweb.jorm.api.PException
Fill the name def of the gen class identifier

Parameters:
nd - is the name def to fill
gcr - is the JORM meta object representing the generic class reference.
sf - is the speedo meta object representing the persistent reference to a generic class.
currentClass - is the class mapping the field
gcm - if the mapping structure hosting the mapping of the generic class.
mibh - is a helper for the management of the JORM meta info
mb - is the mapping builder permitting the creation of the mapping objects.
Throws:
SpeedoException - if the speedo meta information is not completly defined.
org.objectweb.jorm.api.PException

defineClassReferenceNameDef

void defineClassReferenceNameDef(org.objectweb.jorm.metainfo.api.NameDef nd,
                                 org.objectweb.jorm.metainfo.api.ClassRef cr,
                                 SpeedoField sf,
                                 SpeedoClass currentClass,
                                 org.objectweb.jorm.metainfo.api.ClassMapping cm,
                                 MIBuilderHelper mibh,
                                 JormMIMappingBuilder mb)
                                 throws SpeedoException,
                                        org.objectweb.jorm.api.PException
Fill the name def of the class reference from a class

Parameters:
nd - is the name def to fill
cr - is the speedo meta object representing the class.
sf - is the speedo meta object representing the persistent reference to a class.
currentClass - is the class mapping the field
cm - if the mapping structure hosting the mapping of the class.
mibh - is a helper for the management of the JORM meta info
mb - is the mapping builder permitting the creation of the mapping objects.
Throws:
SpeedoException - if the speedo meta information is not completly defined.
org.objectweb.jorm.api.PException

defineClassReferenceNameDef

void defineClassReferenceNameDef(org.objectweb.jorm.metainfo.api.NameDef nd,
                                 org.objectweb.jorm.metainfo.api.ClassRef cr,
                                 SpeedoField sf,
                                 SpeedoClass currentClass,
                                 org.objectweb.jorm.metainfo.api.GenClassMapping gcm,
                                 MIBuilderHelper mibh,
                                 JormMIMappingBuilder mb)
                                 throws SpeedoException,
                                        org.objectweb.jorm.api.PException
Fill the name def of the class reference from a generic class

Parameters:
nd - is the name def to fill
cr - is the speedo meta object representing the class.
sf - is the speedo meta object representing the persistent reference to a class.
currentClass - is the class mapping the field
gcm - if the mapping structure hosting the mapping of the class.
mibh - is a helper for the management of the JORM meta info
mb - is the mapping builder permitting the creation of the mapping objects.
createdMOs - is a result paramter. This collection must be fill with the created Jorm Meta objects representing a class or a composite name. Here only the new composite names have to be added.
Throws:
SpeedoException - if the speedo meta information is not completly defined.
org.objectweb.jorm.api.PException

defineGenClassReferenceNameDef

void defineGenClassReferenceNameDef(org.objectweb.jorm.metainfo.api.NameDef nd,
                                    org.objectweb.jorm.metainfo.api.GenClassRef gcr,
                                    SpeedoField sf,
                                    SpeedoClass currentClass,
                                    org.objectweb.jorm.metainfo.api.ClassMapping cm,
                                    MIBuilderHelper mibh,
                                    JormMIMappingBuilder mb)
                                    throws SpeedoException,
                                           org.objectweb.jorm.api.PException
Fill the name def of the generic class reference from a class

Parameters:
nd - is the name def to fill
gcr - is the speedo meta object representing the generic class.
sf - is the speedo meta object representing the persistent reference to a generic class.
currentClass - is the class mapping the field
cm - if the mapping structure hosting the mapping of the class.
mibh - is a helper for the management of the JORM meta info
mb - is the mapping builder permitting the creation of the mapping objects.
Throws:
SpeedoException - if the speedo meta information is not completly defined.
org.objectweb.jorm.api.PException

needInheritanceDiscriminator

boolean needInheritanceDiscriminator(SpeedoClass sc)
                                     throws SpeedoException
Throws:
SpeedoException

getJormNamingConfig

void getJormNamingConfig(org.objectweb.jorm.metainfo.api.NameDef nd,
                         SpeedoClass targetClass,
                         org.objectweb.jorm.metainfo.api.MetaObject sourceMO,
                         java.lang.String key,
                         java.util.Properties result)
                         throws SpeedoException
computes the naming configuration information for a class or a reference. This information is store as a String. The string value will be passed to the getPBinder and getPNamingContext methods as hints. This method is used at generation time.
naming of a/td>MOClass/td>
class/td>Class/td>
reference to a Class/td>ClassRef/td>
reference to a GenClass/td>GenClassRef/td>
a GenClass identifier/td>GenClassRef/td>

Parameters:
targetClass - is the Speedo meta object representing the class which is designates by the
result - is the Properties which must be filled
Throws:
SpeedoException

getPNameHints

java.lang.String getPNameHints(SpeedoClass sc,
                               org.objectweb.jorm.metainfo.api.NameDef nd)
compute a string value which permit to help the building of the class PName (export)

Parameters:
sc - is the Speedo class which the hints must be specified
nd - is the name def of the class

getPNameHints2

java.lang.Object[] getPNameHints2(SpeedoClass sc,
                                  org.objectweb.jorm.metainfo.api.NameDef nd)

getGCPNameHints

java.lang.String getGCPNameHints(SpeedoClass sc,
                                 org.objectweb.jorm.metainfo.api.NameDef nd)
compute a string value which permit to help the building of the genclass PName (export)

Parameters:
sc - is the Speedo class which the hints must be specified
nd - is the name def of the gen class

setPMapper

void setPMapper(org.objectweb.jorm.api.PMapper mapper)
                throws org.objectweb.jorm.api.PException
Throws:
org.objectweb.jorm.api.PException

setLogger

void setLogger(org.objectweb.util.monolog.api.Logger logger)

setCache

void setCache(CacheManager cache)

setPmf

void setPmf(POManagerFactoryItf pmf)

getDefaultColumn

SpeedoColumn[] getDefaultColumn(SpeedoClass sc)

getNamingfields

NamingManager.NamingField[] getNamingfields(SpeedoClass sc)
                                            throws org.objectweb.jorm.api.PException
Retrieves the array of field used in the identifier of a persistent class and which values are not calculated by the application. The application field must be set at makePersistent time.

Parameters:
sc - is the speedo meta object of the persistent class
Throws:
org.objectweb.jorm.api.PException