I thing I figured it out. I did the following:
| final String beforeMethod = "{long startTime = System.currentTimeMillis();
System.out.println(\"Before Foo\");";
| final String afterMethod = "finally {long diff = System.currentTimeMillis() -
startTime; System.out.println(\"Foo completed in:\" + diff);}}";
|
| mold.instrument(
| new ExprEditor() {
| public void edit(MethodCall m)
| throws CannotCompileException
| {
| m.replace(beforeMethod + " try {$_ = $proceed($$); } " +
afterMethod);
| }
| });
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4176377#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...