org.objectweb.easybeans.persistence.xml
Class PersistenceXmlFileAnalyzer

java.lang.Object
  extended by org.objectweb.easybeans.persistence.xml.PersistenceXmlFileAnalyzer

public final class PersistenceXmlFileAnalyzer
extends java.lang.Object

Class used to analyze a given archive (by analyzing the persistence.xml file if any).

Author:
Florent Benoit

Field Summary
private static java.lang.String DIRECTORY_PERSISTENCE_XML_FILE
          Directory where persistence.xml file should be.
private static JLog logger
          Logger.
private static java.lang.String PERSISTENCE_XML_FILE
          Name of the persistence.xml file.
 
Constructor Summary
private PersistenceXmlFileAnalyzer()
          Utility class, no public constructor.
 
Method Summary
static PersistenceUnitManager analyzePersistenceXmlFile(java.io.File archive, java.lang.ClassLoader classLoader)
          Detects and analyze the META-INF/persistence.xml file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIRECTORY_PERSISTENCE_XML_FILE

private static final java.lang.String DIRECTORY_PERSISTENCE_XML_FILE
Directory where persistence.xml file should be.

See Also:
Constant Field Values

PERSISTENCE_XML_FILE

private static final java.lang.String PERSISTENCE_XML_FILE
Name of the persistence.xml file.

See Also:
Constant Field Values

logger

private static JLog logger
Logger.

Constructor Detail

PersistenceXmlFileAnalyzer

private PersistenceXmlFileAnalyzer()
Utility class, no public constructor.

Method Detail

analyzePersistenceXmlFile

public static PersistenceUnitManager analyzePersistenceXmlFile(java.io.File archive,
                                                               java.lang.ClassLoader classLoader)
                                                        throws PersistenceXmlFileAnalyzerException
Detects and analyze the META-INF/persistence.xml file.

Parameters:
archive - the file to analyze (or directory) in order to find a persistence.xml file.
classLoader - the classloader used to load the persistence provider class.
Returns:
a persistence unit manager (which can manage the peristence contexts).
Throws:
PersistenceXmlFileAnalyzerException - if detection or analyze fails.