Package org.apache.openjpa.enhance
Class ManagedClassSubclasser
- java.lang.Object
-
- org.apache.openjpa.enhance.ManagedClassSubclasser
-
public class ManagedClassSubclasser extends java.lang.Object
Redefines the method bodies of existing unenhanced classes to make them notify state managers of mutations.- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description ManagedClassSubclasser()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
debugBytecodes(ClassNodeTracker cnt, byte[] classBytes)
static java.util.List<java.lang.Class<?>>
prepareUnenhancedClasses(OpenJPAConfiguration conf, java.util.Collection<? extends java.lang.Class<?>> classes, java.lang.ClassLoader envLoader)
For each element inclasses
, creates and registers a new subclass that implementsPersistenceCapable
, and prepares OpenJPA to handle new instances of the unenhanced type.
-
-
-
Method Detail
-
prepareUnenhancedClasses
public static java.util.List<java.lang.Class<?>> prepareUnenhancedClasses(OpenJPAConfiguration conf, java.util.Collection<? extends java.lang.Class<?>> classes, java.lang.ClassLoader envLoader)
For each element inclasses
, creates and registers a new subclass that implementsPersistenceCapable
, and prepares OpenJPA to handle new instances of the unenhanced type. If this is invoked in a Java 6 environment, this method will redefine the methods for each class in the argument list such that field accesses are intercepted in-line. If invoked in a Java 5 environment or very new Java versions, this redefinition is not possible; in these contexts, when using field access, OpenJPA will need to do state comparisons to detect any change to any instance at any time, and when using property access, OpenJPA will need to do state comparisons to detect changes to newly inserted instances after a flush has been called.- Returns:
- the new subclasses, or
null
ifclasses
isnull
. - Throws:
UserException
- ifconf
requires build-time enhancement andclasses
includes unenhanced types.- Since:
- 1.0.0
-
debugBytecodes
public static void debugBytecodes(ClassNodeTracker cnt, byte[] classBytes) throws java.io.IOException
- Throws:
java.io.IOException
-
-