< prev index next >

## src/java.rmi/share/classes/java/rmi/RMISecurityManager.java

Print this page

    36  * manager has been set.
    37  *
    38  * @implNote
    39  * <p>Applets typically run in a container that already has a security
    40  * manager, so there is generally no need for applets to set a security
    41  * manager. If you have a standalone application, you might need to set a
    42  * {@code SecurityManager} in order to enable class downloading. This can be
    43  * done by adding the following to your code. (It needs to be executed before
    44  * RMI can download code from remote hosts, so it most likely needs to appear
    45  * in the {@code main} method of your application.)
    46  *
    47  * <pre>{@code
    48  *    if (System.getSecurityManager() == null) {
    49  *        System.setSecurityManager(new SecurityManager());
    50  *    }
    51  * }</pre>
    52  *
    53  * @author  Roger Riggs
    54  * @author  Peter Jones
    55  * @since 1.1
    56  * @deprecated Use {@link SecurityManager} instead.

    57  */
    58 @Deprecated
    59 public class RMISecurityManager extends SecurityManager {
    60
    61     /**
    62      * Constructs a new {@code RMISecurityManager}.
    63      * @since 1.1
    64      */
    65     public RMISecurityManager() {
    66     }
    67 }
    36  * manager has been set.
    37  *
    38  * @implNote
    39  * <p>Applets typically run in a container that already has a security
    40  * manager, so there is generally no need for applets to set a security
    41  * manager. If you have a standalone application, you might need to set a
    42  * {@code SecurityManager} in order to enable class downloading. This can be
    43  * done by adding the following to your code. (It needs to be executed before
    44  * RMI can download code from remote hosts, so it most likely needs to appear
    45  * in the {@code main} method of your application.)
    46  *
    47  * <pre>{@code
    48  *    if (System.getSecurityManager() == null) {
    49  *        System.setSecurityManager(new SecurityManager());
    50  *    }
    51  * }</pre>
    52  *
    53  * @author  Roger Riggs
    54  * @author  Peter Jones
    55  * @since 1.1
    56  * @deprecated This class is only useful in conjunction with
    57  *       {@linkplain SecurityManager the Security Manager}, which is deprecated
    58  *       and subject to removal in a future release. Consequently, this class
    59  *       is also deprecated and subject to removal. There is no replacement for
    60  *       the Security Manager or this class.
    61  */
    62 @Deprecated(since="1.8", forRemoval = true)
    63 public class RMISecurityManager extends SecurityManager {
    64
    65     /**
    66      * Constructs a new {@code RMISecurityManager}.
    67      * @since 1.1
    68      */
    69     public RMISecurityManager() {
    70     }
    71 }

< prev index next >