Object readResolve() throws ObjectStreamException {
        try {
            int n = interfaces.length;
            Class[] infs = new Class[n];
            for (int i = 0; i < n; i++)
                infs[i] = loadClass(interfaces[i]);

            ProxyFactory f = new ProxyFactory();
            f.setSuperclass(loadClass(superClass));
            f.setInterfaces(infs);
            f.setFilter(filter);
            f.setHandler(handler);
            return f.createClass().newInstance();
        }
        catch (ClassNotFoundException e) {
            throw new java.io.InvalidClassException(e.getMessage());
        }
        catch (InstantiationException e2) {
            throw new java.io.InvalidObjectException(e2.getMessage());
        }
        catch (IllegalAccessException e3) {
            throw new java.io.InvalidClassException(e3.getMessage());
        }
    }