abbot.util
Class ThreadTerminatingSecurityManager

java.lang.Object
  extended byjava.lang.SecurityManager
      extended byabbot.NoExitSecurityManager
          extended byabbot.util.ThreadTerminatingSecurityManager

public abstract class ThreadTerminatingSecurityManager
extends NoExitSecurityManager

Provides a method for terminating threads over which you otherwise have no control. Usually works.

NOTE: Still needs some work; if main script editor exits from the event dispatch thread, an exception is thrown and the exit aborted. Perhaps ignore event dispatch threads?


Nested Class Summary
 class ThreadTerminatingSecurityManager.ThreadTerminatedException
           
 
Field Summary
 
Fields inherited from class java.lang.SecurityManager
inCheck
 
Constructor Summary
ThreadTerminatingSecurityManager()
           
 
Method Summary
 void checkPermission(Permission perm)
          Throw ThreadTerminated for any thread marked for termination.
 void checkPermission(Permission perm, Object context)
          Throw ThreadTerminated for any thread marked for termination.
 void terminateThreads(ThreadGroup group)
          Ensure ThreadTermination exceptions are thrown for any thread in the given group when any such thread causes the security manager to be invoked.
 
Methods inherited from class abbot.NoExitSecurityManager
checkExit, exitCalled
 
Methods inherited from class java.lang.SecurityManager
checkAccept, checkAccess, checkAccess, checkAwtEventQueueAccess, checkConnect, checkConnect, checkCreateClassLoader, checkDelete, checkExec, checkLink, checkListen, checkMemberAccess, checkMulticast, checkMulticast, checkPackageAccess, checkPackageDefinition, checkPrintJobAccess, checkPropertiesAccess, checkPropertyAccess, checkRead, checkRead, checkRead, checkSecurityAccess, checkSetFactory, checkSystemClipboardAccess, checkTopLevelWindow, checkWrite, checkWrite, classDepth, classLoaderDepth, currentClassLoader, currentLoadedClass, getClassContext, getInCheck, getSecurityContext, getThreadGroup, inClass, inClassLoader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadTerminatingSecurityManager

public ThreadTerminatingSecurityManager()
Method Detail

terminateThreads

public void terminateThreads(ThreadGroup group)
Ensure ThreadTermination exceptions are thrown for any thread in the given group when any such thread causes the security manager to be invoked.


checkPermission

public void checkPermission(Permission perm,
                            Object context)
Throw ThreadTerminated for any thread marked for termination.

Overrides:
checkPermission in class NoExitSecurityManager

checkPermission

public void checkPermission(Permission perm)
Throw ThreadTerminated for any thread marked for termination.

Overrides:
checkPermission in class NoExitSecurityManager


Copyright © 2002-2004 Timothy Wall. All Rights Reserved.
Abbot is hosted on

SourceForge