org.hibernate.bytecode.enhance.spi.Enhancer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-core Show documentation
Show all versions of hibernate-core Show documentation
Hibernate's core ORM functionality
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or .
*/
package org.hibernate.bytecode.enhance.spi;
/**
* Class responsible for performing enhancement.
*
* @author Steve Ebersole
* @author Jason Greene
* @author Luis Barreiro
*/
public interface Enhancer {
/**
* Performs the enhancement.
*
* It is possible to invoke this method concurrently, but when doing so make sure
* no two enhancement tasks are invoked on the same class in parallel: the
* Enhancer implementations are not required to guard against this.
*
* @param className The name of the class whose bytecode is being enhanced.
* @param originalBytes The class's original (pre-enhancement) byte code
*
* @return The enhanced bytecode. If the original bytes are not enhanced, null is returned.
*
* @throws EnhancementException Indicates a problem performing the enhancement
*/
byte[] enhance(String className, byte[] originalBytes) throws EnhancementException;
}