8044626: Update RMI specifications to reflect modularization changes

8165649: Re-examine if Activatable object can be created from non-public class and/or constructor

Reviewed-by: alanb, mchung
This commit is contained in:
Stuart Marks 2017-02-07 13:45:26 -08:00
parent b8e61b9b1c
commit f87f7e44b7
3 changed files with 29 additions and 6 deletions
jdk/src/java.rmi/share/classes/java/rmi

@ -60,7 +60,20 @@ public interface ActivationInstantiator extends Remote {
* initialization data, and
*
* <li> returning a MarshalledObject containing the stub for the
* remote object it created </ul>
* remote object it created.</ul>
*
* <p>In order for activation to be successful, one of the following requirements
* must be met, otherwise {@link ActivationException} is thrown:
*
* <ul><li>The class to be activated and the special activation constructor are both public,
* and the class resides in a package that is
* {@linkplain java.lang.reflect.Module#isExported(String,java.lang.reflect.Module) exported}
* to at least the {@code java.rmi} module; or
*
* <li>The class to be activated resides in a package that is
* {@linkplain java.lang.reflect.Module#isOpen(String,java.lang.reflect.Module) open}
* to at least the {@code java.rmi} module.
* </ul>
*
* @param id the object's activation identifier
* @param desc the object's descriptor

@ -48,7 +48,7 @@ import java.rmi.activation.UnknownObjectException;
* The <code>Activator</code> works closely with
* <code>ActivationSystem</code>, which provides a means for registering
* groups and objects within those groups, and <code>ActivationMonitor</code>,
* which recives information about active and inactive objects and inactive
* which receives information about active and inactive objects and inactive
* groups. <p>
*
* The activator is responsible for monitoring and detecting when

@ -107,8 +107,9 @@ import sun.rmi.transport.LiveRef;
* the binary name of the root class with the suffix {@code _Stub}.
*
* <li>The stub class is loaded by name using the class loader of the root
* class. The stub class must extend {@link RemoteStub} and must have a
* public constructor that has one parameter of type {@link RemoteRef}.
* class. The stub class must be public, it must extend {@link RemoteStub}, it must
* reside in a package that is exported to at least the {@code java.rmi} module, and it
* must have a public constructor that has one parameter of type {@link RemoteRef}.
*
* <li>Finally, an instance of the stub class is constructed with a
* {@link RemoteRef}.
@ -124,12 +125,21 @@ import sun.rmi.transport.LiveRef;
*
* <ul>
*
* <li>The proxy's class is defined by the class loader of the remote
* object's class.
* <li>The proxy's class is defined according to the specifications for the
* <a href="{@docRoot}/java/lang/reflect/Proxy.html#membership">
* {@code Proxy}
* </a>
* class, using the class loader of the remote object's class.
*
* <li>The proxy implements all the remote interfaces implemented by the
* remote object's class.
*
* <li>Each remote interface must either be public and reside in a package that is
* {@linkplain java.lang.reflect.Module#isExported(String,java.lang.reflect.Module) exported}
* to at least the {@code java.rmi} module, or it must reside in a package that is
* {@linkplain java.lang.reflect.Module#isOpen(String,java.lang.reflect.Module) open}
* to at least the {@code java.rmi} module.
*
* <li>The proxy's invocation handler is a {@link
* RemoteObjectInvocationHandler} instance constructed with a
* {@link RemoteRef}.