Class PersistenceWeaver
- java.lang.Object
-
- org.eclipse.persistence.internal.jpa.weaving.PersistenceWeaver
-
- All Implemented Interfaces:
javax.persistence.spi.ClassTransformer
public class PersistenceWeaver extends java.lang.Object implements javax.persistence.spi.ClassTransformerINTERNAL: This class performs dynamic byte code weaving: for each attribute mapped with One To One mapping with Basic Indirection it substitutes the original attribute's type for ValueHolderInterface.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,ClassDetails>classDetailsMapClass name in JVM '/' format toClassDetailsmap.
-
Constructor Summary
Constructors Constructor Description PersistenceWeaver(java.util.Map<java.lang.String,ClassDetails> classDetailsMap)INTERNAL: Creates an instance of dynamic byte code weaver.PersistenceWeaver(org.eclipse.persistence.sessions.Session session, java.util.Map<java.lang.String,ClassDetails> classDetailsMap)Deprecated.Session instance is no longer needed for logging.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()INTERNAL: Allow the weaver to be clear to release its referenced memory.java.util.Map<java.lang.String,ClassDetails>getClassDetailsMap()INTERNAL: Get Class name in JVM '/' format toClassDetailsmap.protected static java.lang.StringgetShortName(java.lang.String name)INTERNAL: Returns an unqualified class name from the specified class name.byte[]transform(java.lang.ClassLoader loader, java.lang.String className, java.lang.Class classBeingRedefined, java.security.ProtectionDomain protectionDomain, byte[] classfileBuffer)INTERNAL: Perform dynamic byte code weaving of class.
-
-
-
Field Detail
-
classDetailsMap
protected java.util.Map<java.lang.String,ClassDetails> classDetailsMap
Class name in JVM '/' format toClassDetailsmap.
-
-
Constructor Detail
-
PersistenceWeaver
public PersistenceWeaver(org.eclipse.persistence.sessions.Session session, java.util.Map<java.lang.String,ClassDetails> classDetailsMap)Deprecated.Session instance is no longer needed for logging. Will be removed in 2.8.INTERNAL: Creates an instance of dynamic byte code weaver.- Parameters:
session- EclipseLink session (not used sonullvalue is OK).classDetailsMap- Class name toClassDetailsmap.
-
PersistenceWeaver
public PersistenceWeaver(java.util.Map<java.lang.String,ClassDetails> classDetailsMap)
INTERNAL: Creates an instance of dynamic byte code weaver.- Parameters:
classDetailsMap- Class name toClassDetailsmap.- Since:
- 2.7
-
-
Method Detail
-
clear
public void clear()
INTERNAL: Allow the weaver to be clear to release its referenced memory. This is required because the class loader reference to the transformer will never gc.
-
getClassDetailsMap
public java.util.Map<java.lang.String,ClassDetails> getClassDetailsMap()
INTERNAL: Get Class name in JVM '/' format toClassDetailsmap.- Returns:
- Class name in JVM '/' format to
ClassDetailsmap.
-
transform
public byte[] transform(java.lang.ClassLoader loader, java.lang.String className, java.lang.Class classBeingRedefined, java.security.ProtectionDomain protectionDomain, byte[] classfileBuffer) throws java.lang.instrument.IllegalClassFormatExceptionINTERNAL: Perform dynamic byte code weaving of class.- Specified by:
transformin interfacejavax.persistence.spi.ClassTransformer- Parameters:
loader- The defining loader of the class to be transformed, may benullif the bootstrap loader.className- The name of the class in the internal form of fully qualified class and interface names.classBeingRedefined- If this is a redefine, the class being redefined, otherwisenull.protectionDomain- The protection domain of the class being defined or redefined.classfileBuffer- The input byte buffer in class file format (must not be modified).- Returns:
- A well-formed class file buffer (the result of the transform), or
nullif no transform is performed. - Throws:
java.lang.instrument.IllegalClassFormatException
-
getShortName
protected static java.lang.String getShortName(java.lang.String name)
INTERNAL: Returns an unqualified class name from the specified class name.- Parameters:
name- Class name with'/'as delimiter.- Returns:
- Unqualified class name.
-
-