On 2010-06-04 16.56, Philippe Van Dyck wrote:
Rickard,
Would it be possible to raise an exception when a direct call is made
(not going through the proxy) ?
But if we're going to raise an exception, why not simply route the call
instead?
I'm looking into solving this problem right now, and the idea I have is
this: I'll overload all public methods that are implemented in an
interface. When they are called the invocation is routed to the
composite invoke() method. Then, when the invocation chain is done it
will invoke a substitute method (e.g. call "foo" and I'll add a "_foo"
method), which does this:
public void _foo(String bar)
{
super.foo(bar); // This is to avoid an infinite loop if Qi4j calls
foo() straight away.
}
It's a bit messy though, and doing the method substitution is
non-trivial. It would be great if it was possible to do something like
method.getSuperMethod().invoke(), but there's no such thing. CGLIB
managed to hack it somehow, and I'm guessing they're doing something
similar to the above to make it work.
/Rickard
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev