-
Notifications
You must be signed in to change notification settings - Fork 44
Application JVMAgent
peichhorn edited this page Jun 30, 2012
·
1 revision
(Documentation pending)
import lombok.Application;
import lombok.JvmAgent;
public class ApplicationExample implements Application {
public void runApp(final String[] args) {
// something
}
}
public class JVMAgentExample implements JVMAgent {
public void runAgent(boolean injected, String params, Instrumentation instrumentation) {
// something
}
}
public class ApplicationExample {
public void runApp(final String[] args) {
// something
}
public static void main(final String[] args) throws Throwable {
new ApplicationExample().runApp(args);
}
}
public class JVMAgentExample {
public void runAgent(boolean injected, String params, Instrumentation instrumentation) {
// something
}
public static void agentmain(final String params, final Instrumentation instrumentation) throws Throwable {
new JVMAgentExample().runAgent(true, params, instrumentation);
}
public static void premain(final String params, final Instrumentation instrumentation) throws Throwable {
new JVMAgentExample().runAgent(false, params, instrumentation);
}
}
(Documentation pending)
Nothing to configure yet.
I am not able to run @Action. If I provide Action1 implementation it works.
implementation private static Action1 println() { return new Action1() { public void apply(final Object o) { System.out.println(o); } };
pom : com.github.peichhorn lombok-pg 0.11.3
<dependency>
<groupId>com.github.peichhorn</groupId>
<artifactId>lombok-pg</artifactId>
<version>0.11.3</version>
<classifier>runtime</classifier>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.24</version>
<scope>provided</scope>
</dependency>