sun.rmi.server.Util Java Examples

The following examples show how to use sun.rmi.server.Util. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DGCClient.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private EndpointEntry(final Endpoint endpoint) {
    this.endpoint = endpoint;
    try {
        LiveRef dgcRef = new LiveRef(dgcID, endpoint, false);
        dgc = (DGC) Util.createProxy(DGCImpl.class,
                                     new UnicastRef(dgcRef), true);
    } catch (RemoteException e) {
        throw new Error("internal error creating DGC stub");
    }
    renewCleanThread =  AccessController.doPrivileged(
        new NewThreadAction(new RenewCleanThread(),
                            "RenewClean-" + endpoint, true));
    renewCleanThread.start();
}
 
Example #2
Source File: DGCImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public Void run() {
    ClassLoader savedCcl =
        Thread.currentThread().getContextClassLoader();
    try {
        Thread.currentThread().setContextClassLoader(
            ClassLoader.getSystemClassLoader());

        /*
         * Put remote collector object in table by hand to prevent
         * listen on port.  (UnicastServerRef.exportObject would
         * cause transport to listen.)
         */
        try {
            dgc = new DGCImpl();
            ObjID dgcID = new ObjID(ObjID.DGC_ID);
            LiveRef ref = new LiveRef(dgcID, 0);
            UnicastServerRef disp = new UnicastServerRef(ref);
            Remote stub =
                Util.createProxy(DGCImpl.class,
                                 new UnicastRef(ref), true);
            disp.setSkeleton(dgc);
            Target target =
                new Target(dgc, disp, stub, dgcID, true);
            ObjectTable.putTarget(target);
        } catch (RemoteException e) {
            throw new Error(
                "exception initializing server-side DGC", e);
        }
    } finally {
        Thread.currentThread().setContextClassLoader(savedCcl);
    }
    return null;
}
 
Example #3
Source File: DGCClient.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private EndpointEntry(final Endpoint endpoint) {
    this.endpoint = endpoint;
    try {
        LiveRef dgcRef = new LiveRef(dgcID, endpoint, false);
        dgc = (DGC) Util.createProxy(DGCImpl.class,
                                     new UnicastRef(dgcRef), true);
    } catch (RemoteException e) {
        throw new Error("internal error creating DGC stub");
    }
    renewCleanThread =  AccessController.doPrivileged(
        new NewThreadAction(new RenewCleanThread(),
                            "RenewClean-" + endpoint, true));
    renewCleanThread.start();
}
 
Example #4
Source File: RemoteObjectInvocationHandler.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
protected Map<Method,Long> computeValue(Class<?> remoteClass) {
    return new WeakHashMap<Method,Long>() {
        public synchronized Long get(Object key) {
            Long hash = super.get(key);
            if (hash == null) {
                Method method = (Method) key;
                hash = Util.computeMethodHash(method);
                put(method, hash);
            }
            return hash;
        }
    };
}
 
Example #5
Source File: DGCClient.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private EndpointEntry(final Endpoint endpoint) {
    this.endpoint = endpoint;
    try {
        LiveRef dgcRef = new LiveRef(dgcID, endpoint, false);
        dgc = (DGC) Util.createProxy(DGCImpl.class,
                                     new UnicastRef(dgcRef), true);
    } catch (RemoteException e) {
        throw new Error("internal error creating DGC stub");
    }
    renewCleanThread =  AccessController.doPrivileged(
        new NewThreadAction(new RenewCleanThread(),
                            "RenewClean-" + endpoint, true));
    renewCleanThread.start();
}
 
Example #6
Source File: RemoteObjectInvocationHandler.java    From jdk-1.7-annotated with Apache License 2.0 5 votes vote down vote up
protected Map<Method,Long> computeValue(Class<?> remoteClass) {
    return new WeakHashMap<Method,Long>() {
        public synchronized Long get(Object key) {
            Long hash = super.get(key);
            if (hash == null) {
                Method method = (Method) key;
                hash = Util.computeMethodHash(method);
                put(method, hash);
            }
            return hash;
        }
    };
}
 
Example #7
Source File: RemoteObjectInvocationHandler.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
protected Map<Method,Long> computeValue(Class<?> remoteClass) {
    return new WeakHashMap<Method,Long>() {
        public synchronized Long get(Object key) {
            Long hash = super.get(key);
            if (hash == null) {
                Method method = (Method) key;
                hash = Util.computeMethodHash(method);
                put(method, hash);
            }
            return hash;
        }
    };
}
 
Example #8
Source File: DGCClient.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private EndpointEntry(final Endpoint endpoint) {
    this.endpoint = endpoint;
    try {
        LiveRef dgcRef = new LiveRef(dgcID, endpoint, false);
        dgc = (DGC) Util.createProxy(DGCImpl.class,
                                     new UnicastRef(dgcRef), true);
    } catch (RemoteException e) {
        throw new Error("internal error creating DGC stub");
    }
    renewCleanThread =  AccessController.doPrivileged(
        new NewThreadAction(new RenewCleanThread(),
                            "RenewClean-" + endpoint, true));
    renewCleanThread.start();
}
 
Example #9
Source File: RemoteObjectInvocationHandler.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
protected Map<Method,Long> computeValue(Class<?> remoteClass) {
    return new WeakHashMap<Method,Long>() {
        public synchronized Long get(Object key) {
            Long hash = super.get(key);
            if (hash == null) {
                Method method = (Method) key;
                hash = Util.computeMethodHash(method);
                put(method, hash);
            }
            return hash;
        }
    };
}
 
Example #10
Source File: DGCImpl.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public Void run() {
    ClassLoader savedCcl =
        Thread.currentThread().getContextClassLoader();
    try {
        Thread.currentThread().setContextClassLoader(
            ClassLoader.getSystemClassLoader());

        /*
         * Put remote collector object in table by hand to prevent
         * listen on port.  (UnicastServerRef.exportObject would
         * cause transport to listen.)
         */
        try {
            dgc = new DGCImpl();
            ObjID dgcID = new ObjID(ObjID.DGC_ID);
            LiveRef ref = new LiveRef(dgcID, 0);
            UnicastServerRef disp = new UnicastServerRef(ref);
            Remote stub =
                Util.createProxy(DGCImpl.class,
                                 new UnicastRef(ref), true);
            disp.setSkeleton(dgc);
            Target target =
                new Target(dgc, disp, stub, dgcID, true);
            ObjectTable.putTarget(target);
        } catch (RemoteException e) {
            throw new Error(
                "exception initializing server-side DGC", e);
        }
    } finally {
        Thread.currentThread().setContextClassLoader(savedCcl);
    }
    return null;
}
 
Example #11
Source File: RemoteObjectInvocationHandler.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
protected Map<Method,Long> computeValue(Class<?> remoteClass) {
    return new WeakHashMap<Method,Long>() {
        public synchronized Long get(Object key) {
            Long hash = super.get(key);
            if (hash == null) {
                Method method = (Method) key;
                hash = Util.computeMethodHash(method);
                put(method, hash);
            }
            return hash;
        }
    };
}
 
Example #12
Source File: DGCClient.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private EndpointEntry(final Endpoint endpoint) {
    this.endpoint = endpoint;
    try {
        LiveRef dgcRef = new LiveRef(dgcID, endpoint, false);
        dgc = (DGC) Util.createProxy(DGCImpl.class,
                                     new UnicastRef(dgcRef), true);
    } catch (RemoteException e) {
        throw new Error("internal error creating DGC stub");
    }
    renewCleanThread =  AccessController.doPrivileged(
        new NewThreadAction(new RenewCleanThread(),
                            "RenewClean-" + endpoint, true));
    renewCleanThread.start();
}
 
Example #13
Source File: DGCClient.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private EndpointEntry(final Endpoint endpoint) {
    this.endpoint = endpoint;
    try {
        LiveRef dgcRef = new LiveRef(dgcID, endpoint, false);
        dgc = (DGC) Util.createProxy(DGCImpl.class,
                                     new UnicastRef(dgcRef), true);
    } catch (RemoteException e) {
        throw new Error("internal error creating DGC stub");
    }
    renewCleanThread =  AccessController.doPrivileged(
        new NewThreadAction(new RenewCleanThread(),
                            "RenewClean-" + endpoint, true));
    renewCleanThread.start();
}
 
Example #14
Source File: RemoteObjectInvocationHandler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected Map<Method,Long> computeValue(Class<?> remoteClass) {
    return new WeakHashMap<Method,Long>() {
        public synchronized Long get(Object key) {
            Long hash = super.get(key);
            if (hash == null) {
                Method method = (Method) key;
                hash = Util.computeMethodHash(method);
                put(method, hash);
            }
            return hash;
        }
    };
}
 
Example #15
Source File: RemoteObjectInvocationHandler.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
protected Map<Method,Long> computeValue(Class<?> remoteClass) {
    return new WeakHashMap<Method,Long>() {
        public synchronized Long get(Object key) {
            Long hash = super.get(key);
            if (hash == null) {
                Method method = (Method) key;
                hash = Util.computeMethodHash(method);
                put(method, hash);
            }
            return hash;
        }
    };
}
 
Example #16
Source File: DGCClient.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private EndpointEntry(final Endpoint endpoint) {
    this.endpoint = endpoint;
    try {
        LiveRef dgcRef = new LiveRef(dgcID, endpoint, false);
        dgc = (DGC) Util.createProxy(DGCImpl.class,
                                     new UnicastRef(dgcRef), true);
    } catch (RemoteException e) {
        throw new Error("internal error creating DGC stub");
    }
    renewCleanThread =  AccessController.doPrivileged(
        new NewThreadAction(new RenewCleanThread(),
                            "RenewClean-" + endpoint, true));
    renewCleanThread.start();
}
 
Example #17
Source File: RemoteObjectInvocationHandler.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
protected Map<Method,Long> computeValue(Class<?> remoteClass) {
    return new WeakHashMap<Method,Long>() {
        public synchronized Long get(Object key) {
            Long hash = super.get(key);
            if (hash == null) {
                Method method = (Method) key;
                hash = Util.computeMethodHash(method);
                put(method, hash);
            }
            return hash;
        }
    };
}
 
Example #18
Source File: DGCClient.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private EndpointEntry(final Endpoint endpoint) {
    this.endpoint = endpoint;
    try {
        LiveRef dgcRef = new LiveRef(dgcID, endpoint, false);
        dgc = (DGC) Util.createProxy(DGCImpl.class,
                                     new UnicastRef(dgcRef), true);
    } catch (RemoteException e) {
        throw new Error("internal error creating DGC stub");
    }
    renewCleanThread =  AccessController.doPrivileged(
        new NewThreadAction(new RenewCleanThread(),
                            "RenewClean-" + endpoint, true));
    renewCleanThread.start();
}
 
Example #19
Source File: DGCImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public Void run() {
    ClassLoader savedCcl =
        Thread.currentThread().getContextClassLoader();
    try {
        Thread.currentThread().setContextClassLoader(
            ClassLoader.getSystemClassLoader());

        /*
         * Put remote collector object in table by hand to prevent
         * listen on port.  (UnicastServerRef.exportObject would
         * cause transport to listen.)
         */
        try {
            dgc = new DGCImpl();
            ObjID dgcID = new ObjID(ObjID.DGC_ID);
            LiveRef ref = new LiveRef(dgcID, 0);
            UnicastServerRef disp = new UnicastServerRef(ref);
            Remote stub =
                Util.createProxy(DGCImpl.class,
                                 new UnicastRef(ref), true);
            disp.setSkeleton(dgc);
            Target target =
                new Target(dgc, disp, stub, dgcID, true);
            ObjectTable.putTarget(target);
        } catch (RemoteException e) {
            throw new Error(
                "exception initializing server-side DGC", e);
        }
    } finally {
        Thread.currentThread().setContextClassLoader(savedCcl);
    }
    return null;
}
 
Example #20
Source File: DGCClient.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private EndpointEntry(final Endpoint endpoint) {
    this.endpoint = endpoint;
    try {
        LiveRef dgcRef = new LiveRef(dgcID, endpoint, false);
        dgc = (DGC) Util.createProxy(DGCImpl.class,
                                     new UnicastRef(dgcRef), true);
    } catch (RemoteException e) {
        throw new Error("internal error creating DGC stub");
    }
    renewCleanThread =  AccessController.doPrivileged(
        new NewThreadAction(new RenewCleanThread(),
                            "RenewClean-" + endpoint, true));
    renewCleanThread.start();
}
 
Example #21
Source File: RemoteObjectInvocationHandler.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
protected Map<Method,Long> computeValue(Class<?> remoteClass) {
    return new WeakHashMap<Method,Long>() {
        public synchronized Long get(Object key) {
            Long hash = super.get(key);
            if (hash == null) {
                Method method = (Method) key;
                hash = Util.computeMethodHash(method);
                put(method, hash);
            }
            return hash;
        }
    };
}
 
Example #22
Source File: RemoteObjectInvocationHandler.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
protected Map<Method,Long> computeValue(Class<?> remoteClass) {
    return new WeakHashMap<Method,Long>() {
        public synchronized Long get(Object key) {
            Long hash = super.get(key);
            if (hash == null) {
                Method method = (Method) key;
                hash = Util.computeMethodHash(method);
                put(method, hash);
            }
            return hash;
        }
    };
}
 
Example #23
Source File: RemoteObjectInvocationHandler.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
protected Map<Method,Long> computeValue(Class<?> remoteClass) {
    return new WeakHashMap<Method,Long>() {
        public synchronized Long get(Object key) {
            Long hash = super.get(key);
            if (hash == null) {
                Method method = (Method) key;
                hash = Util.computeMethodHash(method);
                put(method, hash);
            }
            return hash;
        }
    };
}
 
Example #24
Source File: DGCClient.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private EndpointEntry(final Endpoint endpoint) {
    this.endpoint = endpoint;
    try {
        LiveRef dgcRef = new LiveRef(dgcID, endpoint, false);
        dgc = (DGC) Util.createProxy(DGCImpl.class,
                                     new UnicastRef(dgcRef), true);
    } catch (RemoteException e) {
        throw new Error("internal error creating DGC stub");
    }
    renewCleanThread =  AccessController.doPrivileged(
        new NewThreadAction(new RenewCleanThread(),
                            "RenewClean-" + endpoint, true));
    renewCleanThread.start();
}
 
Example #25
Source File: RemoteObjectInvocationHandler.java    From Java8CN with Apache License 2.0 5 votes vote down vote up
protected Map<Method,Long> computeValue(Class<?> remoteClass) {
    return new WeakHashMap<Method,Long>() {
        public synchronized Long get(Object key) {
            Long hash = super.get(key);
            if (hash == null) {
                Method method = (Method) key;
                hash = Util.computeMethodHash(method);
                put(method, hash);
            }
            return hash;
        }
    };
}
 
Example #26
Source File: DGCClient.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private EndpointEntry(final Endpoint endpoint) {
    this.endpoint = endpoint;
    try {
        LiveRef dgcRef = new LiveRef(dgcID, endpoint, false);
        dgc = (DGC) Util.createProxy(DGCImpl.class,
                                     new UnicastRef(dgcRef), true);
    } catch (RemoteException e) {
        throw new Error("internal error creating DGC stub");
    }
    renewCleanThread =  AccessController.doPrivileged(
        new NewThreadAction(new RenewCleanThread(),
                            "RenewClean-" + endpoint, true));
    renewCleanThread.start();
}
 
Example #27
Source File: DGCImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public Void run() {
    ClassLoader savedCcl =
        Thread.currentThread().getContextClassLoader();
    try {
        Thread.currentThread().setContextClassLoader(
            ClassLoader.getSystemClassLoader());

        /*
         * Put remote collector object in table by hand to prevent
         * listen on port.  (UnicastServerRef.exportObject would
         * cause transport to listen.)
         */
        try {
            dgc = new DGCImpl();
            ObjID dgcID = new ObjID(ObjID.DGC_ID);
            LiveRef ref = new LiveRef(dgcID, 0);
            UnicastServerRef disp = new UnicastServerRef(ref);
            Remote stub =
                Util.createProxy(DGCImpl.class,
                                 new UnicastRef(ref), true);
            disp.setSkeleton(dgc);
            Target target =
                new Target(dgc, disp, stub, dgcID, true);
            ObjectTable.putTarget(target);
        } catch (RemoteException e) {
            throw new Error(
                "exception initializing server-side DGC", e);
        }
    } finally {
        Thread.currentThread().setContextClassLoader(savedCcl);
    }
    return null;
}
 
Example #28
Source File: RemoteObjectInvocationHandler.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
protected Map<Method,Long> computeValue(Class<?> remoteClass) {
    return new WeakHashMap<Method,Long>() {
        public synchronized Long get(Object key) {
            Long hash = super.get(key);
            if (hash == null) {
                Method method = (Method) key;
                hash = Util.computeMethodHash(method);
                put(method, hash);
            }
            return hash;
        }
    };
}
 
Example #29
Source File: RemoteObjectInvocationHandler.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
protected Map<Method,Long> computeValue(Class<?> remoteClass) {
    return new WeakHashMap<Method,Long>() {
        public synchronized Long get(Object key) {
            Long hash = super.get(key);
            if (hash == null) {
                Method method = (Method) key;
                hash = Util.computeMethodHash(method);
                put(method, hash);
            }
            return hash;
        }
    };
}
 
Example #30
Source File: DGCClient.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private EndpointEntry(final Endpoint endpoint) {
    this.endpoint = endpoint;
    try {
        LiveRef dgcRef = new LiveRef(dgcID, endpoint, false);
        dgc = (DGC) Util.createProxy(DGCImpl.class,
                                     new UnicastRef(dgcRef), true);
    } catch (RemoteException e) {
        throw new Error("internal error creating DGC stub");
    }
    renewCleanThread =  AccessController.doPrivileged(
        new NewThreadAction(new RenewCleanThread(),
                            "RenewClean-" + endpoint, true));
    renewCleanThread.start();
}