Class PersistenceWeaver

  • All Implemented Interfaces:
    jakarta.persistence.spi.ClassTransformer

    public class PersistenceWeaver
    extends Object
    implements jakarta.persistence.spi.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.
    • Constructor Detail

      • PersistenceWeaver

        @Deprecated
        public PersistenceWeaver​(Session session,
                                 Map<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 so null value is OK).
        classDetailsMap - Class name to ClassDetails map.
      • 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 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.
      • transform

        public byte[] transform​(ClassLoader loader,
                                String className,
                                Class classBeingRedefined,
                                ProtectionDomain protectionDomain,
                                byte[] classfileBuffer)
                         throws IllegalClassFormatException
        INTERNAL: Perform dynamic byte code weaving of class.
        Specified by:
        transform in interface jakarta.persistence.spi.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:
        IllegalClassFormatException
      • 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.