提交 0cfffffa 编写于 作者: S smarks

8026427: deprecate obsolete APIs from java.rmi

Reviewed-by: alanb, dfuchs
上级 ca445ade
/* /*
* Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1996, 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
...@@ -28,35 +28,38 @@ package java.rmi; ...@@ -28,35 +28,38 @@ package java.rmi;
import java.security.*; import java.security.*;
/** /**
* A subclass of {@link SecurityManager} used by RMI applications that use * {@code RMISecurityManager} implements a policy identical to the policy
* downloaded code. RMI's class loader will not download any classes from * implemented by {@link SecurityManager}. RMI applications
* remote locations if no security manager has been set. * should use the {@code SecurityManager} class or another appropriate
* <code>RMISecurityManager</code> does not apply to applets, which run * {@code SecurityManager} implementation instead of this class. RMI's class
* under the protection of their browser's security manager. * loader will download classes from remote locations only if a security
* manager has been set.
* *
* <code>RMISecurityManager</code> implements a policy that * @implNote
* is no different than the policy implemented by {@link SecurityManager}. * <p>Applets typically run in a container that already has a security
* Therefore an RMI application should use the <code>SecurityManager</code> * manager, so there is generally no need for applets to set a security
* class or another application-specific <code>SecurityManager</code> * manager. If you have a standalone application, you might need to set a
* implementation instead of this class. * {@code SecurityManager} in order to enable class downloading. This can be
* done by adding the following to your code. (It needs to be executed before
* RMI can download code from remote hosts, so it most likely needs to appear
* in the {@code main} method of your application.)
* *
* <p>To use a <code>SecurityManager</code> in your application, add * <pre>{@code
* the following statement to your code (it needs to be executed before RMI * if (System.getSecurityManager() == null) {
* can download code from remote hosts, so it most likely needs to appear * System.setSecurityManager(new SecurityManager());
* in the <code>main</code> method of your application): * }
* * }</pre>
* <pre>
* System.setSecurityManager(new SecurityManager());
* </pre>
* *
* @author Roger Riggs * @author Roger Riggs
* @author Peter Jones * @author Peter Jones
* @since JDK1.1 * @since JDK1.1
**/ * @deprecated Use {@link SecurityManager} instead.
*/
@Deprecated
public class RMISecurityManager extends SecurityManager { public class RMISecurityManager extends SecurityManager {
/** /**
* Constructs a new <code>RMISecurityManager</code>. * Constructs a new {@code RMISecurityManager}.
* @since JDK1.1 * @since JDK1.1
*/ */
public RMISecurityManager() { public RMISecurityManager() {
......
...@@ -74,7 +74,7 @@ import sun.security.action.GetIntegerAction; ...@@ -74,7 +74,7 @@ import sun.security.action.GetIntegerAction;
* <code>ActivationGroup</code> will override the system properties * <code>ActivationGroup</code> will override the system properties
* with the properties requested when its * with the properties requested when its
* <code>ActivationGroupDesc</code> was created, and will set a * <code>ActivationGroupDesc</code> was created, and will set a
* <code>java.rmi.RMISecurityManager</code> as the default system * {@link SecurityManager} as the default system
* security manager. If your application requires specific properties * security manager. If your application requires specific properties
* to be set when objects are activated in the group, the application * to be set when objects are activated in the group, the application
* should create a special <code>Properties</code> object containing * should create a special <code>Properties</code> object containing
...@@ -84,7 +84,7 @@ import sun.security.action.GetIntegerAction; ...@@ -84,7 +84,7 @@ import sun.security.action.GetIntegerAction;
* <code>ActivationDesc</code>s (before the default * <code>ActivationDesc</code>s (before the default
* <code>ActivationGroupDesc</code> is created). If your application * <code>ActivationGroupDesc</code> is created). If your application
* requires the use of a security manager other than * requires the use of a security manager other than
* <code>java.rmi.RMISecurityManager</code>, in the * {@link SecurityManager}, in the
* ActivativationGroupDescriptor properties list you can set * ActivativationGroupDescriptor properties list you can set
* <code>java.security.manager</code> property to the name of the security * <code>java.security.manager</code> property to the name of the security
* manager you would like to install. * manager you would like to install.
...@@ -235,7 +235,7 @@ public abstract class ActivationGroup ...@@ -235,7 +235,7 @@ public abstract class ActivationGroup
* <p>Note that if your application creates its own custom * <p>Note that if your application creates its own custom
* activation group, a security manager must be set for that * activation group, a security manager must be set for that
* group. Otherwise objects cannot be activated in the group. * group. Otherwise objects cannot be activated in the group.
* <code>java.rmi.RMISecurityManager</code> is set by default. * {@link SecurityManager} is set by default.
* *
* <p>If a security manager is already set in the group VM, this * <p>If a security manager is already set in the group VM, this
* method first calls the security manager's * method first calls the security manager's
......
/* /*
* Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1996, 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
...@@ -33,7 +33,9 @@ import java.rmi.*; ...@@ -33,7 +33,9 @@ import java.rmi.*;
* *
* @author Ann Wollrath * @author Ann Wollrath
* @since JDK1.1 * @since JDK1.1
* @deprecated No replacement. This interface is unused and is obsolete.
*/ */
@Deprecated
public interface ServerRef extends RemoteRef { public interface ServerRef extends RemoteRef {
/** indicate compatibility with JDK 1.1.x version of class. */ /** indicate compatibility with JDK 1.1.x version of class. */
......
/* /*
* Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1996, 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
...@@ -30,7 +30,9 @@ package java.rmi.server; ...@@ -30,7 +30,9 @@ package java.rmi.server;
* *
* @author Ann Wollrath * @author Ann Wollrath
* @since JDK1.1 * @since JDK1.1
**/ * @deprecated This class is obsolete. Use {@link ExportException} instead.
*/
@Deprecated
public class SocketSecurityException extends ExportException { public class SocketSecurityException extends ExportException {
/* indicate compatibility with JDK 1.1.x version of class */ /* indicate compatibility with JDK 1.1.x version of class */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册