org.objectweb.speedo.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
 org.objectweb.jorm.naming.api.PName decode(java.lang.Object oid)
          It retrieves a PName since a representation of an identifier.
 java.lang.Object encode(org.objectweb.jorm.naming.api.PName pn)
          It retrieves a representation of an identifier since a PName.
 org.objectweb.jorm.naming.api.PBinder getPBinder(SpeedoProxy sp)
           
 org.objectweb.jorm.naming.api.PBinder getPBinder(java.lang.String classname)
          This Method is a shortcut to the getPBinder(SpeedoProxy) method.
 org.objectweb.jorm.api.PClassMapping getPClassMapping(SpeedoProxy sp)
          Retrieves a PClassMapping instance managing a SpeedoProxy.
 org.objectweb.jorm.api.PClassMapping getPClassMapping(java.lang.String classname)
          This Method is a shortcut to the getPClassMapping(SpeedoProxy) method.
 org.objectweb.jorm.naming.api.PNamingContext getPNamingContext(SpeedoProxy sp)
           
 org.objectweb.jorm.naming.api.PNamingContext getPNamingContext(java.lang.String classname)
          This Method is a shortcut to the getPNamingContext(SpeedoProxy) method.
 

Method Detail

getPBinder

public org.objectweb.jorm.naming.api.PBinder getPBinder(java.lang.String classname)
                                                 throws org.objectweb.jorm.api.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. Then if an instance is availlable it is better to use the other method.
Parameters:
classname - the Jorm class name managed by the wanted PBinder
Returns:
the PBinder instance to use for the given jorm class name
Throws:
PException -  

getPBinder

public org.objectweb.jorm.naming.api.PBinder getPBinder(SpeedoProxy sp)
                                                 throws org.objectweb.jorm.api.PException
Returns:
the PBinder instance which manages the identifer of the SpeedoProxy instance

getPClassMapping

public org.objectweb.jorm.api.PClassMapping getPClassMapping(SpeedoProxy sp)
                                                      throws org.objectweb.jorm.api.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:
PException -  

getPClassMapping

public org.objectweb.jorm.api.PClassMapping getPClassMapping(java.lang.String classname)
                                                      throws org.objectweb.jorm.api.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:
PException -  

getPNamingContext

public org.objectweb.jorm.naming.api.PNamingContext getPNamingContext(SpeedoProxy sp)
                                                               throws org.objectweb.jorm.api.PException
Returns:
the PNamingContext instance which manages a reference to the SpeedoProxy instance

getPNamingContext

public org.objectweb.jorm.naming.api.PNamingContext getPNamingContext(java.lang.String classname)
                                                               throws org.objectweb.jorm.api.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:
PException -  

decode

public org.objectweb.jorm.naming.api.PName decode(java.lang.Object oid)
                                           throws org.objectweb.jorm.api.PException
It retrieves a PName since a representation of an identifier. The representation can be a PName which the PNamingContext reference must be checked and updated if needed. The identifier representation can be also an encode version of a PName. The cofing format depends on the implementation.
Parameters:
oid - is the identifier representation
Returns:
a PName matching the oid representation and valid in a PNameManager
Throws:
PException - if the oid does not represent a managed identifier representation.

encode

public java.lang.Object encode(org.objectweb.jorm.naming.api.PName pn)
                        throws org.objectweb.jorm.api.PException
It retrieves a representation of an identifier since a PName.
Parameters:
pn - is the pname to encode
Returns:
an identifier representation
Throws:
PException - if the pname is malformed (null for example).