java.lang.Object
org.eclipse.persistence.internal.jpa.deployment.JPAInitializer
Direct Known Subclasses:
JavaSECMPInitializer

public abstract class JPAInitializer extends Object
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 Details

  • 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

      public abstract void checkWeaving(Map properties)
      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

      protected abstract ClassLoader createTempLoader(Collection col)
      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

      public SEPersistenceUnitInfo findPersistenceUnitInfo(String puName, Map m)
      Find PersistenceUnitInfo corresponding to the persistence unit name. Returns null if either persistence unit either not found or provider is not supported.
    • findPersistenceUnitInfoInArchives

      protected SEPersistenceUnitInfo findPersistenceUnitInfoInArchives(String puName, Map m)
      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

      public boolean isPersistenceProviderSupported(String providerClassName)
      Returns whether the given persistence provider class is supported by this implementation
    • loadEntityClasses

      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.
    • 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

      public String createUniquePersistenceUnitName(PersistenceUnitInfo puInfo)
      In case persistence unit is not uniquely defined by name this method is called to generate a unique name.
    • extractInitialEmSetupImpl

      public EntityManagerSetupImpl extractInitialEmSetupImpl(String puName)
    • initialize

      public void initialize(Map m)
      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

      protected void initPersistenceUnits(Archive archive, Map m)
      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

      public ClassLoader getInitializationClassLoader()