Package org.datanucleus.enhancer
Class RuntimeEnhancer
java.lang.Object
org.datanucleus.enhancer.RuntimeEnhancer
Class that will enhance a class at runtime, called via "javaagent".
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
This classloader is used to load any classes that are necessary during enhancement process, and avoid using application classloaders to load classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClassLoaderResolver
private final NucleusContext
(package private) Map
<ClassLoader, RuntimeEnhancer.EnhancerClassLoader> -
Constructor Summary
ConstructorsConstructorDescriptionRuntimeEnhancer
(String api, Map contextProps) Constructor for a runtime enhancer for an API. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
enhance
(String className, byte[] classdefinition, ClassLoader loader) void
setClassEnhancerOption
(String optionName) void
unsetClassEnhancerOption
(String optionName)
-
Field Details
-
clr
-
nucleusContext
-
runtimeLoaderByLoader
Map<ClassLoader,RuntimeEnhancer.EnhancerClassLoader> runtimeLoaderByLoader -
classEnhancerOptions
-
-
Constructor Details
-
RuntimeEnhancer
Constructor for a runtime enhancer for an API. Creates its own NucleusContext for enhancement. Note that this is because the NucleusContext currently is for runtime or enhancement, so we isolate things; in future we could take in the NucleusContext from whatever operation has it (e.g PMF, EMF).- Parameters:
api
- The APIcontextProps
- Properties for use by the NucleusContext (e.g ClassLoaderResolver class name, pluginRegistry).
-
-
Method Details
-
setClassEnhancerOption
-
unsetClassEnhancerOption
-
enhance
-