Fabric3 JPA/Hibernate Extension

org.fabric3.jpa.runtime.emf
Class DefaultEntityManagerFactoryCache

java.lang.Object
  extended by org.fabric3.jpa.runtime.emf.DefaultEntityManagerFactoryCache
All Implemented Interfaces:
EntityManagerFactoryCache, org.fabric3.spi.builder.classloader.ClassLoaderListener

public class DefaultEntityManagerFactoryCache
extends Object
implements EntityManagerFactoryCache, org.fabric3.spi.builder.classloader.ClassLoaderListener

Creates and caches entity manager factories.

Version:
$Rev: 8837 $ $Date: 2010-04-08 14:05:46 +0200 (Thu, 08 Apr 2010) $

Constructor Summary
DefaultEntityManagerFactoryCache(CacheMonitor monitor)
           
 
Method Summary
 void destroy()
           
 javax.persistence.EntityManagerFactory get(String unitName)
          Returns the EntityManagerFactory for the given persistence unit name
 void onDeploy(ClassLoader loader)
           
 void onUndeploy(ClassLoader classLoader)
           
 void put(URI uri, String unitName, javax.persistence.EntityManagerFactory factory)
          Caches an EntityManagerFactory.
 void setManagementService(org.fabric3.spi.management.ManagementService managementService)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultEntityManagerFactoryCache

public DefaultEntityManagerFactoryCache(CacheMonitor monitor)
Method Detail

setManagementService

public void setManagementService(org.fabric3.spi.management.ManagementService managementService)

destroy

public void destroy()

onDeploy

public void onDeploy(ClassLoader loader)
Specified by:
onDeploy in interface org.fabric3.spi.builder.classloader.ClassLoaderListener

onUndeploy

public void onUndeploy(ClassLoader classLoader)
Specified by:
onUndeploy in interface org.fabric3.spi.builder.classloader.ClassLoaderListener

get

public javax.persistence.EntityManagerFactory get(String unitName)
Description copied from interface: EntityManagerFactoryCache
Returns the EntityManagerFactory for the given persistence unit name

Specified by:
get in interface EntityManagerFactoryCache
Parameters:
unitName - the persistence unit name
Returns:
the EntityManagerFactory or null if one has not been created

put

public void put(URI uri,
                String unitName,
                javax.persistence.EntityManagerFactory factory)
         throws JpaResolutionException
Description copied from interface: EntityManagerFactoryCache
Caches an EntityManagerFactory.

Specified by:
put in interface EntityManagerFactoryCache
Parameters:
uri - the URI of the contribution the persistence unit is defined in
unitName - the persistence unit name
factory - the EntityManagerFactory to cache
Throws:
JpaResolutionException - if there is an error caching the EntityManagerFactory

Fabric3 JPA/Hibernate Extension

Copyright © 2007-2012 Metaform Systems.