Package io.ebean.enhance
Class Transformer
java.lang.Object
io.ebean.enhance.Transformer
- All Implemented Interfaces:
ClassFileTransformer
public class Transformer extends Object implements ClassFileTransformer
A Class file Transformer that performs Ebean enhancement of entity beans,
transactional methods and query bean enhancement.
This is used as both a java agent or via Maven and Gradle plugins etc.
-
Field Summary
Fields Modifier and Type Field Description static intEBEAN_ASM_VERSION -
Constructor Summary
Constructors Constructor Description Transformer(ClassBytesReader bytesReader, String agentArgs, AgentManifest manifest)Create a transformer for entity bean enhancement and transactional method enhancement.Transformer(EnhanceContext enhanceContext)Create with an EnhancementContext (for IDE Plugins mainly)Transformer(ClassLoader classLoader, String agentArgs) -
Method Summary
Modifier and Type Method Description static voidagentmain(String agentArgs, Instrumentation inst)static Transformerget()Return the Transformer instance.EnhanceContextgetEnhanceContext()intgetLogLevel()List<CommonSuperUnresolved>getUnresolved()Return the list of unresolved common superclass issues.static StringgetVersion()Return the version of the ebean-agent or "unknown" if the version can not be determined.static Instrumentationinstrumentation()Return the Instrumentation instance.voidlog(int level, String msg)static URL[]parseClassPaths(String extraClassPath)Helper method to split semi-colon separated class paths into a URL array.static voidpremain(String agentArgs, Instrumentation inst)voidsetKeepUnresolved()Set this to keep and report unresolved explicitly.voidsetLogout(MessageOutput logout)Change the logout to something other than system out.byte[]transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer)static voidverifyInitialization()Use agent loader if necessary to initialise the transformer.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.instrument.ClassFileTransformer
transform
-
Field Details
-
EBEAN_ASM_VERSION
- See Also:
- Constant Field Values
-
-
Constructor Details
-
Transformer
-
Transformer
Create with an EnhancementContext (for IDE Plugins mainly) -
Transformer
Create a transformer for entity bean enhancement and transactional method enhancement.- Parameters:
bytesReader- reads resources from class path for related inheritance and interfacesagentArgs- command line arguments for debug level etc
-
-
Method Details
-
getVersion
Return the version of the ebean-agent or "unknown" if the version can not be determined. -
agentmain
-
premain
-
instrumentation
Return the Instrumentation instance. -
get
Return the Transformer instance. -
verifyInitialization
Use agent loader if necessary to initialise the transformer. -
setKeepUnresolved
Set this to keep and report unresolved explicitly. -
setLogout
Change the logout to something other than system out. -
log
-
getLogLevel
-
getEnhanceContext
-
transform
public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException- Specified by:
transformin interfaceClassFileTransformer- Throws:
IllegalClassFormatException
-
getUnresolved
Return the list of unresolved common superclass issues. This should be cleared after each use and can only be used withsetKeepUnresolved(). -
parseClassPaths
Helper method to split semi-colon separated class paths into a URL array.
-