org.objectweb.speedo.mapper.api
Interface JormFactory

All Known Implementing Classes:
BasicJormFactory

public interface JormFactory

It defines a Jorm configurator which manages the PClassMapping, the PBinder and the PNamingContext.

Author:
S.Chassande-Barrioz

Method Summary
 java.lang.ClassLoader getClassLoader(java.lang.String className)
          Retrieves the classloader of a class if the class has been already mapped.
 byte getMappingStructureRule()
           
 PBinder getPBinder(java.lang.Class clazz)
          This Method is a shortcut to the getPBinder(SpeedoProxy) method.
 PBinder getPBinder(SpeedoProxy sp)
           
 PBinder getPBinder(java.lang.String classname, java.lang.ClassLoader cl)
           
 PClassMapping getPClassMapping(java.lang.Class clazz)
           
 PClassMapping getPClassMapping(SpeedoProxy sp)
          Retrieves a PClassMapping instance managing a SpeedoProxy.
 PClassMapping getPClassMapping(java.lang.String classname, java.lang.ClassLoader cl)
          This Method is a shortcut to the getPClassMapping(SpeedoProxy) method.
 PNamingContext getPNamingContext(java.lang.Class clazz)
           
 PNamingContext getPNamingContext(SpeedoProxy sp)
           
 PNamingContext getPNamingContext(java.lang.String classname, java.lang.ClassLoader cl)
          This Method is a shortcut to the getPNamingContext(SpeedoProxy) method.
 

Method Detail

getPBinder

public PBinder getPBinder(java.lang.Class clazz)
                   throws PException
This Method is a shortcut to the getPBinder(SpeedoProxy) method. It only does the instanciation of the classname (Class.ForName(classsName).newInstance()) and call the getPBinder(SpeedoProxy) method with the created instance. Hence if an instance is available it is better to use the other method.

Parameters:
clazz - the Jorm class name managed by the wanted PBinder
Returns:
the PBinder instance to use for the given jorm class name
Throws:
org.objectweb.jorm.api.PException
PException

getPBinder

public PBinder getPBinder(java.lang.String classname,
                          java.lang.ClassLoader cl)
                   throws PException
Throws:
PException

getPBinder

public PBinder getPBinder(SpeedoProxy sp)
                   throws PException
Returns:
the PBinder instance which manages the identifer of the SpeedoProxy instance
Throws:
PException

getPClassMapping

public PClassMapping getPClassMapping(SpeedoProxy sp)
                               throws PException
Retrieves a PClassMapping instance managing a SpeedoProxy. If the PClassMapping does not already exist then it is created, configured and mapped in the PMapper. The PClassMapping configuration contains the PBinder assignement, the PNamingContext assignement for each reference, and the GenClassMapping assignement. The assigned GenClassMapping must also be configured. In other hand the PClassMapping of referenced class is not configured now. Only the PNamingContext is needed.

Parameters:
sp - is the SpeedoProxy instance which the PClassMapping is required
Returns:
the PClassMapping which manages a SpeedoProxy
Throws:
org.objectweb.jorm.api.PException
PException

getPClassMapping

public PClassMapping getPClassMapping(java.lang.String classname,
                                      java.lang.ClassLoader cl)
                               throws PException
This Method is a shortcut to the getPClassMapping(SpeedoProxy) method. It only does the instanciation of the classname (Class.ForName(classsName).newInstance()) and call the getPClassMapping(SpeedoProxy) method with the created instance. Then if an instance is availlable it is better to use the other method. Retrieves a PClassMapping instance managing a jorm class. If the PClassMapping does not already exist then it is created, configured and mapped in the PMapper. The PClassMapping configuration contains the PBinder assignement, the PNamingContext assignement for each reference, and the GenClassMapping assignement. The assigned GenClassMapping must also be configured. In other hand the PClassMapping of referenced class is not configured now. Only the PNamingContext is needed.

Parameters:
classname - is the class name of the jorm class which the PClassMapping is required
Returns:
the PClassMapping which manages a SpeedoProxy
Throws:
org.objectweb.jorm.api.PException
PException

getPClassMapping

public PClassMapping getPClassMapping(java.lang.Class clazz)
                               throws PException
Throws:
PException

getPNamingContext

public PNamingContext getPNamingContext(SpeedoProxy sp)
                                 throws PException
Returns:
the PNamingContext instance which manages a reference to the SpeedoProxy instance
Throws:
PException

getPNamingContext

public PNamingContext getPNamingContext(java.lang.String classname,
                                        java.lang.ClassLoader cl)
                                 throws PException
This Method is a shortcut to the getPNamingContext(SpeedoProxy) method. It only does the instanciation of the classname (Class.ForName(classsName).newInstance()) and call the getPNamingContext(SpeedoProxy) method with the created instance. Then if an instance is availlable it is better to use the other method.

Parameters:
classname - the Jorm class name managed by the wanted PNamingContext
Returns:
the PNamingContext instance to use for the given jorm class name
Throws:
org.objectweb.jorm.api.PException
PException

getPNamingContext

public PNamingContext getPNamingContext(java.lang.Class clazz)
                                 throws PException
Throws:
PException

getClassLoader

public java.lang.ClassLoader getClassLoader(java.lang.String className)
Retrieves the classloader of a class if the class has been already mapped. Otherwise a null value is returned


getMappingStructureRule

public byte getMappingStructureRule()
See Also:
JormFactoryAttributes