提交 db5bee27 编写于 作者: M msheppar

8011157: Improve CORBA portablility

Summary: fix also reviewed by Alexander Fomin
Reviewed-by: alanb, coffeys, skoivu
上级 3c8cbb52
...@@ -130,11 +130,13 @@ $(CLASSDESTDIR)/%_Stub.class: $(CLASSDESTDIR)/%.class ...@@ -130,11 +130,13 @@ $(CLASSDESTDIR)/%_Stub.class: $(CLASSDESTDIR)/%.class
$(RMIC) -classpath "$(CLASSDESTDIR)" \ $(RMIC) -classpath "$(CLASSDESTDIR)" \
-d $(CLASSDESTDIR) \ -d $(CLASSDESTDIR) \
-iiop -v1.2 \ -iiop -v1.2 \
-emitPermissionCheck \
$(subst /,.,$(<:$(CLASSDESTDIR)/%.class=%)) $(subst /,.,$(<:$(CLASSDESTDIR)/%.class=%))
$(RMIC) $(HOTSPOT_INTERPRETER_FLAG) -classpath "$(CLASSDESTDIR)" \ $(RMIC) $(HOTSPOT_INTERPRETER_FLAG) -classpath "$(CLASSDESTDIR)" \
-d $(CLASSDESTDIR) \ -d $(CLASSDESTDIR) \
-iiop -v1.2 \ -iiop -v1.2 \
-standardPackage \ -standardPackage \
-emitPermissionCheck \
$(subst /,.,$(<:$(CLASSDESTDIR)/%.class=%)) $(subst /,.,$(<:$(CLASSDESTDIR)/%.class=%))
@$(java-vm-cleanup) @$(java-vm-cleanup)
......
/* /*
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -298,11 +298,15 @@ public class RequiredModelMBean ...@@ -298,11 +298,15 @@ public class RequiredModelMBean
RequiredModelMBean.class.getName(), RequiredModelMBean.class.getName(),
"setModelMBeanInfo(ModelMBeanInfo)", "setModelMBeanInfo(ModelMBeanInfo)",
"Setting ModelMBeanInfo to " + printModelMBeanInfo(mbi)); "Setting ModelMBeanInfo to " + printModelMBeanInfo(mbi));
int noOfNotifications = 0;
if (mbi.getNotifications() != null) {
noOfNotifications = mbi.getNotifications().length;
}
MODELMBEAN_LOGGER.logp(Level.FINER, MODELMBEAN_LOGGER.logp(Level.FINER,
RequiredModelMBean.class.getName(), RequiredModelMBean.class.getName(),
"setModelMBeanInfo(ModelMBeanInfo)", "setModelMBeanInfo(ModelMBeanInfo)",
"ModelMBeanInfo notifications has " + "ModelMBeanInfo notifications has " +
(mbi.getNotifications()).length + " elements"); noOfNotifications + " elements");
} }
modelMBeanInfo = (ModelMBeanInfo)mbi.clone(); modelMBeanInfo = (ModelMBeanInfo)mbi.clone();
......
/* /*
* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -61,6 +61,7 @@ import java.rmi.server.RemoteRef; ...@@ -61,6 +61,7 @@ import java.rmi.server.RemoteRef;
import java.security.AccessController; import java.security.AccessController;
import java.security.PrivilegedAction; import java.security.PrivilegedAction;
import java.security.PrivilegedExceptionAction; import java.security.PrivilegedExceptionAction;
import java.security.PrivilegedActionException;
import java.security.ProtectionDomain; import java.security.ProtectionDomain;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
...@@ -128,7 +129,6 @@ public class RMIConnector implements JMXConnector, Serializable, JMXAddressable ...@@ -128,7 +129,6 @@ public class RMIConnector implements JMXConnector, Serializable, JMXAddressable
Map<String, ?> environment) { Map<String, ?> environment) {
if (rmiServer == null && address == null) throw new if (rmiServer == null && address == null) throw new
IllegalArgumentException("rmiServer and jmxServiceURL both null"); IllegalArgumentException("rmiServer and jmxServiceURL both null");
initTransients(); initTransients();
this.rmiServer = rmiServer; this.rmiServer = rmiServer;
...@@ -2372,11 +2372,19 @@ public class RMIConnector implements JMXConnector, Serializable, JMXAddressable ...@@ -2372,11 +2372,19 @@ public class RMIConnector implements JMXConnector, Serializable, JMXAddressable
private static RMIConnection shadowIiopStub(Object stub) private static RMIConnection shadowIiopStub(Object stub)
throws InstantiationException, IllegalAccessException { throws InstantiationException, IllegalAccessException {
Object proxyStub = proxyStubClass.newInstance(); Object proxyStub = null;
try {
proxyStub = AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
public Object run() throws Exception {
return proxyStubClass.newInstance();
}
});
} catch (PrivilegedActionException e) {
throw new InternalError();
}
IIOPHelper.setDelegate(proxyStub, IIOPHelper.getDelegate(stub)); IIOPHelper.setDelegate(proxyStub, IIOPHelper.getDelegate(stub));
return (RMIConnection) proxyStub; return (RMIConnection) proxyStub;
} }
private static RMIConnection getConnection(RMIServer server, private static RMIConnection getConnection(RMIServer server,
Object credentials, Object credentials,
boolean checkStub) boolean checkStub)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册