J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 1996-2003 Sun Microsystems, Inc. All Rights Reserved. |
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 4 | * |
| 5 | * This code is free software; you can redistribute it and/or modify it |
| 6 | * under the terms of the GNU General Public License version 2 only, as |
| 7 | * published by the Free Software Foundation. Sun designates this |
| 8 | * particular file as subject to the "Classpath" exception as provided |
| 9 | * by Sun in the LICENSE file that accompanied this code. |
| 10 | * |
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 14 | * version 2 for more details (a copy is included in the LICENSE file that |
| 15 | * accompanied this code). |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License version |
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
| 20 | * |
| 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
| 22 | * CA 95054 USA or visit www.sun.com if you need additional information or |
| 23 | * have any questions. |
| 24 | */ |
| 25 | |
| 26 | package java.rmi; |
| 27 | |
| 28 | import java.security.*; |
| 29 | |
| 30 | /** |
| 31 | * A subclass of {@link SecurityManager} used by RMI applications that use |
| 32 | * downloaded code. RMI's class loader will not download any classes from |
| 33 | * remote locations if no security manager has been set. |
| 34 | * <code>RMISecurityManager</code> does not apply to applets, which run |
| 35 | * under the protection of their browser's security manager. |
| 36 | * |
| 37 | * <code>RMISecurityManager</code> implements a policy that |
| 38 | * is no different than the policy implemented by {@link SecurityManager}. |
| 39 | * Therefore an RMI application should use the <code>SecurityManager</code> |
| 40 | * class or another application-specific <code>SecurityManager</code> |
| 41 | * implementation instead of this class. |
| 42 | * |
| 43 | * <p>To use a <code>SecurityManager</code> in your application, add |
| 44 | * the following statement to your code (it needs to be executed before RMI |
| 45 | * can download code from remote hosts, so it most likely needs to appear |
| 46 | * in the <code>main</code> method of your application): |
| 47 | * |
| 48 | * <pre> |
| 49 | * System.setSecurityManager(new SecurityManager()); |
| 50 | * </pre> |
| 51 | * |
| 52 | * @author Roger Riggs |
| 53 | * @author Peter Jones |
| 54 | * @since JDK1.1 |
| 55 | **/ |
| 56 | public class RMISecurityManager extends SecurityManager { |
| 57 | |
| 58 | /** |
| 59 | * Constructs a new <code>RMISecurityManager</code>. |
| 60 | * @since JDK1.1 |
| 61 | */ |
| 62 | public RMISecurityManager() { |
| 63 | } |
| 64 | } |