| ||||
Copyright 1999 Sams Publishing |
|
Understanding Thread Group Security |
The checkAccess() method of ThreadGroup is called internally by many of the other ThreadGroup methods . It checks to see if a SecurityManager exists for a VM. By default, applications do not have a SecurityManager installed. Applets, on the other hand, might ave one. |
If a SecurityManager exists and it determines that a particular thread is not permitted to take an action, it throws a SecurityException . SecurityException is a subclass of RuntimeException , so try/catch blocks are typically not used. If no SecurityManager is installed, or if the SecurityManager approves of the access, checkAccess() silently returns. |
A full discussion of security in Java is beyond the scope of this book. You just need to be aware that a SecurityException might be thrown from most of the methods of ThreadGroup . If you are writing an application, you can usually safely ignore these checkAccess() issues. |
| |||
Toc |