org.objectweb.speedo.naming.lib
Class NamingManagerHelper

java.lang.Object
  extended byorg.objectweb.speedo.naming.lib.NamingManagerHelper
All Implemented Interfaces:
NamingManager
Direct Known Subclasses:
RdbSequenceNamingManager, UserIdCompositeNamingManager, UserIdSingleNamingManager

public abstract class NamingManagerHelper
extends java.lang.Object
implements NamingManager

Author:
S.Chassande-Barrioz

Nested Class Summary
 
Nested classes inherited from class org.objectweb.speedo.naming.api.NamingManager
NamingManager.NamingField
 
Field Summary
static int BINDER_IDX
           
protected  org.objectweb.perseus.cache.api.CacheManager cache
           
static java.lang.String HINTS_SEP
           
static int ID_CAT_IDX
           
protected  org.objectweb.util.monolog.api.Logger logger
           
static int PCLASS_IDX
           
protected  ProxyManagerFactory pmf
           
static int PNC_IDX
           
static java.lang.String POLYMORPHIC_PNC
           
 
Fields inherited from interface org.objectweb.speedo.naming.api.NamingManager
SEP
 
Constructor Summary
NamingManagerHelper()
           
 
Method Summary
 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
static java.lang.String getBinderClassNameFromHints(java.lang.Object hints, java.lang.String idCatName)
           
protected abstract  java.lang.String getName()
           
 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
 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
static java.lang.String getPNCClassNameFromHints(java.lang.Object hints, java.lang.String idCatName)
           
static java.lang.String[] getTokens(java.lang.Object o)
           
 void setCache(org.objectweb.perseus.cache.api.CacheManager cache)
           
 void setLogger(org.objectweb.util.monolog.api.Logger logger)
           
 void setPMapper(org.objectweb.jorm.api.PMapper mapper)
           
 void setPmf(ProxyManagerFactory pmf)
           
 boolean supportPNamingcontext()
          indicates if the use of PNamingContext is support by this mapping.
 
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
canManage, decode, encode, fillNameDef, getGCPNameHints, getJormNamingConfig, getPNameHints
 

Field Detail

HINTS_SEP

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

ID_CAT_IDX

public static final int ID_CAT_IDX
See Also:
Constant Field Values

BINDER_IDX

public static final int BINDER_IDX
See Also:
Constant Field Values

PNC_IDX

public static final int PNC_IDX
See Also:
Constant Field Values

PCLASS_IDX

public static final int PCLASS_IDX
See Also:
Constant Field Values

POLYMORPHIC_PNC

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

logger

protected org.objectweb.util.monolog.api.Logger logger

cache

protected org.objectweb.perseus.cache.api.CacheManager cache

pmf

protected ProxyManagerFactory pmf
Constructor Detail

NamingManagerHelper

public NamingManagerHelper()
Method Detail

supportPNamingcontext

public boolean supportPNamingcontext()
Description copied from interface: NamingManager
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.

Specified by:
supportPNamingcontext in interface NamingManager

setPMapper

public void setPMapper(org.objectweb.jorm.api.PMapper mapper)
Specified by:
setPMapper in interface NamingManager

setCache

public void setCache(org.objectweb.perseus.cache.api.CacheManager cache)
Specified by:
setCache in interface NamingManager

setLogger

public void setLogger(org.objectweb.util.monolog.api.Logger logger)
Specified by:
setLogger in interface NamingManager

setPmf

public void setPmf(ProxyManagerFactory pmf)
Specified by:
setPmf in interface NamingManager

getNamingfields

public NamingManager.NamingField[] getNamingfields(SpeedoClass sc)
                                            throws org.objectweb.jorm.api.PException
Description copied from interface: NamingManager
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.

Specified by:
getNamingfields in interface NamingManager
Parameters:
sc - is the speedo meta object of the persistent class
Throws:
org.objectweb.jorm.api.PException

getName

protected abstract java.lang.String getName()

canProvidePBinder

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

Specified by:
canProvidePBinder in interface NamingManager
Parameters:
hints - is the helper of the PBinder building
classLoader - is the classloader to use for instanciate the PBinder

canProvidePNamingContext

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

Specified by:
canProvidePNamingContext in interface NamingManager
Parameters:
hints - is the helper of the PNC building
classLoader - is the classloader to use for instanciate the PNC

getPBinder

public 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
Description copied from interface: NamingManager
Build a PBinder instance for this hints parameter specified

Specified by:
getPBinder in interface NamingManager
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

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
Description copied from interface: NamingManager
Build a PNamingContext instance for this hints parameter specified

Specified by:
getPNamingContext in interface NamingManager
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

getTokens

public static java.lang.String[] getTokens(java.lang.Object o)

getBinderClassNameFromHints

public static java.lang.String getBinderClassNameFromHints(java.lang.Object hints,
                                                           java.lang.String idCatName)

getPNCClassNameFromHints

public static java.lang.String getPNCClassNameFromHints(java.lang.Object hints,
                                                        java.lang.String idCatName)