Class EnhancerImpl
- java.lang.Object
-
- org.hibernate.bytecode.enhance.internal.bytebuddy.EnhancerImpl
-
-
Field Summary
Fields Modifier and Type Field Description protected org.hibernate.bytecode.enhance.internal.bytebuddy.ByteBuddyEnhancementContext
enhancementContext
-
Constructor Summary
Constructors Constructor Description EnhancerImpl(EnhancementContext enhancementContext, ByteBuddyState byteBuddyState)
Constructs the Enhancer, using the given context.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
discoverTypes(String className, byte[] originalBytes)
Discovers types prior to enhancement.byte[]
enhance(String className, byte[] originalBytes)
Performs the enhancement.
-
-
-
Constructor Detail
-
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 Detail
-
enhance
public byte[] enhance(String className, byte[] originalBytes) throws EnhancementException
Performs the enhancement.- Specified by:
enhance
in interfaceEnhancer
- 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 interfaceEnhancer
- Parameters:
className
- The name of the class whose bytecode is being analyzed for type discovery.originalBytes
- The class's original (pre-enhancement) byte code
-
-