AspectJを使用したワームホールパターンの実装例を探しています(Guice AOPにこれを実装する権限がある場合は興味があります)。
ワームホールを使用すると、基本的に、次のような追加のパラメータをコールフローに沿って渡すことができます。
// say we have
class foo {
public int m0 int a, int b) {
return m1(a,b);
}
public int m1 int a, int b) {
return m2(a,b);
}
public int m2 int a, int b) {
return a+b;
}
}
// and I wanted in a non-invasive manner to pass a third parameter of type
class context {
String userName;
long timeCalled;
String path;
}
// I could use an advise to say print the context information
// to trace what was going on without mucking up my method signatures
このラムニヴァス・ラダッドは、彼の著書AspectJinActionにそのような例があると思います。
前もって感謝します。