org.objectweb.jorm.naming.lib
Class KFPNCManager

java.lang.Object
  extended byorg.objectweb.jorm.naming.lib.KFPNCManager
All Implemented Interfaces:
Loggable, PMapperListener

public class KFPNCManager
extends java.lang.Object
implements PMapperListener, Loggable

Is a manager of FKPNC instances. It is in charge of the initialization of the couple (binder, key) into KFPNC. This manager keeps an association table between the class name of the root inheritance tree, and the KFPNC instance.

Author:
S.Chassande-Barrioz

Constructor Summary
KFPNCManager()
           
KFPNCManager(java.util.Map cn2pnc)
           
 
Method Summary
 void classMapped(ClassMappedEvent e)
          If the class is a root of an inheritance class tree, a KFPNC is created.
 void clean()
          Clean the internal structures to forget classes loaded previously.
 KeyFilteredNamingContext getKFPNC(java.lang.String className)
           
 Logger getLogger()
          Returns a logger to an component that wants to log things.
 LoggerFactory getLoggerFactory()
          Returns a logger factory that allows the creation of new loggers.
 void mappingRequired(PMappingRequiredEvent e)
          Signlas to this listener that the mapper requires a particular JORM class to be mapped.
 void setLogger(Logger logger)
          Assigns a logger to an component that wants to log things.
 void setLoggerFactory(LoggerFactory loggerFactory)
          Assigns a logger factory that allows the creation of new loggers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KFPNCManager

public KFPNCManager()

KFPNCManager

public KFPNCManager(java.util.Map cn2pnc)
Method Detail

getKFPNC

public KeyFilteredNamingContext getKFPNC(java.lang.String className)

clean

public void clean()
Clean the internal structures to forget classes loaded previously.


mappingRequired

public void mappingRequired(PMappingRequiredEvent e)
Description copied from interface: PMapperListener
Signlas to this listener that the mapper requires a particular JORM class to be mapped.

Specified by:
mappingRequired in interface PMapperListener
Parameters:
e - The event that signals that a particular JORM class is required to be mapped by the mapper.

classMapped

public void classMapped(ClassMappedEvent e)
If the class is a root of an inheritance class tree, a KFPNC is created. Otherwise if the PClassMapping of the new persistent class is also a NamingFilterKeyProvider, the couple (binder, key) is registered into the KFPNC of the ancestors.

Specified by:
classMapped in interface PMapperListener
Parameters:
e - contains the class name of the persistent class. The source of the event is the mapper.

getLoggerFactory

public LoggerFactory getLoggerFactory()
Description copied from interface: Loggable
Returns a logger factory that allows the creation of new loggers.

Specified by:
getLoggerFactory in interface Loggable

setLoggerFactory

public void setLoggerFactory(LoggerFactory loggerFactory)
Description copied from interface: Loggable
Assigns a logger factory that allows the creation of new loggers.

Specified by:
setLoggerFactory in interface Loggable
Parameters:
loggerFactory - the LoggerFactory object to obtain new loggers

getLogger

public Logger getLogger()
Description copied from interface: Loggable
Returns a logger to an component that wants to log things.

Specified by:
getLogger in interface Loggable

setLogger

public void setLogger(Logger logger)
Description copied from interface: Loggable
Assigns a logger to an component that wants to log things.

Specified by:
setLogger in interface Loggable
Parameters:
logger - the logger object