@Module public class PersistenceManager extends java.lang.Object implements ScanListener, EnvironmentEnhancerListener
Modifier and Type | Method and Description |
---|---|
void |
addPersistenceUnitDefault(ConfigProgram program)
Adds a persistence-unit default
|
void |
addPersistenceUnitProxy(java.lang.String name,
java.util.ArrayList<ConfigProgram> program)
Adds a persistence-unit default
|
void |
classMatchEvent(EnvironmentClassLoader loader,
Path root,
java.lang.String className)
Callback to note the class matches
|
void |
close() |
void |
configurePersistenceRoots() |
static PersistenceManager |
create()
Returns the local container.
|
static PersistenceManager |
create(java.lang.ClassLoader loader)
Returns the local container.
|
void |
environmentBind(EnvironmentClassLoader loader)
Handles the environment config phase
|
void |
environmentConfigure(EnvironmentClassLoader loader)
Handles the environment config phase
|
void |
environmentConfigureEnhancer(EnvironmentClassLoader loader)
Handles the environment config phase
|
void |
environmentStart(EnvironmentClassLoader loader)
Handles the case where the environment is starting (after init).
|
void |
environmentStop(EnvironmentClassLoader loader)
Handles the case where the environment is stopping
|
EnvironmentClassLoader |
getClassLoader()
Returns the environment's class loader
|
static PersistenceManager |
getCurrent()
Returns the local container.
|
static PersistenceManager |
getCurrent(java.lang.ClassLoader loader)
Returns the current environment container.
|
java.util.ArrayList<ConfigProgram> |
getPersistenceUnitDefaults()
Returns the persistence-unit default list.
|
java.util.ArrayList<ConfigProgram> |
getProxyProgram(java.lang.String name) |
int |
getScanPriority()
Since JPA enhances, it is priority 0
|
java.lang.ClassLoader |
getTempClassLoader()
Returns the JClassLoader.
|
void |
init() |
boolean |
isRootScannable(Path root,
java.lang.String packageRoot)
Returns true if the root is a valid scannable root.
|
boolean |
isScanMatchAnnotation(CharBuffer annotationName)
Returns true if the string matches an annotation class.
|
java.lang.Class<?> |
loadTempClass(java.lang.String name) |
ScanClass |
scanClass(Path root,
java.lang.String packageRoot,
java.lang.String className,
int modifiers)
Returns the state when scanning the class
|
void |
start() |
void |
startPersistenceUnits()
Adds the URLs for the classpath.
|
java.lang.String |
toString() |
public static PersistenceManager create()
public static PersistenceManager create(java.lang.ClassLoader loader)
public static PersistenceManager getCurrent()
public static PersistenceManager getCurrent(java.lang.ClassLoader loader)
public EnvironmentClassLoader getClassLoader()
public java.lang.ClassLoader getTempClassLoader()
public void addPersistenceUnitDefault(ConfigProgram program)
public java.util.ArrayList<ConfigProgram> getPersistenceUnitDefaults()
public void addPersistenceUnitProxy(java.lang.String name, java.util.ArrayList<ConfigProgram> program)
public java.util.ArrayList<ConfigProgram> getProxyProgram(java.lang.String name)
public java.lang.Class<?> loadTempClass(java.lang.String name) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public void init()
public void start()
public void configurePersistenceRoots()
public void startPersistenceUnits()
public void close()
public int getScanPriority()
getScanPriority
in interface ScanListener
public boolean isRootScannable(Path root, java.lang.String packageRoot)
isRootScannable
in interface ScanListener
public ScanClass scanClass(Path root, java.lang.String packageRoot, java.lang.String className, int modifiers)
ScanListener
scanClass
in interface ScanListener
root
- the module/jar's root pathpackageRoot
- the virtual package root (usually for Testing)className
- the class namemodifiers
- the class modifierspublic boolean isScanMatchAnnotation(CharBuffer annotationName)
ScanListener
isScanMatchAnnotation
in interface ScanListener
public void classMatchEvent(EnvironmentClassLoader loader, Path root, java.lang.String className)
classMatchEvent
in interface ScanListener
public void environmentConfigureEnhancer(EnvironmentClassLoader loader)
environmentConfigureEnhancer
in interface EnvironmentEnhancerListener
public void environmentConfigure(EnvironmentClassLoader loader)
environmentConfigure
in interface EnvironmentListener
public void environmentBind(EnvironmentClassLoader loader)
environmentBind
in interface EnvironmentListener
public void environmentStart(EnvironmentClassLoader loader)
environmentStart
in interface EnvironmentListener
public void environmentStop(EnvironmentClassLoader loader)
environmentStop
in interface EnvironmentListener
public java.lang.String toString()
toString
in class java.lang.Object