@HashCodeAndEqualsPlugin.Enhance public static class AgentBuilder.InstallationListener.StreamWriting extends Object implements AgentBuilder.InstallationListener
PrintStream
.AgentBuilder.InstallationListener.Adapter, AgentBuilder.InstallationListener.Compound, AgentBuilder.InstallationListener.ErrorSuppressing, AgentBuilder.InstallationListener.NoOp, AgentBuilder.InstallationListener.StreamWriting
Modifier and Type | Field and Description |
---|---|
protected static String |
PREFIX
The prefix prepended to any message written.
|
SUPPRESS_ERROR
Constructor and Description |
---|
StreamWriting(PrintStream printStream)
Creates a new stream writing installation listener.
|
Modifier and Type | Method and Description |
---|---|
void |
onAfterWarmUp(Map<Class<?>,byte[]> types,
ResettableClassFileTransformer classFileTransformer,
boolean transformed)
Invoked after a warump is executed.
|
void |
onBeforeInstall(Instrumentation instrumentation,
ResettableClassFileTransformer classFileTransformer)
Invoked prior to the installation of a class file transformer.
|
void |
onBeforeWarmUp(Set<Class<?>> types,
ResettableClassFileTransformer classFileTransformer)
Invoked before a warump is executed.
|
Throwable |
onError(Instrumentation instrumentation,
ResettableClassFileTransformer classFileTransformer,
Throwable throwable)
Invoked if an installation causes an error.
|
void |
onInstall(Instrumentation instrumentation,
ResettableClassFileTransformer classFileTransformer)
Invoked upon the successful installation of a class file transformer.
|
void |
onReset(Instrumentation instrumentation,
ResettableClassFileTransformer classFileTransformer)
Invoked if an installation is reset.
|
void |
onWarmUpError(Class<?> type,
ResettableClassFileTransformer classFileTransformer,
Throwable throwable)
Invoked when a class yields an unexpected error that is not catched by the listener.
|
static AgentBuilder.InstallationListener |
toSystemError()
Creates a stream writing installation listener that prints to
System.err . |
static AgentBuilder.InstallationListener |
toSystemOut()
Creates a stream writing installation listener that prints to
System.out . |
protected static final String PREFIX
public StreamWriting(PrintStream printStream)
printStream
- The print stream to write to.public static AgentBuilder.InstallationListener toSystemOut()
System.out
.System.out
.public static AgentBuilder.InstallationListener toSystemError()
System.err
.System.err
.public void onBeforeInstall(Instrumentation instrumentation, ResettableClassFileTransformer classFileTransformer)
onBeforeInstall
in interface AgentBuilder.InstallationListener
instrumentation
- The instrumentation on which the class file transformer is installed.classFileTransformer
- The class file transformer that is being installed.public void onInstall(Instrumentation instrumentation, ResettableClassFileTransformer classFileTransformer)
AgentBuilder.InstallationListener.onError(Instrumentation, ResettableClassFileTransformer, Throwable)
.onInstall
in interface AgentBuilder.InstallationListener
instrumentation
- The instrumentation on which the class file transformer is installed.classFileTransformer
- The class file transformer that is being installed.public Throwable onError(Instrumentation instrumentation, ResettableClassFileTransformer classFileTransformer, Throwable throwable)
AgentBuilder.InstallationListener.onInstall(Instrumentation, ResettableClassFileTransformer)
.onError
in interface AgentBuilder.InstallationListener
instrumentation
- The instrumentation on which the class file transformer is installed.classFileTransformer
- The class file transformer that is being installed.throwable
- The throwable that causes the error.null
if the error is handled. Any subsequent listeners are not called if the exception is handled.public void onReset(Instrumentation instrumentation, ResettableClassFileTransformer classFileTransformer)
onReset
in interface AgentBuilder.InstallationListener
instrumentation
- The instrumentation on which the class file transformer is installed.classFileTransformer
- The class file transformer that is being installed.public void onBeforeWarmUp(Set<Class<?>> types, ResettableClassFileTransformer classFileTransformer)
onBeforeWarmUp
in interface AgentBuilder.InstallationListener
types
- The types that are used for the warmup.classFileTransformer
- The class file transformer that is warmed up.public void onWarmUpError(Class<?> type, ResettableClassFileTransformer classFileTransformer, Throwable throwable)
onWarmUpError
in interface AgentBuilder.InstallationListener
type
- The type that caused the error.classFileTransformer
- The class file transformer that is warmed up.throwable
- The throwable that represents the error.public void onAfterWarmUp(Map<Class<?>,byte[]> types, ResettableClassFileTransformer classFileTransformer, boolean transformed)
onAfterWarmUp
in interface AgentBuilder.InstallationListener
types
- The types that are used for the warmup mapped to their transformed byte code
or null
if the type was not transformed or failed to transform.classFileTransformer
- The class file transformer that is warmed up.transformed
- true
if at least one class caused an actual transformation.Copyright © 2014–1970. All rights reserved.