Module org.eclipse.persistence.jpa
Class JPAInitializer
java.lang.Object
org.eclipse.persistence.internal.jpa.deployment.JPAInitializer
- Direct Known Subclasses:
JavaSECMPInitializer
Base class for all JPA initialization classes. This is an abstract class that provides the framework
for JPA initialization (finding and initializing persistence units). Subclasses implement the abstract methods
to provide customized functionality
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map
<String, EntityManagerSetupImpl> protected ClassLoader
protected static Map
<ClassLoader, JPAInitializer> protected Map
<String, SEPersistenceUnitInfo> protected boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncallPredeploy
(SEPersistenceUnitInfo persistenceUnitInfo, Map m, String persistenceUnitUniqueName, String sessionName) predeploy (with deploy) is one of the two steps required in deployment of entities This method will prepare to call predeploy, call it and finally register the transformer returned to be used for weaving.abstract void
checkWeaving
(Map properties) Check whether weaving is possible and update the properties and variable as appropriateprotected abstract ClassLoader
Create a temporary class loader that can be used to inspect classes and then thrown away.protected abstract ClassLoader
createTempLoader
(Collection col, boolean shouldOverrideLoadClassForCollectionMembers) In case persistence unit is not uniquely defined by name this method is called to generate a unique name.extractInitialEmSetupImpl
(String puName) findPersistenceUnitInfo
(String puName, Map m) Find PersistenceUnitInfo corresponding to the persistence unit name.protected SEPersistenceUnitInfo
findPersistenceUnitInfoInArchive
(String puName, Archive archive, Map m) Find PersistenceUnitInfo corresponding to the persistence unit name in the archive.protected SEPersistenceUnitInfo
findPersistenceUnitInfoInArchives
(String puName, Map m) Find PersistenceUnitInfo corresponding to the persistence unit name.void
initialize
(Map m) This method initializes the container.static void
Initialize the logging file if it is specified by the system property.protected void
initPersistenceUnits
(Archive archive, Map m) Initialize all persistence units found on initializationClassLoader.boolean
isPersistenceProviderSupported
(String providerClassName) Returns whether the given persistence provider class is supported by this implementationboolean
Indicates whether puName uniquely defines the persistence unit.protected boolean
Indicates whether initialPuInfos and initialEmSetupImpls are used.protected Set
loadEntityClasses
(Collection entityNames, ClassLoader classLoader) Create a list of java.lang.Class that contains the classes of all the entities that we will be deploying.abstract void
registerTransformer
(ClassTransformer transformer, PersistenceUnitInfo persistenceUnitInfo, Map properties) Register a transformer.
-
Field Details
-
shouldCreateInternalLoader
protected boolean shouldCreateInternalLoader -
initializationClassloader
-
initialPuInfos
-
initialEmSetupImpls
-
initializers
-
-
Constructor Details
-
JPAInitializer
protected JPAInitializer()
-
-
Method Details
-
initializeTopLinkLoggingFile
public static void initializeTopLinkLoggingFile()Initialize the logging file if it is specified by the system property. -
callPredeploy
public EntityManagerSetupImpl callPredeploy(SEPersistenceUnitInfo persistenceUnitInfo, Map m, String persistenceUnitUniqueName, String sessionName) predeploy (with deploy) is one of the two steps required in deployment of entities This method will prepare to call predeploy, call it and finally register the transformer returned to be used for weaving. -
checkWeaving
Check whether weaving is possible and update the properties and variable as appropriate- Parameters:
properties
- The list of properties to check for weaving and update if weaving is not needed
-
createTempLoader
Create a temporary class loader that can be used to inspect classes and then thrown away. This allows classes to be introspected prior to loading them with application's main class loader enabling weaving. -
createTempLoader
protected abstract ClassLoader createTempLoader(Collection col, boolean shouldOverrideLoadClassForCollectionMembers) -
findPersistenceUnitInfo
Find PersistenceUnitInfo corresponding to the persistence unit name. Returns null if either persistence unit either not found or provider is not supported. -
findPersistenceUnitInfoInArchives
Find PersistenceUnitInfo corresponding to the persistence unit name. Returns null if either persistence unit either not found or provider is not supported. -
findPersistenceUnitInfoInArchive
protected SEPersistenceUnitInfo findPersistenceUnitInfoInArchive(String puName, Archive archive, Map m) Find PersistenceUnitInfo corresponding to the persistence unit name in the archive. Returns null if either persistence unit either not found or provider is not supported. -
isPersistenceProviderSupported
Returns whether the given persistence provider class is supported by this implementation -
loadEntityClasses
Create a list of java.lang.Class that contains the classes of all the entities that we will be deploying. -
registerTransformer
public abstract void registerTransformer(ClassTransformer transformer, PersistenceUnitInfo persistenceUnitInfo, Map properties) Register a transformer. This method should be overridden to provide the appropriate transformer registration for the environment -
isPersistenceUnitUniquelyDefinedByName
public boolean isPersistenceUnitUniquelyDefinedByName()Indicates whether puName uniquely defines the persistence unit. -
createUniquePersistenceUnitName
In case persistence unit is not uniquely defined by name this method is called to generate a unique name. -
extractInitialEmSetupImpl
-
initialize
This method initializes the container. Essentially, it will try to load the class that contains the list of entities and reflectively call the method that contains that list. It will then initialize the container with that list. -
initPersistenceUnits
Initialize all persistence units found on initializationClassLoader. Initialization is a two phase process. First the predeploy process builds the metadata and creates any required transformers. Second the deploy process creates an EclipseLink session based on that metadata. -
keepAllPredeployedPersistenceUnits
protected boolean keepAllPredeployedPersistenceUnits()Indicates whether initialPuInfos and initialEmSetupImpls are used. -
getInitializationClassLoader
-