01: /*
02: * @(#)AWTSecurityManager.java 1.12 06/10/10
03: *
04: * Copyright 1990-2006 Sun Microsystems, Inc. All Rights Reserved.
05: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
06: *
07: * This program is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU General Public License version
09: * 2 only, as published by the Free Software Foundation.
10: *
11: * This program is distributed in the hope that it will be useful, but
12: * WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * General Public License version 2 for more details (a copy is
15: * included at /legal/license.txt).
16: *
17: * You should have received a copy of the GNU General Public License
18: * version 2 along with this work; if not, write to the Free Software
19: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA
21: *
22: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
23: * Clara, CA 95054 or visit www.sun.com if you need additional
24: * information or have any questions.
25: *
26: */
27:
28: package sun.awt;
29:
30: /**
31: * The AWTSecurityManager class provides the ability to secondarily
32: * index AppContext objects through SecurityManager extensions.
33: * As noted in AppContext.java, AppContexts are primarily indexed by
34: * ThreadGroup. In the case where the ThreadGroup doesn't provide
35: * enough information to determine AppContext (e.g. system threads),
36: * if a SecurityManager is installed which derives from
37: * AWTSecurityManager, the AWTSecurityManager's getAppContext()
38: * method is called to determine the AppContext.
39: *
40: * A typical example of the use of this class is where an applet
41: * is called by a system thread, yet the system AppContext is
42: * inappropriate, because applet code is currently executing.
43: * In this case, the getAppContext() method can walk the call stack
44: * to determine the applet code being executed and return the applet's
45: * AppContext object.
46: *
47: * @author Fred Ecks
48: * @version 1.8 08/19/02
49: */
50: public class AWTSecurityManager extends SecurityManager {
51: /**
52: * Get the AppContext corresponding to the current context.
53: * The default implementation returns null, but this method
54: * may be overridden by various SecurityManagers
55: * (e.g. AppletSecurity) to index AppContext objects by the
56: * calling context.
57: *
58: * @return the AppContext corresponding to the current context.
59: * @see sun.awt.AppContext
60: * @see java.lang.SecurityManager
61: * @since JDK1.2.1
62: */
63: public AppContext getAppContext() {
64: return null; // Default implementation returns null
65: }
66: } /* class AWTSecurityManager */
|