java.lang.Object
org.hibernate.bytecode.enhance.internal.bytebuddy.EnhancerImpl
All Implemented Interfaces:
Enhancer

public class EnhancerImpl extends Object implements Enhancer
  • Field Details

    • enhancementContext

      protected final org.hibernate.bytecode.enhance.internal.bytebuddy.ByteBuddyEnhancementContext enhancementContext
  • Constructor Details

    • EnhancerImpl

      public EnhancerImpl(EnhancementContext enhancementContext, ByteBuddyState byteBuddyState)
      Constructs the Enhancer, using the given context.
      Parameters:
      enhancementContext - Describes the context in which enhancement will occur so as to give access to contextual/environmental information.
      byteBuddyState - refers to the ByteBuddy instance to use
    • EnhancerImpl

      public EnhancerImpl(EnhancementContext enhancementContext, ByteBuddyState byteBuddyState, EnhancerClassLocator classLocator)
      Expert level constructor, this allows for more control of state and bytecode loading, which allows integrators to optimise for particular contexts of use.
      Parameters:
      enhancementContext -
      byteBuddyState -
      classLocator -
  • Method Details

    • enhance

      public byte[] enhance(String className, byte[] originalBytes) throws EnhancementException
      Performs the enhancement.
      Specified by:
      enhance in interface Enhancer
      Parameters:
      className - The name of the class whose bytecode is being enhanced.
      originalBytes - The class's original (pre-enhancement) byte code
      Returns:
      The enhanced bytecode. Could be the same as the original bytecode if the original was already enhanced or we could not enhance it for some reason.
      Throws:
      EnhancementException - Indicates a problem performing the enhancement
    • discoverTypes

      public void discoverTypes(String className, byte[] originalBytes)
      Description copied from interface: Enhancer
      Discovers types prior to enhancement. It is possible to invoke this method concurrently.
      Specified by:
      discoverTypes in interface Enhancer
      Parameters:
      className - The name of the class whose bytecode is being analyzed for type discovery.
      originalBytes - The class's original (pre-enhancement) byte code