org.ow2.jonas.lib.ejb21.jorm
Class MapperManager

java.lang.Object
  extended by org.ow2.jonas.lib.ejb21.jorm.MapperManager

public class MapperManager
extends Object

This class manages Jorm mappers. A mapper can be registered for each data source (connection factory) used in each EJB container. The Mapper manager provides also the JormConfigurator instance used to configure Jorm.

Author:
Sebastien Chassande-Barrioz

Constructor Summary
protected MapperManager()
           
 
Method Summary
 org.objectweb.jorm.api.PMapper addMapper(org.objectweb.jorm.api.PMapper m, JContainer c, Object cf)
          Register and start PMapper for a container and a connection factory if another mapper is not registered with the same container and the same connection factory.
static MapperManager getInstance()
          It retrieves the unique instance of MapperManager.
 org.objectweb.jorm.api.JormConfigurator getJormConfigurator()
           
 org.objectweb.util.monolog.api.Logger getLogger()
           
 org.objectweb.jorm.api.PMapper getMapper(JContainer c, Object cf)
          Lookup a jorm mapper for a given container and a given connection factory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapperManager

protected MapperManager()
Method Detail

getInstance

public static MapperManager getInstance()
It retrieves the unique instance of MapperManager.


getMapper

public org.objectweb.jorm.api.PMapper getMapper(JContainer c,
                                                Object cf)
Lookup a jorm mapper for a given container and a given connection factory

Parameters:
c - is the container asking the mapper
cf - is the connection factory (datasource for example) represented by the expected mapper.
Returns:
the PMapper instance if it exists, otherwise a null value.

addMapper

public org.objectweb.jorm.api.PMapper addMapper(org.objectweb.jorm.api.PMapper m,
                                                JContainer c,
                                                Object cf)
                                         throws org.objectweb.jorm.api.PException
Register and start PMapper for a container and a connection factory if another mapper is not registered with the same container and the same connection factory.

Parameters:
m - the mapper to register (never null)
c - the container using the mapper (never null)
cf - the connection factory represented by the mapper (never null)
Returns:
the mapper associated to the given container and the given connection factory. The returned mapper can be different from the mapper instance given in parameter if another similar mapper (same container and same connection factory) is already registered.
Throws:
org.objectweb.jorm.api.PException - if it is not possible to start the mapper.

getLogger

public org.objectweb.util.monolog.api.Logger getLogger()

getJormConfigurator

public org.objectweb.jorm.api.JormConfigurator getJormConfigurator()


Copyright © 2010 OW2 Consortium. All Rights Reserved.