563 lines · 20.4 KB · Java
RawDownload
        return new UnicastRef(ref);    }     /**     * Write out external representation for remote ref.     */    public void writeExternal(ObjectOutput out) throws IOException {    }     /**     * Read in external representation for remote ref.     * @exception ClassNotFoundException If the class for an object     * being restored cannot be found.     */    public void readExternal(ObjectInput in)        throws IOException, ClassNotFoundException    {        // object is re-exported elsewhere (e.g., by UnicastRemoteObject)        ref = null;        skel = null;    }      /**     * A weak hash map, mapping classes to hash maps that map method     * hashes to method objects.     **/    private static class HashToMethod_Maps        extends WeakClassHashMap<Map<Long,Method>>    {        HashToMethod_Maps() {}         protected Map<Long,Method> computeValue(Class<?> remoteClass) {            Map<Long,Method> map = new HashMap<Long,Method>();            for (Class<?> cl = remoteClass;                 cl != null;                 cl = cl.getSuperclass())            {                for (Class<?> intf : cl.getInterfaces()) {                    if (Remote.class.isAssignableFrom(intf)) {                        for (Method method : intf.getMethods()) {                            final Method m = method;                            /*                             * Set this Method object to override language                             * access checks so that the dispatcher can invoke                             * methods from non-public remote interfaces.                             */                            AccessController.doPrivileged(                                new PrivilegedAction<Void>() {                                public Void run() {                                    m.setAccessible(true);                                    return null;                                }                            });                            map.put(Util.computeMethodHash(m), m);                        }                    }                }            }            return map;        }    }}

Lines 501–563 of 563. Previous lines