Merge
This commit is contained in:
commit
e041f4aadd
@ -176,42 +176,9 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
|
|||||||
staticWrapper = ORBUtilSystemException.get(
|
staticWrapper = ORBUtilSystemException.get(
|
||||||
CORBALogDomains.RPC_PRESENTATION ) ;
|
CORBALogDomains.RPC_PRESENTATION ) ;
|
||||||
|
|
||||||
boolean useDynamicStub =
|
boolean useDynamicStub = false;
|
||||||
((Boolean)AccessController.doPrivileged(
|
|
||||||
new PrivilegedAction() {
|
|
||||||
public java.lang.Object run() {
|
|
||||||
return Boolean.valueOf( Boolean.getBoolean (
|
|
||||||
ORBConstants.USE_DYNAMIC_STUB_PROPERTY ) ) ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)).booleanValue() ;
|
|
||||||
|
|
||||||
PresentationManager.StubFactoryFactory dynamicStubFactoryFactory =
|
PresentationManager.StubFactoryFactory dynamicStubFactoryFactory = null;
|
||||||
(PresentationManager.StubFactoryFactory)AccessController.doPrivileged(
|
|
||||||
new PrivilegedAction() {
|
|
||||||
public java.lang.Object run() {
|
|
||||||
PresentationManager.StubFactoryFactory sff =
|
|
||||||
PresentationDefaults.getProxyStubFactoryFactory() ;
|
|
||||||
|
|
||||||
String className = System.getProperty(
|
|
||||||
ORBConstants.DYNAMIC_STUB_FACTORY_FACTORY_CLASS,
|
|
||||||
"com.sun.corba.se.impl.presentation.rmi.bcel.StubFactoryFactoryBCELImpl" ) ;
|
|
||||||
|
|
||||||
try {
|
|
||||||
// First try the configured class name, if any
|
|
||||||
Class<?> cls =
|
|
||||||
sun.corba.SharedSecrets.getJavaCorbaAccess().loadClass(className);
|
|
||||||
sff = (PresentationManager.StubFactoryFactory)cls.newInstance();
|
|
||||||
} catch (Exception exc) {
|
|
||||||
// Use the default. Log the error as a warning.
|
|
||||||
staticWrapper.errorInSettingDynamicStubFactoryFactory(
|
|
||||||
exc, className ) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
return sff ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
) ;
|
|
||||||
|
|
||||||
PresentationManager pm = new PresentationManagerImpl( useDynamicStub ) ;
|
PresentationManager pm = new PresentationManagerImpl( useDynamicStub ) ;
|
||||||
pm.setStubFactoryFactory( false,
|
pm.setStubFactoryFactory( false,
|
||||||
|
@ -28,7 +28,9 @@ package sun.corba;
|
|||||||
import com.sun.corba.se.impl.io.ValueUtility;
|
import com.sun.corba.se.impl.io.ValueUtility;
|
||||||
import sun.misc.Unsafe;
|
import sun.misc.Unsafe;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
import java.security.AccessController;
|
import java.security.AccessController;
|
||||||
|
import java.security.PrivilegedAction;
|
||||||
|
|
||||||
/** A repository of "shared secrets", which are a mechanism for
|
/** A repository of "shared secrets", which are a mechanism for
|
||||||
calling implementation-private methods in another package without
|
calling implementation-private methods in another package without
|
||||||
@ -41,9 +43,23 @@ import java.security.AccessController;
|
|||||||
|
|
||||||
// SharedSecrets cloned in corba repo to avoid build issues
|
// SharedSecrets cloned in corba repo to avoid build issues
|
||||||
public class SharedSecrets {
|
public class SharedSecrets {
|
||||||
private static final Unsafe unsafe = Unsafe.getUnsafe();
|
private static final Unsafe unsafe = getUnsafe();
|
||||||
private static JavaCorbaAccess javaCorbaAccess;
|
private static JavaCorbaAccess javaCorbaAccess;
|
||||||
|
|
||||||
|
private static Unsafe getUnsafe() {
|
||||||
|
PrivilegedAction<Unsafe> pa = () -> {
|
||||||
|
Class<?> unsafeClass = sun.misc.Unsafe.class ;
|
||||||
|
try {
|
||||||
|
Field f = unsafeClass.getDeclaredField("theUnsafe");
|
||||||
|
f.setAccessible(true);
|
||||||
|
return (Unsafe) f.get(null);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new Error(e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return AccessController.doPrivileged(pa);
|
||||||
|
}
|
||||||
|
|
||||||
public static JavaCorbaAccess getJavaCorbaAccess() {
|
public static JavaCorbaAccess getJavaCorbaAccess() {
|
||||||
if (javaCorbaAccess == null) {
|
if (javaCorbaAccess == null) {
|
||||||
// Ensure ValueUtility is initialized; we know that that class
|
// Ensure ValueUtility is initialized; we know that that class
|
||||||
|
Loading…
x
Reference in New Issue
Block a user