Java Code Examples for sun.misc.JavaAWTAccess#getAppletContext()
The following examples show how to use
sun.misc.JavaAWTAccess#getAppletContext() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LogManager.java From jdk1.8-source-analysis with Apache License 2.0 | 5 votes |
private LoggerContext getUserContext() { LoggerContext context = null; SecurityManager sm = System.getSecurityManager(); JavaAWTAccess javaAwtAccess = SharedSecrets.getJavaAWTAccess(); if (sm != null && javaAwtAccess != null) { // for each applet, it has its own LoggerContext isolated from others final Object ecx = javaAwtAccess.getAppletContext(); if (ecx != null) { synchronized (javaAwtAccess) { // find the AppContext of the applet code // will be null if we are in the main app context. if (contextsMap == null) { contextsMap = new WeakHashMap<>(); } context = contextsMap.get(ecx); if (context == null) { // Create a new LoggerContext for the applet. context = new LoggerContext(); contextsMap.put(ecx, context); } } } } // for standalone app, return userContext return context != null ? context : userContext; }
Example 2
Source File: LogManager.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
private LoggerContext getUserContext() { LoggerContext context = null; SecurityManager sm = System.getSecurityManager(); JavaAWTAccess javaAwtAccess = SharedSecrets.getJavaAWTAccess(); if (sm != null && javaAwtAccess != null) { // for each applet, it has its own LoggerContext isolated from others final Object ecx = javaAwtAccess.getAppletContext(); if (ecx != null) { synchronized (javaAwtAccess) { // find the AppContext of the applet code // will be null if we are in the main app context. if (contextsMap == null) { contextsMap = new WeakHashMap<>(); } context = contextsMap.get(ecx); if (context == null) { // Create a new LoggerContext for the applet. context = new LoggerContext(); contextsMap.put(ecx, context); } } } } // for standalone app, return userContext return context != null ? context : userContext; }
Example 3
Source File: LogManager.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
private LoggerContext getUserContext() { LoggerContext context = null; SecurityManager sm = System.getSecurityManager(); JavaAWTAccess javaAwtAccess = SharedSecrets.getJavaAWTAccess(); if (sm != null && javaAwtAccess != null) { // for each applet, it has its own LoggerContext isolated from others final Object ecx = javaAwtAccess.getAppletContext(); if (ecx != null) { synchronized (javaAwtAccess) { // find the AppContext of the applet code // will be null if we are in the main app context. if (contextsMap == null) { contextsMap = new WeakHashMap<>(); } context = contextsMap.get(ecx); if (context == null) { // Create a new LoggerContext for the applet. context = new LoggerContext(); contextsMap.put(ecx, context); } } } } // for standalone app, return userContext return context != null ? context : userContext; }
Example 4
Source File: LogManager.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
private LoggerContext getUserContext() { LoggerContext context = null; SecurityManager sm = System.getSecurityManager(); JavaAWTAccess javaAwtAccess = SharedSecrets.getJavaAWTAccess(); if (sm != null && javaAwtAccess != null) { // for each applet, it has its own LoggerContext isolated from others final Object ecx = javaAwtAccess.getAppletContext(); if (ecx != null) { synchronized (javaAwtAccess) { // find the AppContext of the applet code // will be null if we are in the main app context. if (contextsMap == null) { contextsMap = new WeakHashMap<>(); } context = contextsMap.get(ecx); if (context == null) { // Create a new LoggerContext for the applet. context = new LoggerContext(); contextsMap.put(ecx, context); } } } } // for standalone app, return userContext return context != null ? context : userContext; }
Example 5
Source File: LogManager.java From JDKSourceCode1.8 with MIT License | 5 votes |
private LoggerContext getUserContext() { LoggerContext context = null; SecurityManager sm = System.getSecurityManager(); JavaAWTAccess javaAwtAccess = SharedSecrets.getJavaAWTAccess(); if (sm != null && javaAwtAccess != null) { // for each applet, it has its own LoggerContext isolated from others final Object ecx = javaAwtAccess.getAppletContext(); if (ecx != null) { synchronized (javaAwtAccess) { // find the AppContext of the applet code // will be null if we are in the main app context. if (contextsMap == null) { contextsMap = new WeakHashMap<>(); } context = contextsMap.get(ecx); if (context == null) { // Create a new LoggerContext for the applet. context = new LoggerContext(); contextsMap.put(ecx, context); } } } } // for standalone app, return userContext return context != null ? context : userContext; }
Example 6
Source File: LogManager.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
private LoggerContext getUserContext() { LoggerContext context = null; SecurityManager sm = System.getSecurityManager(); JavaAWTAccess javaAwtAccess = SharedSecrets.getJavaAWTAccess(); if (sm != null && javaAwtAccess != null) { // for each applet, it has its own LoggerContext isolated from others final Object ecx = javaAwtAccess.getAppletContext(); if (ecx != null) { synchronized (javaAwtAccess) { // find the AppContext of the applet code // will be null if we are in the main app context. if (contextsMap == null) { contextsMap = new WeakHashMap<>(); } context = contextsMap.get(ecx); if (context == null) { // Create a new LoggerContext for the applet. context = new LoggerContext(); contextsMap.put(ecx, context); } } } } // for standalone app, return userContext return context != null ? context : userContext; }
Example 7
Source File: LogManager.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
private LoggerContext getUserContext() { LoggerContext context = null; SecurityManager sm = System.getSecurityManager(); JavaAWTAccess javaAwtAccess = SharedSecrets.getJavaAWTAccess(); if (sm != null && javaAwtAccess != null) { // for each applet, it has its own LoggerContext isolated from others final Object ecx = javaAwtAccess.getAppletContext(); if (ecx != null) { synchronized (javaAwtAccess) { // find the AppContext of the applet code // will be null if we are in the main app context. if (contextsMap == null) { contextsMap = new WeakHashMap<>(); } context = contextsMap.get(ecx); if (context == null) { // Create a new LoggerContext for the applet. context = new LoggerContext(); contextsMap.put(ecx, context); } } } } // for standalone app, return userContext return context != null ? context : userContext; }
Example 8
Source File: LogManager.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
private LoggerContext getUserContext() { LoggerContext context = null; SecurityManager sm = System.getSecurityManager(); JavaAWTAccess javaAwtAccess = SharedSecrets.getJavaAWTAccess(); if (sm != null && javaAwtAccess != null) { // for each applet, it has its own LoggerContext isolated from others final Object ecx = javaAwtAccess.getAppletContext(); if (ecx != null) { synchronized (javaAwtAccess) { // find the AppContext of the applet code // will be null if we are in the main app context. if (contextsMap == null) { contextsMap = new WeakHashMap<>(); } context = contextsMap.get(ecx); if (context == null) { // Create a new LoggerContext for the applet. context = new LoggerContext(); contextsMap.put(ecx, context); } } } } // for standalone app, return userContext return context != null ? context : userContext; }
Example 9
Source File: LogManager.java From Java8CN with Apache License 2.0 | 5 votes |
private LoggerContext getUserContext() { LoggerContext context = null; SecurityManager sm = System.getSecurityManager(); JavaAWTAccess javaAwtAccess = SharedSecrets.getJavaAWTAccess(); if (sm != null && javaAwtAccess != null) { // for each applet, it has its own LoggerContext isolated from others final Object ecx = javaAwtAccess.getAppletContext(); if (ecx != null) { synchronized (javaAwtAccess) { // find the AppContext of the applet code // will be null if we are in the main app context. if (contextsMap == null) { contextsMap = new WeakHashMap<>(); } context = contextsMap.get(ecx); if (context == null) { // Create a new LoggerContext for the applet. context = new LoggerContext(); contextsMap.put(ecx, context); } } } } // for standalone app, return userContext return context != null ? context : userContext; }
Example 10
Source File: LogManager.java From hottub with GNU General Public License v2.0 | 5 votes |
private LoggerContext getUserContext() { LoggerContext context = null; SecurityManager sm = System.getSecurityManager(); JavaAWTAccess javaAwtAccess = SharedSecrets.getJavaAWTAccess(); if (sm != null && javaAwtAccess != null) { // for each applet, it has its own LoggerContext isolated from others final Object ecx = javaAwtAccess.getAppletContext(); if (ecx != null) { synchronized (javaAwtAccess) { // find the AppContext of the applet code // will be null if we are in the main app context. if (contextsMap == null) { contextsMap = new WeakHashMap<>(); } context = contextsMap.get(ecx); if (context == null) { // Create a new LoggerContext for the applet. context = new LoggerContext(); contextsMap.put(ecx, context); } } } } // for standalone app, return userContext return context != null ? context : userContext; }
Example 11
Source File: LogManager.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
private LoggerContext getUserContext() { LoggerContext context = null; SecurityManager sm = System.getSecurityManager(); JavaAWTAccess javaAwtAccess = SharedSecrets.getJavaAWTAccess(); if (sm != null && javaAwtAccess != null) { // for each applet, it has its own LoggerContext isolated from others synchronized (javaAwtAccess) { // find the AppContext of the applet code // will be null if we are in the main app context. final Object ecx = javaAwtAccess.getAppletContext(); if (ecx != null) { if (contextsMap == null) { contextsMap = new WeakHashMap<>(); } context = contextsMap.get(ecx); if (context == null) { // Create a new LoggerContext for the applet. context = new LoggerContext(); contextsMap.put(ecx, context); } } } } // for standalone app, return userContext return context != null ? context : userContext; }
Example 12
Source File: LogManager.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
private LoggerContext getUserContext() { LoggerContext context = null; SecurityManager sm = System.getSecurityManager(); JavaAWTAccess javaAwtAccess = SharedSecrets.getJavaAWTAccess(); if (sm != null && javaAwtAccess != null) { // for each applet, it has its own LoggerContext isolated from others synchronized (javaAwtAccess) { // find the AppContext of the applet code // will be null if we are in the main app context. final Object ecx = javaAwtAccess.getAppletContext(); if (ecx != null) { if (contextsMap == null) { contextsMap = new WeakHashMap<>(); } context = contextsMap.get(ecx); if (context == null) { // Create a new LoggerContext for the applet. context = new LoggerContext(); contextsMap.put(ecx, context); } } } } // for standalone app, return userContext return context != null ? context : userContext; }
Example 13
Source File: LogManager.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
private LoggerContext getUserContext() { LoggerContext context = null; SecurityManager sm = System.getSecurityManager(); JavaAWTAccess javaAwtAccess = SharedSecrets.getJavaAWTAccess(); if (sm != null && javaAwtAccess != null) { // for each applet, it has its own LoggerContext isolated from others final Object ecx = javaAwtAccess.getAppletContext(); if (ecx != null) { synchronized (javaAwtAccess) { // find the AppContext of the applet code // will be null if we are in the main app context. if (contextsMap == null) { contextsMap = new WeakHashMap<>(); } context = contextsMap.get(ecx); if (context == null) { // Create a new LoggerContext for the applet. context = new LoggerContext(); contextsMap.put(ecx, context); } } } } // for standalone app, return userContext return context != null ? context : userContext; }
Example 14
Source File: LogManager.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
private LoggerContext getUserContext() { LoggerContext context = null; SecurityManager sm = System.getSecurityManager(); JavaAWTAccess javaAwtAccess = SharedSecrets.getJavaAWTAccess(); if (sm != null && javaAwtAccess != null) { // for each applet, it has its own LoggerContext isolated from others final Object ecx = javaAwtAccess.getAppletContext(); if (ecx != null) { synchronized (javaAwtAccess) { // find the AppContext of the applet code // will be null if we are in the main app context. if (contextsMap == null) { contextsMap = new WeakHashMap<>(); } context = contextsMap.get(ecx); if (context == null) { // Create a new LoggerContext for the applet. context = new LoggerContext(); contextsMap.put(ecx, context); } } } } // for standalone app, return userContext return context != null ? context : userContext; }
Example 15
Source File: LogManager.java From jdk-1.7-annotated with Apache License 2.0 | 5 votes |
private LoggerContext getUserContext() { LoggerContext context = null; SecurityManager sm = System.getSecurityManager(); JavaAWTAccess javaAwtAccess = SharedSecrets.getJavaAWTAccess(); if (sm != null && javaAwtAccess != null) { // for each applet, it has its own LoggerContext isolated from others synchronized (javaAwtAccess) { // find the AppContext of the applet code // will be null if we are in the main app context. final Object ecx = javaAwtAccess.getAppletContext(); if (ecx != null) { if (contextsMap == null) { contextsMap = new WeakHashMap<>(); } context = contextsMap.get(ecx); if (context == null) { // Create a new LoggerContext for the applet. // The new logger context has its requiresDefaultLoggers // flag set to true - so that these loggers will be // lazily added when the context is firt accessed. context = new LoggerContext(true); contextsMap.put(ecx, context); } } } } // for standalone app, return userContext return context != null ? context : userContext; }
Example 16
Source File: LogManager.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 5 votes |
private LoggerContext getUserContext() { LoggerContext context = null; SecurityManager sm = System.getSecurityManager(); JavaAWTAccess javaAwtAccess = SharedSecrets.getJavaAWTAccess(); if (sm != null && javaAwtAccess != null) { // for each applet, it has its own LoggerContext isolated from others final Object ecx = javaAwtAccess.getAppletContext(); if (ecx != null) { synchronized (javaAwtAccess) { // find the AppContext of the applet code // will be null if we are in the main app context. if (contextsMap == null) { contextsMap = new WeakHashMap<>(); } context = contextsMap.get(ecx); if (context == null) { // Create a new LoggerContext for the applet. context = new LoggerContext(); contextsMap.put(ecx, context); } } } } // for standalone app, return userContext return context != null ? context : userContext; }