org.apache.aries.jpa.container.impl
Class EntityManagerFactoryManager

java.lang.Object
  extended by org.apache.aries.jpa.container.impl.EntityManagerFactoryManager

public class EntityManagerFactoryManager
extends Object

This class manages the lifecycle of Persistence Units and their associated EntityManagerFactory objects.


Constructor Summary
EntityManagerFactoryManager(org.osgi.framework.BundleContext containerCtx, org.osgi.framework.Bundle b, Collection<ParsedPersistenceUnit> parsedUnits, org.osgi.framework.ServiceReference ref, Collection<ManagedPersistenceUnitInfo> infos)
          Create an EntityManagerFactoryManager for the supplied persistence bundle.
 
Method Summary
 void bundleStateChange()
          Notify the EntityManagerFactoryManager that the bundle it is managing has changed state This method should only be called when not holding any locks
 void destroy()
          Stop managing any EntityManagerFactorys This method should only be called when not holding any locks
 org.osgi.framework.Bundle getBundle()
           
 Collection<ParsedPersistenceUnit> getParsedPersistenceUnits()
           
 void manage(Collection<ParsedPersistenceUnit> parsedUnits, org.osgi.framework.ServiceReference ref, Collection<ManagedPersistenceUnitInfo> infos)
          Manage the EntityManagerFactories for the following provider, updated persistence xmls and PersistenceUnitInfos This method should only be called when not holding any locks
 void manage(org.osgi.framework.ServiceReference ref, Collection<ManagedPersistenceUnitInfo> infos)
          Manage the EntityManagerFactories for the following provider and PersistenceUnitInfos This method should only be called when not holding any locks
 boolean providerRemoved(org.osgi.framework.ServiceReference ref)
          Notify the EntityManagerFactoryManager that a provider is being removed from the service registry.
 void quiesce(DestroyCallback countdown)
          Quiesce this Manager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityManagerFactoryManager

public EntityManagerFactoryManager(org.osgi.framework.BundleContext containerCtx,
                                   org.osgi.framework.Bundle b,
                                   Collection<ParsedPersistenceUnit> parsedUnits,
                                   org.osgi.framework.ServiceReference ref,
                                   Collection<ManagedPersistenceUnitInfo> infos)
Create an EntityManagerFactoryManager for the supplied persistence bundle. This constructor should only be used by a PersistenceBundleManager that is synchronized on itself, and the resulting manager should be immediately stored in the bundleToManager Map

Parameters:
b -
infos -
ref -
parsedUnits -
Method Detail

providerRemoved

public boolean providerRemoved(org.osgi.framework.ServiceReference ref)
Notify the EntityManagerFactoryManager that a provider is being removed from the service registry. If the provider is used by this EntityManagerFactoryManager then the manager should destroy the dependent persistence units. This method should only be called when not holding any locks

Parameters:
ref - The provider service reference
Returns:
true if the the provider is being used by this manager

bundleStateChange

public void bundleStateChange()
                       throws InvalidPersistenceUnitException
Notify the EntityManagerFactoryManager that the bundle it is managing has changed state This method should only be called when not holding any locks

Throws:
InvalidPersistenceUnitException - if the manager is no longer valid and should be destroyed

manage

public void manage(org.osgi.framework.ServiceReference ref,
                   Collection<ManagedPersistenceUnitInfo> infos)
            throws IllegalStateException
Manage the EntityManagerFactories for the following provider and PersistenceUnitInfos This method should only be called when not holding any locks

Parameters:
ref - The PersistenceProvider ServiceReference
infos - The PersistenceUnitInfos defined by our bundle
Throws:
IllegalStateException

manage

public void manage(Collection<ParsedPersistenceUnit> parsedUnits,
                   org.osgi.framework.ServiceReference ref,
                   Collection<ManagedPersistenceUnitInfo> infos)
            throws IllegalStateException
Manage the EntityManagerFactories for the following provider, updated persistence xmls and PersistenceUnitInfos This method should only be called when not holding any locks

Parameters:
parsedUnits - The updated ParsedPersistenceUnits for this bundle
ref - The PersistenceProvider ServiceReference
infos - The PersistenceUnitInfos defined by our bundle
Throws:
IllegalStateException

destroy

public void destroy()
Stop managing any EntityManagerFactorys This method should only be called when not holding any locks


getBundle

public org.osgi.framework.Bundle getBundle()

getParsedPersistenceUnits

public Collection<ParsedPersistenceUnit> getParsedPersistenceUnits()

quiesce

public void quiesce(DestroyCallback countdown)
Quiesce this Manager



Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.