Package org.apache.openjpa.enhance
Class PCClassFileTransformer
- java.lang.Object
-
- org.apache.openjpa.enhance.PCClassFileTransformer
-
- All Implemented Interfaces:
java.lang.instrument.ClassFileTransformer
- Direct Known Subclasses:
PCClassFileTransformer.Reentrant
public class PCClassFileTransformer extends java.lang.Object implements java.lang.instrument.ClassFileTransformer
Transformer that makes persistent classes implement thePersistenceCapable
interface at runtime.- Author:
- Abe White
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PCClassFileTransformer.Reentrant
-
Constructor Summary
Constructors Constructor Description PCClassFileTransformer(MetaDataRepository repos, PCEnhancer.Flags flags, java.lang.ClassLoader tmpLoader, boolean devscan)
Constructor.PCClassFileTransformer(MetaDataRepository repos, Options opts, java.lang.ClassLoader loader)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PCClassFileTransformer
newInstance(MetaDataRepository repos, Options parseProperties, java.lang.ClassLoader tmpLoader)
byte[]
transform(java.lang.ClassLoader loader, java.lang.String className, java.lang.Class redef, java.security.ProtectionDomain domain, byte[] bytes)
protected byte[]
transform0(java.lang.String className, java.lang.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.
-
-
-
Constructor Detail
-
PCClassFileTransformer
public PCClassFileTransformer(MetaDataRepository repos, Options opts, java.lang.ClassLoader loader)
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, java.lang.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 Detail
-
newInstance
public static PCClassFileTransformer newInstance(MetaDataRepository repos, Options parseProperties, java.lang.ClassLoader tmpLoader)
-
transform
public byte[] transform(java.lang.ClassLoader loader, java.lang.String className, java.lang.Class redef, java.security.ProtectionDomain domain, byte[] bytes) throws java.lang.instrument.IllegalClassFormatException
- Specified by:
transform
in interfacejava.lang.instrument.ClassFileTransformer
- Throws:
java.lang.instrument.IllegalClassFormatException
-
transform0
protected byte[] transform0(java.lang.String className, java.lang.Class redef, byte[] bytes) throws java.lang.instrument.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:
java.lang.instrument.IllegalClassFormatException
-
-