@HashCodeAndEqualsPlugin.Enhance public static class AgentBuilder.InstallationListener.StreamWriting extends java.lang.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 java.lang.String |
PREFIX
The prefix prepended to any message written.
|
private java.io.PrintStream |
printStream
The print stream to write to.
|
SUPPRESS_ERROR
Constructor and Description |
---|
StreamWriting(java.io.PrintStream printStream)
Creates a new stream writing installation listener.
|
Modifier and Type | Method and Description |
---|---|
void |
onBeforeInstall(java.lang.instrument.Instrumentation instrumentation,
ResettableClassFileTransformer classFileTransformer)
Invoked prior to the installation of a class file transformer.
|
java.lang.Throwable |
onError(java.lang.instrument.Instrumentation instrumentation,
ResettableClassFileTransformer classFileTransformer,
java.lang.Throwable throwable)
Invoked if an installation causes an error.
|
void |
onInstall(java.lang.instrument.Instrumentation instrumentation,
ResettableClassFileTransformer classFileTransformer)
Invoked upon the successful installation of a class file transformer.
|
void |
onReset(java.lang.instrument.Instrumentation instrumentation,
ResettableClassFileTransformer classFileTransformer)
Invoked if an installation is reset.
|
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 java.lang.String PREFIX
private final java.io.PrintStream printStream
public StreamWriting(java.io.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(java.lang.instrument.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(java.lang.instrument.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 java.lang.Throwable onError(java.lang.instrument.Instrumentation instrumentation, ResettableClassFileTransformer classFileTransformer, java.lang.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(java.lang.instrument.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.