No. It's not clear exactly what you're trying to achieve, so it's hard to 
suggest an alternative. You have almost no reflection available in GWT - almost 
the only thing you can do is to ask a class for its name. So passing an 
interface as a parameter is not generally useful.

Paul

On 08/06/11 12:32, Michał Jabłoński wrote:
Hi!

It is possible to create dynamic proxy in gwt? I want create library
which changes behaviour of methods of some class (interface will be
parameter), for example, when user call method of class implementing
interface, it will return always String "abc". In java it would be
something like this:

public class proxyHandler implements InvocationHandler {
        private Object proxied;

        public proxyHandler(Object proxied) {
                this.proxied = proxied;
        }

        public Object invoke(Object proxy, Method method, Object[] args)
                        throws Throwable {
                return "abc";
        }
}
..
        public static void main(String[] args) {
                Object object = new Object();
            Interface proxy = (Interface)Proxy.newProxyInstance(
              Interface.class.getClassLoader(),
              new Class[]{ Interface.class },
              new proxyHandler(object));
            System.out.println(proxy.getName());
}

It is possible to do something like this in gwt (using deferred
binding, whatever)? Thanks for any help


--
You received this message because you are subscribed to the Google Groups "Google 
Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to