java.lang.Object
org.eclipse.persistence.internal.jpa.weaving.PersistenceWeaver
All Implemented Interfaces:
ClassTransformer

public class PersistenceWeaver extends Object implements ClassTransformer
INTERNAL: 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 Details

  • Constructor Details

    • PersistenceWeaver

      public PersistenceWeaver(Map<String,ClassDetails> classDetailsMap)
      INTERNAL: Creates an instance of dynamic byte code weaver.
      Parameters:
      classDetailsMap - Class name to ClassDetails map.
      Since:
      2.7
  • Method Details

    • 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 Map<String,ClassDetails> getClassDetailsMap()
      INTERNAL: Get Class name in JVM '/' format to ClassDetails map.
      Returns:
      Class name in JVM '/' format to ClassDetails map.
    • transform

      public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws TransformerException
      INTERNAL: Perform dynamic byte code weaving of class.
      Specified by:
      transform in interface ClassTransformer
      Parameters:
      loader - The defining loader of the class to be transformed, may be null if 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, otherwise null.
      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 null if no transform is performed.
      Throws:
      TransformerException
    • getShortName

      protected static String getShortName(String name)
      INTERNAL: Returns an unqualified class name from the specified class name.
      Parameters:
      name - Class name with '/' as delimiter.
      Returns:
      Unqualified class name.