src/share/classes/sun/rmi/server/Util.java
Print this page
*** 46,55 ****
--- 46,56 ----
import java.rmi.server.SkeletonNotFoundException;
import java.security.AccessController;
import java.security.MessageDigest;
import java.security.DigestOutputStream;
import java.security.NoSuchAlgorithmException;
+ import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Map;
import java.util.WeakHashMap;
import sun.rmi.registry.RegistryImpl;
*** 138,158 ****
!(ignoreStubClasses || !stubClassExists(remoteClass)))
{
return createStub(remoteClass, clientRef);
}
! ClassLoader loader = implClass.getClassLoader();
! Class[] interfaces = getRemoteInterfaces(implClass);
! InvocationHandler handler =
new RemoteObjectInvocationHandler(clientRef);
/* REMIND: private remote interfaces? */
try {
return (Remote) Proxy.newProxyInstance(loader,
interfaces,
handler);
} catch (IllegalArgumentException e) {
throw new StubNotFoundException("unable to create proxy", e);
}
}
--- 139,162 ----
!(ignoreStubClasses || !stubClassExists(remoteClass)))
{
return createStub(remoteClass, clientRef);
}
! final ClassLoader loader = implClass.getClassLoader();
! final Class[] interfaces = getRemoteInterfaces(implClass);
! final InvocationHandler handler =
new RemoteObjectInvocationHandler(clientRef);
/* REMIND: private remote interfaces? */
try {
+ return AccessController.doPrivileged(new PrivilegedAction<Remote>() {
+ public Remote run() {
return (Remote) Proxy.newProxyInstance(loader,
interfaces,
handler);
+ }});
} catch (IllegalArgumentException e) {
throw new StubNotFoundException("unable to create proxy", e);
}
}