com.adeptia.indigo.storage
Class EntityManagerFactory

java.lang.Object
  extended by com.adeptia.indigo.storage.EntityManagerFactory

public class EntityManagerFactory
extends java.lang.Object

Entity manager factory

Version:
CVS $Revision: 1.13 $

Method Summary
static EntityManager getEntityManager(java.lang.Class targetType)
          Retrieve an entity manager for the targetType.
static EntityManager getEntityManager(java.lang.Class targetType, javax.security.auth.Subject subject)
          Retrieve an entity manager for the targetType.
static EntityManager getEntityManager(java.lang.String beanType, javax.security.auth.Subject subject)
           
static int getEntityManagerCollection(java.lang.String[] services, javax.security.auth.Subject subject)
           
static void init()
          initialize the factory with some defaults
static void registerManager(java.lang.Class targetType, java.lang.Class managerClass)
          register an entity manager for a class
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

init

public static void init()
initialize the factory with some defaults


registerManager

public static void registerManager(java.lang.Class targetType,
                                   java.lang.Class managerClass)
register an entity manager for a class

Parameters:
targetType -
managerClass -

getEntityManager

public static EntityManager getEntityManager(java.lang.String beanType,
                                             javax.security.auth.Subject subject)
                                      throws com.adeptia.indigo.storage.StorageException
Throws:
com.adeptia.indigo.storage.StorageException

getEntityManager

public static EntityManager getEntityManager(java.lang.Class targetType)
                                      throws com.adeptia.indigo.storage.StorageException
Retrieve an entity manager for the targetType. Just hope that the entity manager you'll get does not need a require security (no subject available)

Parameters:
targetType -
Returns:
Throws:
com.adeptia.indigo.storage.StorageException

getEntityManager

public static EntityManager getEntityManager(java.lang.Class targetType,
                                             javax.security.auth.Subject subject)
                                      throws com.adeptia.indigo.storage.StorageException
Retrieve an entity manager for the targetType. If a manager was not registered the targetType then a default JdoEntityManager will be used

Parameters:
targetType -
subject -
Returns:
EntityManager
Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException
com.adeptia.indigo.storage.StorageException

getEntityManagerCollection

public static int getEntityManagerCollection(java.lang.String[] services,
                                             javax.security.auth.Subject subject)
                                      throws java.lang.Exception
Throws:
java.lang.Exception