Package org.apache.openjpa.enhance
Class PCClassFileTransformer
java.lang.Object
org.apache.openjpa.enhance.PCClassFileTransformer
- All Implemented Interfaces:
ClassFileTransformer
- Direct Known Subclasses:
PCClassFileTransformer.Reentrant
Transformer that makes persistent classes implement the
PersistenceCapable
interface at runtime.- Author:
- Abe White
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionPCClassFileTransformer
(MetaDataRepository repos, PCEnhancer.Flags flags, ClassLoader tmpLoader, boolean devscan) Constructor.PCClassFileTransformer
(MetaDataRepository repos, Options opts, ClassLoader loader) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic PCClassFileTransformer
newInstance
(MetaDataRepository repos, Options parseProperties, ClassLoader tmpLoader) byte[]
transform
(ClassLoader loader, String className, Class redef, ProtectionDomain domain, byte[] bytes) protected byte[]
transform0
(String className, Class redef, byte[] bytes) We have to split the transform method into two methods to avoid ClassCircularityError when executing method using pure-JIT JVMs such as JRockit.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.instrument.ClassFileTransformer
transform
-
Constructor Details
-
PCClassFileTransformer
Constructor.- Parameters:
repos
- metadata repository to use internallyopts
- enhancer configuration optionsloader
- temporary class loader for loading intermediate classes
-
PCClassFileTransformer
public PCClassFileTransformer(MetaDataRepository repos, PCEnhancer.Flags flags, ClassLoader tmpLoader, boolean devscan) Constructor.- Parameters:
repos
- metadata repository to use internallyflags
- enhancer configurationtmpLoader
- temporary class loader for loading intermediate classesdevscan
- whether to scan the dev classpath for persistent types if none are configured
-
-
Method Details
-
newInstance
public static PCClassFileTransformer newInstance(MetaDataRepository repos, Options parseProperties, ClassLoader tmpLoader) -
transform
public byte[] transform(ClassLoader loader, String className, Class redef, ProtectionDomain domain, byte[] bytes) throws IllegalClassFormatException - Specified by:
transform
in interfaceClassFileTransformer
- Throws:
IllegalClassFormatException
-
transform0
protected byte[] transform0(String className, Class redef, byte[] bytes) throws IllegalClassFormatException We have to split the transform method into two methods to avoid ClassCircularityError when executing method using pure-JIT JVMs such as JRockit.- Throws:
IllegalClassFormatException
-