basic java agent implementation. taken from http://blog.javabenchmark.org/2013/05/java-instrumentation-tutorial.html