| The ThreadGroup class itself does not impose any
access restrictions, such as allowing threads from one
group to inspect or modify threads in a different group.
Rather the Thread and ThreadGroup classes cooperate with
security managers (subclasses of the java.lang.SecurityManager
class), which can impose access restrictions based on thread group membership. |
| |
| The Thread and ThreadGroup class both have a method,
checkAccess(), which calls the current security manager's
checkAccess() method. The security manager decides whether
to allow the access based on the group membership of the threads
involved. If access is not allowed, the checkAccess() method
throws a SecurityException. Otherwise, checkAccess() simply returns. |
| |
| The following is a list of ThreadGroup methods that
call ThreadGroup's checkAccess() before performing the
action of the method. These are what are known as regulated
accesses, that is, accesses that must be approved by the
security manager before they can be completed. |
| 1. ThreadGroup(ThreadGroup parent, String name) |
| 2. setDaemon(boolean isDaemon) |
| 3. setMaxPriority(int maxPriority) |
| 4. stop() |
| 5. suspend() |
| 6. resume() |
| 7. destroy() |
| |