public class Transformer extends Object implements ClassFileTransformer
This is used as both a java agent or via Maven and Gradle plugins etc.
| Constructor and Description |
|---|
Transformer(ClassBytesReader bytesReader,
String agentArgs,
AgentManifest manifest)
Create a transformer for entity bean enhancement and transactional method enhancement.
|
Transformer(ClassLoader classLoader,
String agentArgs) |
Transformer(EnhanceContext enhanceContext)
Create with an EnhancementContext (for IDE Plugins mainly)
|
| Modifier and Type | Method and Description |
|---|---|
static void |
agentmain(String agentArgs,
Instrumentation inst) |
static Transformer |
get()
Return the Transformer instance.
|
int |
getLogLevel() |
List<TransactionalMethodKey> |
getTransactionProfilingKeys()
Return the transaction profiling keys.
|
List<CommonSuperUnresolved> |
getUnresolved()
Return the list of unresolved common superclass issues.
|
static Instrumentation |
instrumentation()
Return the Instrumentation instance.
|
void |
log(int level,
String msg) |
static URL[] |
parseClassPaths(String extraClassPath)
Helper method to split semi-colon separated class paths into a URL array.
|
static void |
premain(String agentArgs,
Instrumentation inst) |
void |
setKeepUnresolved()
Set this to keep and report unresolved explicitly.
|
void |
setLogout(MessageOutput logout)
Change the logout to something other than system out.
|
byte[] |
transform(ClassLoader loader,
String className,
Class<?> classBeingRedefined,
ProtectionDomain protectionDomain,
byte[] classfileBuffer) |
static void |
verifyInitialization()
Use agent loader if necessary to initialise the transformer.
|
public Transformer(ClassLoader classLoader, String agentArgs)
public Transformer(EnhanceContext enhanceContext)
public Transformer(ClassBytesReader bytesReader, String agentArgs, AgentManifest manifest)
bytesReader - reads resources from class path for related inheritance and interfacesagentArgs - command line arguments for debug level etcpublic static void agentmain(String agentArgs, Instrumentation inst)
public static void premain(String agentArgs, Instrumentation inst)
public static Instrumentation instrumentation()
public static Transformer get()
public static void verifyInitialization()
public void setKeepUnresolved()
public void setLogout(MessageOutput logout)
public int getLogLevel()
public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException
transform in interface ClassFileTransformerIllegalClassFormatExceptionpublic List<TransactionalMethodKey> getTransactionProfilingKeys()
public List<CommonSuperUnresolved> getUnresolved()
setKeepUnresolved().public static URL[] parseClassPaths(String extraClassPath)
Copyright © 2019. All rights reserved.