|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.speedo.naming.lib.NamingManagerHelper
org.objectweb.speedo.naming.lib.CommonLongIdNamingManager
public abstract class CommonLongIdNamingManager
Defines a common implementation of NamingManager for identifier based on a single long or java.lang.Long field.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.objectweb.speedo.naming.api.NamingManager |
---|
NamingManager.NamingField |
Field Summary |
---|
Fields inherited from class org.objectweb.speedo.naming.lib.NamingManagerHelper |
---|
BINDER_IDX, cache, HINTS_SEP, ID_CAT_IDX, logger, mapper, PCLASS_IDX, pmf, PNC_IDX, POLYMORPHIC_PNC |
Fields inherited from interface org.objectweb.speedo.naming.api.NamingManager |
---|
PNH_NULL_VALUE, PNH_PFIELD, PNH_REF_STATE, SEP |
Constructor Summary | |
---|---|
CommonLongIdNamingManager()
|
Method Summary | |
---|---|
abstract 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 |
protected abstract boolean |
checkFieldType(java.lang.String type)
Checks if the field type is the one expected |
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. |
protected abstract org.objectweb.jorm.naming.api.PName |
decodeLong(org.objectweb.jorm.naming.api.PNameCoder pnc,
java.lang.String idStr)
Decodes a string value 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 |
abstract java.lang.Object |
encode(org.objectweb.jorm.naming.api.PName pn)
Encodes a PName into a value. |
protected abstract org.objectweb.medor.expression.lib.BasicOperand |
getBasicOperand()
|
protected abstract java.lang.String |
getBinderForClass()
|
protected abstract java.lang.String |
getBinderForGenClass()
|
SpeedoColumn[] |
getDefaultColumn(SpeedoClass sc)
|
protected abstract org.objectweb.jorm.type.api.PType |
getFieldType()
|
protected abstract java.lang.String |
getHiddenLidFieldName()
|
protected abstract java.lang.Class |
getJavaFieldType()
|
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. |
protected abstract java.lang.String |
getLongIdLid()
|
abstract java.lang.Class |
getLongIdManagerClass()
|
protected abstract java.lang.String |
getLongIdName()
|
abstract org.objectweb.jorm.api.PMapper |
getMapper()
|
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. |
protected org.objectweb.jorm.naming.api.PBinder |
getPBinder(java.lang.String className,
java.lang.String binderInfo)
|
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 |
abstract java.lang.Class |
getPBinderClass()
|
abstract java.lang.Class |
getPNameClass()
|
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 |
abstract java.lang.Class |
getPNamingContextClass()
|
void |
init()
|
boolean |
needInheritanceDiscriminator(SpeedoClass sc)
|
abstract org.objectweb.jorm.naming.api.PBinder |
newClassPBinder(java.lang.String className,
java.lang.Object conn)
|
abstract org.objectweb.jorm.naming.api.PNamingContext |
newClassPNamingContext()
|
abstract org.objectweb.jorm.naming.api.PBinder |
newGenClassPBinder()
|
void |
setCache(CacheManager cache)
|
void |
setLogger(org.objectweb.util.monolog.api.Logger logger)
|
void |
setPmf(POManagerFactoryItf pmf)
|
boolean |
supportPNamingcontext()
indicates if the use of PNamingContext is support by this mapping. |
Methods inherited from class org.objectweb.speedo.naming.lib.NamingManagerHelper |
---|
getBinderClassNameFromHints, getName, getPNCClassNameFromHints, getTokens, setPMapper |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.objectweb.speedo.naming.api.NamingManager |
---|
getGCPNameHints |
Constructor Detail |
---|
public CommonLongIdNamingManager()
Method Detail |
---|
protected abstract java.lang.String getLongIdName()
protected abstract java.lang.String getLongIdLid()
protected abstract org.objectweb.jorm.type.api.PType getFieldType()
protected abstract java.lang.Class getJavaFieldType()
protected abstract org.objectweb.medor.expression.lib.BasicOperand getBasicOperand()
protected abstract boolean checkFieldType(java.lang.String type)
type
- is the field type as a string.
public abstract org.objectweb.jorm.api.PMapper getMapper()
public abstract org.objectweb.jorm.naming.api.PBinder newGenClassPBinder() throws org.objectweb.jorm.api.PException
org.objectweb.jorm.api.PException
public abstract org.objectweb.jorm.naming.api.PBinder newClassPBinder(java.lang.String className, java.lang.Object conn) throws org.objectweb.jorm.api.PException
className
- is the class name of the persistent classconn
- is the connection to the underlying persistent support.
org.objectweb.jorm.api.PException
public abstract org.objectweb.jorm.naming.api.PNamingContext newClassPNamingContext() throws org.objectweb.jorm.api.PException
org.objectweb.jorm.api.PException
public abstract java.lang.Class getPNameClass()
public abstract java.lang.Class getPBinderClass()
public abstract java.lang.Class getLongIdManagerClass()
public abstract java.lang.Class getPNamingContextClass()
protected abstract org.objectweb.jorm.naming.api.PName decodeLong(org.objectweb.jorm.naming.api.PNameCoder pnc, java.lang.String idStr) throws org.objectweb.jorm.api.PException
pnc
- is the PNameCoder able to decode the stringidStr
- is the string representation of an identifier
org.objectweb.jorm.api.PException
public abstract java.lang.Object encode(org.objectweb.jorm.naming.api.PName pn) throws org.objectweb.jorm.api.PException
pn
- is the PName to encode
org.objectweb.jorm.api.PException
protected abstract java.lang.String getBinderForGenClass()
protected abstract java.lang.String getBinderForClass()
protected abstract java.lang.String getHiddenLidFieldName()
public void init() throws org.objectweb.jorm.api.PException
org.objectweb.jorm.api.PException
public void setPmf(POManagerFactoryItf pmf)
setPmf
in interface NamingManager
setPmf
in class NamingManagerHelper
public boolean supportPNamingcontext()
NamingManager
supportPNamingcontext
in interface NamingManager
supportPNamingcontext
in class NamingManagerHelper
public abstract boolean canManage(SpeedoClass sc)
NamingManager
sc
- The speedo meta object representing the persistent classpublic boolean canProvidePBinder(java.lang.Object hints, java.lang.ClassLoader classLoader)
NamingManager
canProvidePBinder
in interface NamingManager
canProvidePBinder
in class NamingManagerHelper
hints
- is the helper of the PBinder buildingclassLoader
- is the classloader to use for instanciate the PBinderpublic boolean canProvidePNamingContext(java.lang.Object hints, java.lang.ClassLoader classLoader)
NamingManager
canProvidePNamingContext
in interface NamingManager
canProvidePNamingContext
in class NamingManagerHelper
hints
- is the helper of the PNC buildingclassLoader
- is the classloader to use for instanciate the PNCpublic 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
NamingManager
pnc
- is the PNameCoder instance to use for the decoding the object
identifier. The pnc parameter can be null. In this case the oid mustoid
- is the object identifierclazz
- is the java.lang.Class of the persistent class identified by
the oidjf
- is the JormFactory instance. It permits to
org.objectweb.jorm.api.PException
public void setLogger(org.objectweb.util.monolog.api.Logger logger)
setLogger
in interface NamingManager
setLogger
in class NamingManagerHelper
public java.lang.String getPNameHints(SpeedoClass sc, org.objectweb.jorm.metainfo.api.NameDef nd)
NamingManager
sc
- is the Speedo class which the hints must be specifiednd
- is the name def of the classpublic java.lang.Object[] getPNameHints2(SpeedoClass sc, org.objectweb.jorm.metainfo.api.NameDef nd)
public NamingManager.NamingField[] getNamingfields(SpeedoClass sc)
NamingManager
getNamingfields
in interface NamingManager
getNamingfields
in class NamingManagerHelper
sc
- is the speedo meta object of the persistent classpublic 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
NamingManager
nd
- is the name def to filljc
- is the jorm meta object representing the class.sc
- is the speedo 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 infomb
- 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.
SpeedoException
- if the speedo meta information is not completly
defined.
org.objectweb.jorm.api.PException
public boolean needInheritanceDiscriminator(SpeedoClass sc) throws SpeedoException
needInheritanceDiscriminator
in interface NamingManager
needInheritanceDiscriminator
in class NamingManagerHelper
SpeedoException
public 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
NamingManager
nd
- is the name def to fillcr
- 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 fieldcm
- if the mapping structure hosting the mapping of the class.mibh
- is a helper for the management of the JORM meta infomb
- is the mapping builder permitting the creation of the mapping
objects.
SpeedoException
- if the speedo meta information is not completly
defined.
org.objectweb.jorm.api.PException
public 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
NamingManager
nd
- is the name def to fillcr
- 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 fieldgcm
- if the mapping structure hosting the mapping of the class.mibh
- is a helper for the management of the JORM meta infomb
- is the mapping builder permitting the creation of the mapping
objects.
SpeedoException
- if the speedo meta information is not completly
defined.
org.objectweb.jorm.api.PException
public 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
NamingManager
nd
- is the name def to fillgcr
- 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 fieldgcm
- if the mapping structure hosting the mapping of the generic class.mibh
- is a helper for the management of the JORM meta infomb
- is the mapping builder permitting the creation of the mapping
objects.
SpeedoException
- if the speedo meta information is not completly
defined.
org.objectweb.jorm.api.PException
public 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
NamingManager
nd
- is the name def to fillgcr
- 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 fieldcm
- if the mapping structure hosting the mapping of the class.mibh
- is a helper for the management of the JORM meta infomb
- is the mapping builder permitting the creation of the mapping
objects.
SpeedoException
- if the speedo meta information is not completly
defined.
org.objectweb.jorm.api.PException
public 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)
NamingManager
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> |
targetClass
- is the Speedo meta object representing the class which
is designates by theresult
- is the Properties which must be filledpublic 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
NamingManager
getPBinder
in interface NamingManager
getPBinder
in class NamingManagerHelper
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 PBindermappingStructureRule
- 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)
org.objectweb.jorm.api.PException
public 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
NamingManager
getPNamingContext
in interface NamingManager
getPNamingContext
in class NamingManagerHelper
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 PBindermappingStructureRule
- 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)
org.objectweb.jorm.api.PException
protected org.objectweb.jorm.naming.api.PBinder getPBinder(java.lang.String className, java.lang.String binderInfo) throws org.objectweb.jorm.api.PException
org.objectweb.jorm.api.PException
public void setCache(CacheManager cache)
setCache
in interface NamingManager
setCache
in class NamingManagerHelper
public SpeedoColumn[] getDefaultColumn(SpeedoClass sc)
getDefaultColumn
in interface NamingManager
getDefaultColumn
in class NamingManagerHelper
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |