Created
March 12, 2013 22:56
-
-
Save mikebrock/5147866 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @CodeDecorator | |
| public class LogCallDecorator extends IOCDecoratorExtension<LogCall> { | |
| public LogCallDecorator(Class<LogCall> decoratesWith) { | |
| super(decoratesWith); | |
| } | |
| @Override | |
| public List<? extends Statement> generateDecorator(InjectableInstance<LogCall> ctx) { | |
| ctx.getInjector().addInvokeBefore(ctx.getMethod(), | |
| Stmt.invokeStatic(TestDataCollector.class, "beforeInvoke", Refs.get("a0"), Refs.get("a1"))); | |
| ctx.getInjector().addInvokeAfter(ctx.getMethod(), | |
| Stmt.invokeStatic(TestDataCollector.class, "afterInvoke", Refs.get("a0"), Refs.get("a1"))); | |
| return Collections.emptyList(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment