diff options
author | Sascha Brawer <brawer@dandelis.ch> | 2003-09-11 18:45:10 +0200 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2003-09-11 16:45:10 +0000 |
commit | 130de160707667f91c5367e154573a60dfc329cc (patch) | |
tree | f45aeebafcda4eafd9f6b9df095b9c639beb3585 /libjava/java | |
parent | c203255aba10d807f68097646f4aeb3feaf2cb48 (diff) | |
download | gcc-130de160707667f91c5367e154573a60dfc329cc.zip gcc-130de160707667f91c5367e154573a60dfc329cc.tar.gz gcc-130de160707667f91c5367e154573a60dfc329cc.tar.bz2 |
Toolkit.java (getSystemEventQueue): Call SecurityManager if one is installed.
2003-09-11 Sascha Brawer <brawer@dandelis.ch>
* java/awt/Toolkit.java (getSystemEventQueue): Call SecurityManager
if one is installed. Improve Javadoc.
(getSystemEventQueueImpl): Improve Javadoc.
From-SVN: r71308
Diffstat (limited to 'libjava/java')
-rw-r--r-- | libjava/java/awt/Toolkit.java | 45 |
1 files changed, 40 insertions, 5 deletions
diff --git a/libjava/java/awt/Toolkit.java b/libjava/java/awt/Toolkit.java index f8cc6bf..e13bd5f 100644 --- a/libjava/java/awt/Toolkit.java +++ b/libjava/java/awt/Toolkit.java @@ -803,23 +803,58 @@ public abstract class Toolkit return props.getProperty(key, def); } + /** - * Returns the event queue for the applet. Despite the word "System" - * in the name of this method, there is no guarantee that the same queue - * is shared system wide. + * Returns the event queue that is suitable for the calling context. + * + * <p>Despite the word “System” in the name of this + * method, a toolkit may provide different event queues for each + * applet. There is no guarantee that the same queue is shared + * system-wide. + * + * <p>The implementation first checks whether a + * SecurityManager has been installed. If so, its {@link + * java.lang.SecurityManager#checkAwtEventQueueAccess()} method gets + * called. The security manager will throw a SecurityException if it + * does not grant the permission to access the event queue. * - * @return The event queue for this applet (or application) + * <p>Next, the call is delegated to {@link + * #getSystemEventQueueImpl()}. + * + * @return The event queue for this applet (or application). + * + * @throws SecurityException if a security manager has been + * installed, and it does not grant the permission to access the + * event queue. */ public final EventQueue getSystemEventQueue() { + SecurityManager sm; + + sm = System.getSecurityManager(); + if (sm != null) + sm.checkAwtEventQueueAccess(); + return getSystemEventQueueImpl(); } + /** - * // FIXME: What does this do? + * Returns the event queue that is suitable for the calling context. + * + * <p>Despite the word “,System”, in the name of this + * method, a toolkit may provide different event queues for each + * applet. There is no guarantee that the same queue is shared + * system-wide. + * + * <p>No security checks are performed, which is why this method + * may only be called by Toolkits. + * + * @see #getSystemEventQueue() */ protected abstract EventQueue getSystemEventQueueImpl(); + /** * @since 1.3 */ |