org.objectweb.speedo.naming.api
Interface NamingManagerFactoryItf

All Known Implementing Classes:
NamingManagerFactory

public interface NamingManagerFactoryItf

A NamingManagerFactory manages a set of NamingManager instance. It permits - To bind or unbind a NamingManager, - To find the right NamingManager managing the identifier/naming of a persistent class, - To encode or decode persistent identifier.

Author:
S.Chassande-Barrioz
See Also:
NamingManager

Method Summary
 void bindNamingManager(NamingManager nm)
          Binds a new NamaingManager in this factory
 void clean()
          clean all naming Manager
 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 identifer into a PName.
 java.lang.Object encode(org.objectweb.jorm.naming.api.PName pn)
          Encodes the persistent identifier (PName) into an object identifier usable, externaly to the Speedo system.
 NamingManager getNamingManager(SpeedoClass sc)
           
 NamingManager getNamingManager(java.lang.String hints, java.lang.ClassLoader classloader)
           
 boolean unbindNamingManager(NamingManager nm)
          Unbinds an existing NamaingManager in this factory
 

Method Detail

bindNamingManager

void bindNamingManager(NamingManager nm)
Binds a new NamaingManager in this factory

Parameters:
nm - is the new NamingManager instance

unbindNamingManager

boolean unbindNamingManager(NamingManager nm)
Unbinds an existing NamaingManager in this factory

Parameters:
nm - is the NamingManager instance to forget
Returns:
true is the NamingManager has been really found and therefore forgoten.

getNamingManager

NamingManager getNamingManager(SpeedoClass sc)
                               throws SpeedoException
Parameters:
sc - is the speedo meta object representing the persistent class.
Returns:
the NamingManager instance able to manage the identifier of a persistent class.
Throws:
SpeedoException - if no NamingManager can manage the persistent class.

getNamingManager

NamingManager getNamingManager(java.lang.String hints,
                               java.lang.ClassLoader classloader)
                               throws org.objectweb.jorm.api.PException
Parameters:
hints - is string value containing information permitting to find the naming manager required.
classloader - is the class loader of the application.
Returns:
the NamingManager instance able to manage the identifier of a persistent class.
Throws:
SpeedoException - if no NamingManager can manage the persistent class.
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 identifer into a PName.

Parameters:
pnc - is the PNamingContext managing the naming of the referenced persistent class
oid - is the object identifier
clazz - is the java class of the referenced class. this paramter permits of course to access to the class loader of the application.
jf - is the JormFactory managing the persistent class.
Returns:
a PName (JORM identifier of persistent class)
Throws:
org.objectweb.jorm.api.PException - if it is not possible to decode the object identifier corresponding to the specified class.
See Also:
encode(PName)

encode

java.lang.Object encode(org.objectweb.jorm.naming.api.PName pn)
                        throws org.objectweb.jorm.api.PException
Encodes the persistent identifier (PName) into an object identifier usable, externaly to the Speedo system.

Parameters:
pn - is the Pname to encode
Throws:
org.objectweb.jorm.api.PException
See Also:
decode(PNameCoder, Object, java.lang.Class, JormFactory)

clean

void clean()
clean all naming Manager