peichhorn/lombok-pg — Issue #53: @Weave
Author: nicholas22
Created: 2011-11-20 10:02:41+00:00
State: open
Labels: Feature

It would be great to be able to specify some code to be executed before and/or after a method using code weaving instead of proxying, for performance-aware environments where even slight latencies prohibit the use of proxying techniques to achieve this. Example:

@Weave(MyWeaver.class)
private void sayHello(String arg) {
return "Hello "+arg;
}

The argument in the example is the handler class (e.g. singleton) which would implement pre and post handler methods... They could look like this:

public static void pre(Method method);
public static void post(Method method);

From the method object's properties the client code could deduce the class, method, etc.