Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/sun/awt/AWTSecurityManager.java
38827 views
/*1* Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package sun.awt;2627/**28* The AWTSecurityManager class provides the ability to secondarily29* index AppContext objects through SecurityManager extensions.30* As noted in AppContext.java, AppContexts are primarily indexed by31* ThreadGroup. In the case where the ThreadGroup doesn't provide32* enough information to determine AppContext (e.g. system threads),33* if a SecurityManager is installed which derives from34* AWTSecurityManager, the AWTSecurityManager's getAppContext()35* method is called to determine the AppContext.36*37* A typical example of the use of this class is where an applet38* is called by a system thread, yet the system AppContext is39* inappropriate, because applet code is currently executing.40* In this case, the getAppContext() method can walk the call stack41* to determine the applet code being executed and return the applet's42* AppContext object.43*44* @author Fred Ecks45*/46public class AWTSecurityManager extends SecurityManager {4748/**49* Get the AppContext corresponding to the current context.50* The default implementation returns null, but this method51* may be overridden by various SecurityManagers52* (e.g. AppletSecurity) to index AppContext objects by the53* calling context.54*55* @return the AppContext corresponding to the current context.56* @see sun.awt.AppContext57* @see java.lang.SecurityManager58* @since JDK1.2.159*/60public AppContext getAppContext() {61return null; // Default implementation returns null62}6364} /* class AWTSecurityManager */656667