org.objectweb.jorm.facility.naming.polymorphid
Class PolymorphIdMgrImpl

java.lang.Object
  extended byorg.objectweb.jorm.facility.naming.polymorphid.PolymorphIdMgrImpl
All Implemented Interfaces:
PolymorphIdMgr

public class PolymorphIdMgrImpl
extends java.lang.Object
implements PolymorphIdMgr

Author:
P. Dechamboux

Field Summary
protected  Logger logger
           
 
Constructor Summary
PolymorphIdMgrImpl()
           
 
Method Summary
 void binderTypeDef(PolymorphIdBinderInfo b)
          Notifies the manager that a PType has been associated with this binder.
 LongGenMgr getLongGenMgr()
          Retrieves the LongGenMgr associated with this PolymorphIdMgr.
 PBinder getPBinder(long id)
          Retrieves a PBinder that manages polymorphic identifiers for the class with the given identifier.
 PBinder getPBinder(long id, java.lang.Object conn)
          Retrieves a PBinder that manages polymorphic identifiers for the class with the given identifier.
 PBinder getPBinder(java.lang.String cn)
          Retrieves a PBinder that manages polymorphic identifiers for the class with the given name.
 PBinder getPBinder(java.lang.String cn, java.lang.Object conn)
          Retrieves a PBinder that manages polymorphic identifiers for the class with the given name.
 PMapper getPMapper()
          Retrieves the mapper associated with this PolymorphIdMgr.
 PNamingContext getRefNC(java.lang.String cn)
          Retrieves a PNamingContext that manages polymorphic references for the class with the given name.
 void init(PMapper pm, byte clact)
          Initializes a polymorphic identifier manager by mapping relevant classes to the given mapper, and setting up relevant initial persistent information.
 void ncTypeDef(PolymorphRefNC p)
          Notifies the manager that a PType has been associated with this binder.
 long newClassId()
          Allocates a new persisttent class identifier.
 long newClassId(java.lang.Object conn)
           
 void setLogger(Logger l)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected Logger logger
Constructor Detail

PolymorphIdMgrImpl

public PolymorphIdMgrImpl()
Method Detail

setLogger

public void setLogger(Logger l)

binderTypeDef

public void binderTypeDef(PolymorphIdBinderInfo b)
Notifies the manager that a PType has been associated with this binder.

Specified by:
binderTypeDef in interface PolymorphIdMgr

getLongGenMgr

public LongGenMgr getLongGenMgr()
Retrieves the LongGenMgr associated with this PolymorphIdMgr.

Specified by:
getLongGenMgr in interface PolymorphIdMgr

getPBinder

public PBinder getPBinder(java.lang.String cn)
                   throws PException
Retrieves a PBinder that manages polymorphic identifiers for the class with the given name. If it does not exist, creates it.

Specified by:
getPBinder in interface PolymorphIdMgr
Parameters:
cn - The class name.
Throws:
PException

getPBinder

public PBinder getPBinder(java.lang.String cn,
                          java.lang.Object conn)
                   throws PException
Retrieves a PBinder that manages polymorphic identifiers for the class with the given name. If it does not exist, creates it.

Specified by:
getPBinder in interface PolymorphIdMgr
Parameters:
cn - The class name.
Throws:
PException

getPBinder

public PBinder getPBinder(long id)
                   throws PException
Retrieves a PBinder that manages polymorphic identifiers for the class with the given identifier. If it does not exist, creates it.

Specified by:
getPBinder in interface PolymorphIdMgr
Parameters:
id - The class identifier.
Throws:
PException

getPBinder

public PBinder getPBinder(long id,
                          java.lang.Object conn)
                   throws PException
Retrieves a PBinder that manages polymorphic identifiers for the class with the given identifier. If it does not exist, creates it.

Parameters:
id - The class name.
conn - The connection to access the data store.
Throws:
PException

getPMapper

public PMapper getPMapper()
Retrieves the mapper associated with this PolymorphIdMgr.

Specified by:
getPMapper in interface PolymorphIdMgr

getRefNC

public PNamingContext getRefNC(java.lang.String cn)
Retrieves a PNamingContext that manages polymorphic references for the class with the given name. This means that such references can point to object of this class or any of its sub-classes. If it does not exist, creates it.

Specified by:
getRefNC in interface PolymorphIdMgr
Parameters:
cn - The class name.

init

public void init(PMapper pm,
                 byte clact)
          throws PException
Initializes a polymorphic identifier manager by mapping relevant classes to the given mapper, and setting up relevant initial persistent information.

Specified by:
init in interface PolymorphIdMgr
Throws:
PException

newClassId

public long newClassId()
                throws PException
Allocates a new persisttent class identifier.

Specified by:
newClassId in interface PolymorphIdMgr
Throws:
PException

newClassId

public long newClassId(java.lang.Object conn)
                throws PException
Specified by:
newClassId in interface PolymorphIdMgr
Throws:
PException

ncTypeDef

public void ncTypeDef(PolymorphRefNC p)
Notifies the manager that a PType has been associated with this binder.

Specified by:
ncTypeDef in interface PolymorphIdMgr