Top Inners Fields Constructors Methods
org.hibernate.jpa.internal.enhance

public Class EnhancingClassTransformerImpl

extends Object
implements ClassTransformer
Class Inheritance
All Implemented Interfaces
org.hibernate.bytecode.spi.ClassTransformer, jakarta.persistence.spi.ClassTransformer
Imports
java.lang.ref.WeakReference, java.security.ProtectionDomain, java.util.Objects, java.util.concurrent.locks.ReentrantLock, org.hibernate.bytecode.enhance.spi.EnhancementContext, .EnhancementContextWrapper, .Enhancer, org.hibernate.bytecode.internal.BytecodeProviderInitiator, org.hibernate.bytecode.spi.BytecodeProvider, .ClassTransformer, jakarta.persistence.spi.TransformerException

Authors
Steve Ebersole, Luis Barreiro

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final BytecodeProvider
private final EnhancementContext
private volatile WeakReference<EnhancingClassTransformerImpl.Entry>
private final ReentrantLock

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private Enhancer
public void
private Enhancer
private static EnhancingClassTransformerImpl.Entry
public byte[]
transform(ClassLoader
the defining loader of the class to be transformed, may be null if the bootstrap loader
loader
,
String
the name of the class in the internal form of fully qualified class and interface names
className
,
Class<?>
if this is a redefine, the class being redefined, otherwise null
classBeingRedefined
,
ProtectionDomain
the protection domain of the class being defined or redefined
protectionDomain
,
byte[]
the input byte buffer in class file format - must not be modified
classfileBuffer
)

Implements jakarta.persistence.spi.ClassTransformer.transform.

Invoked when a class is being loaded or redefined.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bytecodeProviderback to summary
private final BytecodeProvider bytecodeProvider
enhancementContextback to summary
private final EnhancementContext enhancementContext
entryReferenceback to summary
private volatile WeakReference<EnhancingClassTransformerImpl.Entry> entryReference
lockback to summary
private final ReentrantLock lock

Constructor Detail

EnhancingClassTransformerImplback to summary
public EnhancingClassTransformerImpl(EnhancementContext enhancementContext)

Method Detail

createEnhancerback to summary
private Enhancer createEnhancer(ClassLoader loader)
discoverTypesback to summary
public void discoverTypes(ClassLoader loader, String className)

Implements org.hibernate.bytecode.spi.ClassTransformer.discoverTypes.

Annotations
@Override
getEnhancerback to summary
private Enhancer getEnhancer(ClassLoader loader)
getEnhancerEntryback to summary
private static EnhancingClassTransformerImpl.Entry getEnhancerEntry(WeakReference<EnhancingClassTransformerImpl.Entry> weakReference, ClassLoader loader)
transformback to summary
public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws TransformerException

Implements jakarta.persistence.spi.ClassTransformer.transform.

Doc from jakarta.persistence.spi.ClassTransformer.transform.

Invoked when a class is being loaded or redefined. The implementation of this method may transform the supplied class file and return a new replacement class file.

Parameters
loader:ClassLoader

the defining loader of the class to be transformed, may be null if the bootstrap loader

className:String

the name of the class in the internal form of fully qualified class and interface names

classBeingRedefined:Class<?>

if this is a redefine, the class being redefined, otherwise null

protectionDomain:ProtectionDomain

the protection domain of the class being defined or redefined

classfileBuffer:byte[]

the input byte buffer in class file format - must not be modified

Returns:byte[]

a well-formed class file buffer (the result of the transform), or null if no transform is performed

Annotations
@Override
Exceptions
TransformerException:
if the input does not represent a well-formed class file
org.hibernate.jpa.internal.enhance back to summary

private Class EnhancingClassTransformerImpl.Entry

extends Object
Class Inheritance
  • java.lang.Object
  • org.hibernate.jpa.internal.enhance.EnhancingClassTransformerImpl.Entry

Field Summary

Modifier and TypeField and Description
pack-priv final ClassLoader
pack-priv final Enhancer

Constructor Summary

AccessConstructor and Description
public
Entry(ClassLoader classLoader, Enhancer enhancer)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

classLoaderback to summary
pack-priv final ClassLoader classLoader
enhancerback to summary
pack-priv final Enhancer enhancer

Constructor Detail

Entryback to summary
public Entry(ClassLoader classLoader, Enhancer enhancer)