What I mean is illustrated by this example:
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
public class Test
{
public static void main(String[] args)
{
final ITest t = new Test2();
ITest tp =
(ITest)Proxy.newProxyInstance(ITest.class.getClassLoader(),
new Class[] { ITest.class }, new InvocationHandler()
{
public Object invoke(Object proxy, Method method,
Object[] args)
throws Throwable
{
System.err.println(method + " of page called!");
return method.invoke(t, args);
}
});
tp.foo();
}
private static interface ITest
{
void foo();
}
private static class Test2 extends Test implements ITest
{
}
public void foo()
{
System.out.println("Hi there");
}
}
Eelco
Eelco Hillenius wrote:
I guess we're back at the taste debate once more. Seems that every
public project has to have this once a month :)
Anyway, Peter to get back to your original problem. You want to be
able to create proxies. You can do that if you want. Even though the
Page class is backed by an interface in it's core, Page (or actually,
you should use WebPage) is designed for inheritance, so you have to
provide your own subclasses for concrete pages anyway. And what is to
stop you from simply extracting the interface you'd like to proxy and
let your (base) class implement that interface?
Eelco
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user