/** * Converts a proxy object to an object that is writable to an * object stream. This method is called by <code>writeReplace()</code> * in a proxy class. * * @since 3.4 */ public static SerializedProxy makeSerializedProxy(Object proxy) throws java.io.InvalidClassException { Class clazz = proxy.getClass(); MethodHandler methodHandler = null; if (proxy instanceof ProxyObject) methodHandler = ((ProxyObject)proxy).getHandler(); else if (proxy instanceof Proxy) methodHandler = ProxyFactory.getHandler((Proxy)proxy); return new SerializedProxy(clazz, ProxyFactory.getFilterSignature(clazz), methodHandler); } }
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); Proxy proxy = (Proxy)f.createClass(filterSignature).newInstance(); proxy.setHandler(handler); return proxy; } 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()); } } }
/** * Converts a proxy object to an object that is writable to an * object stream. This method is called by <code>writeReplace()</code> * in a proxy class. * * @since 3.4 */ public static SerializedProxy makeSerializedProxy(Object proxy) throws java.io.InvalidClassException { Class<?> clazz = proxy.getClass(); MethodHandler methodHandler = null; if (proxy instanceof ProxyObject) methodHandler = ((ProxyObject)proxy).getHandler(); else if (proxy instanceof Proxy) methodHandler = ProxyFactory.getHandler((Proxy)proxy); return new SerializedProxy(clazz, ProxyFactory.getFilterSignature(clazz), methodHandler); } }
/** * Converts a proxy object to an object that is writable to an * object stream. This method is called by <code>writeReplace()</code> * in a proxy class. * * @since 3.4 */ public static SerializedProxy makeSerializedProxy(Object proxy) throws java.io.InvalidClassException { Class clazz = proxy.getClass(); return new SerializedProxy(clazz, ProxyFactory.getFilter(clazz), ProxyFactory.getHandler(clazz)); } }
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); Proxy proxy = (Proxy)f.createClass(filterSignature).newInstance(); proxy.setHandler(handler); return proxy; } 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()); } } }
/** * Converts a proxy object to an object that is writable to an * object stream. This method is called by <code>writeReplace()</code> * in a proxy class. * * @since 3.4 */ public static SerializedProxy makeSerializedProxy(Object proxy) throws java.io.InvalidClassException { Class clazz = proxy.getClass(); MethodHandler methodHandler = null; if (proxy instanceof ProxyObject) methodHandler = ((ProxyObject)proxy).getHandler(); return new SerializedProxy(clazz, ProxyFactory.getFilterSignature(clazz), methodHandler); } }
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); Proxy proxy = (Proxy)f.createClass(filterSignature).newInstance(); proxy.setHandler(handler); return proxy; } 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()); } } }
/** * Converts a proxy object to an object that is writable to an * object stream. This method is called by <code>writeReplace()</code> * in a proxy class. * * @since 3.4 */ public static SerializedProxy makeSerializedProxy(Object proxy) throws java.io.InvalidClassException { Class clazz = proxy.getClass(); MethodHandler methodHandler = null; if (proxy instanceof ProxyObject) methodHandler = ((ProxyObject)proxy).getHandler(); else if (proxy instanceof Proxy) methodHandler = ProxyFactory.getHandler((Proxy)proxy); return new SerializedProxy(clazz, ProxyFactory.getFilterSignature(clazz), methodHandler); } }
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); ProxyObject proxy = (ProxyObject)f.createClass(filterSignature).newInstance(); proxy.setHandler(handler); return proxy; } 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()); } } }
/** * Converts a proxy object to an object that is writable to an * object stream. This method is called by <code>writeReplace()</code> * in a proxy class. * * @since 3.4 */ public static SerializedProxy makeSerializedProxy(Object proxy) throws java.io.InvalidClassException { Class clazz = proxy.getClass(); MethodHandler methodHandler = null; if (proxy instanceof ProxyObject) methodHandler = ((ProxyObject)proxy).getHandler(); else if (proxy instanceof Proxy) methodHandler = ProxyFactory.getHandler((Proxy)proxy); return new SerializedProxy(clazz, ProxyFactory.getFilterSignature(clazz), methodHandler); } }
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); Proxy proxy = (Proxy)f.createClass(filterSignature).newInstance(); proxy.setHandler(handler); return proxy; } 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()); } } }
/** * Converts a proxy object to an object that is writable to an * object stream. This method is called by <code>writeReplace()</code> * in a proxy class. * * @since 3.4 */ public static SerializedProxy makeSerializedProxy(Object proxy) throws java.io.InvalidClassException { Class clazz = proxy.getClass(); MethodHandler methodHandler = null; if (proxy instanceof ProxyObject) methodHandler = ((ProxyObject)proxy).getHandler(); else if (proxy instanceof Proxy) methodHandler = ProxyFactory.getHandler((Proxy)proxy); return new SerializedProxy(clazz, ProxyFactory.getFilterSignature(clazz), methodHandler); } }