jdk/src/share/classes/sun/awt/AppContext.java
changeset 3938 ef327bd847c0
parent 113 d35e2fc341c7
child 4365 4ac67034e98b
equal deleted inserted replaced
3934:487e1aa949c4 3938:ef327bd847c0
    38 import java.util.HashMap;
    38 import java.util.HashMap;
    39 import java.util.IdentityHashMap;
    39 import java.util.IdentityHashMap;
    40 import java.util.Map;
    40 import java.util.Map;
    41 import java.util.Set;
    41 import java.util.Set;
    42 import java.util.HashSet;
    42 import java.util.HashSet;
    43 import java.util.logging.Level;
       
    44 import java.util.logging.Logger;
       
    45 import java.beans.PropertyChangeSupport;
    43 import java.beans.PropertyChangeSupport;
    46 import java.beans.PropertyChangeListener;
    44 import java.beans.PropertyChangeListener;
       
    45 import sun.util.logging.PlatformLogger;
    47 
    46 
    48 /**
    47 /**
    49  * The AppContext is a table referenced by ThreadGroup which stores
    48  * The AppContext is a table referenced by ThreadGroup which stores
    50  * application service instances.  (If you are not writing an application
    49  * application service instances.  (If you are not writing an application
    51  * service, or don't know what one is, please do not use this class.)
    50  * service, or don't know what one is, please do not use this class.)
   126  *
   125  *
   127  * @author  Thomas Ball
   126  * @author  Thomas Ball
   128  * @author  Fred Ecks
   127  * @author  Fred Ecks
   129  */
   128  */
   130 public final class AppContext {
   129 public final class AppContext {
   131     private static final Logger log = Logger.getLogger("sun.awt.AppContext");
   130     private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.AppContext");
   132 
   131 
   133     /* Since the contents of an AppContext are unique to each Java
   132     /* Since the contents of an AppContext are unique to each Java
   134      * session, this class should never be serialized. */
   133      * session, this class should never be serialized. */
   135 
   134 
   136     /* The key to put()/get() the Java EventQueue into/from the AppContext.
   135     /* The key to put()/get() the Java EventQueue into/from the AppContext.
   378                 Window[] windowsToDispose = Window.getOwnerlessWindows();
   377                 Window[] windowsToDispose = Window.getOwnerlessWindows();
   379                 for (Window w : windowsToDispose) {
   378                 for (Window w : windowsToDispose) {
   380                     try {
   379                     try {
   381                         w.dispose();
   380                         w.dispose();
   382                     } catch (Throwable t) {
   381                     } catch (Throwable t) {
   383                         if (log.isLoggable(Level.FINER)) {
   382                         log.finer("exception occured while disposing app context", t);
   384                             log.log(Level.FINER, "exception occured while disposing app context", t);
       
   385                         }
       
   386                     }
   383                     }
   387                 }
   384                 }
   388                 AccessController.doPrivileged(new PrivilegedAction() {
   385                 AccessController.doPrivileged(new PrivilegedAction() {
   389                         public Object run() {
   386                         public Object run() {
   390                             if (!GraphicsEnvironment.isHeadless() && SystemTray.isSupported())
   387                             if (!GraphicsEnvironment.isHeadless() && SystemTray.isSupported())