public class Transformer extends Object implements ClassFileTransformer
This is used as both a javaagent or via an ANT task (or other off line approach).
| Constructor and Description |
|---|
Transformer(ClassBytesReader bytesReader,
String agentArgs,
Set<String> packages)
Create a transformer for entity bean enhancement and transactional method enhancement.
|
Transformer(String extraClassPath,
String agentArgs) |
Transformer(URL[] extraClassPath,
String agentArgs)
Create a transformer for entity bean enhancement and transactional method enhancement.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
agentmain(String agentArgs,
Instrumentation inst) |
int |
getLogLevel() |
Map<String,List<Throwable>> |
getUnexpectedExceptions()
Return a map of exceptions keyed by className.
|
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 |
setLogout(MessageOutput logout)
Change the logout to something other than system out.
|
byte[] |
transform(ClassLoader loader,
String className,
Class<?> classBeingRedefined,
ProtectionDomain protectionDomain,
byte[] classfileBuffer) |
public Transformer(URL[] extraClassPath, String agentArgs)
public Transformer(ClassBytesReader bytesReader, String agentArgs, Set<String> packages)
bytesReader - reads resources from class path for related inheritance and interfacesagentArgs - command line arguments for debug level etcpackages - limit enhancement to specified packagespublic static void premain(String agentArgs, Instrumentation inst)
public static void agentmain(String agentArgs, Instrumentation inst) throws Exception
Exceptionpublic Map<String,List<Throwable>> getUnexpectedExceptions()
These exceptions were thrown/caught as part of the transformation process.
public void setLogout(MessageOutput logout)
public void log(int level,
String msg)
public int getLogLevel()
public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException
transform in interface ClassFileTransformerIllegalClassFormatExceptionCopyright © 2016. All rights reserved.