| java.lang.Object java.lang.SecurityManager edu.rice.cs.util.PreventExitSecurityManager
PreventExitSecurityManager | public class PreventExitSecurityManager extends SecurityManager (Code) | | Not used anymore.
A security manager to prevent exiting the slaveVM indiscriminately. This manager disallows System.exit
(unless you call
PreventExitSecurityManager.exitVM ). It also disallows setting a security manager, since this would override
the exit prevention! If this security manager is enabled and an exit is attempted, either via System.exit
or via
PreventExitSecurityManager.exitVM when exiting is blocked, a
ExitingNotAllowedException will be thrown.
version: $Id: PreventExitSecurityManager.java 4260 2007-10-10 20:28:34Z mgricken $ |
Method Summary | |
public static PreventExitSecurityManager | activate() Creates a new exit-preventing security manager, using the previous security manager to delegate to. | public void | checkExit(int status) | public void | checkPermission(Permission perm) Disallow setting security manager, but otherwise delegate to parent. | public void | deactivate() Removes this security manager. | public boolean | exitAttempted() Returns whether a System.exit was attempted since the last time this method was called. | public void | exitVM(int status) Exits the VM unless exiting is presently blocked. | public void | setBlockExit(boolean b) Sets whether exiting the VM is unconditionally blocked or not. |
activate | public static PreventExitSecurityManager activate()(Code) | | Creates a new exit-preventing security manager, using the previous security manager to delegate to.
|
checkExit | public void checkExit(int status)(Code) | | |
checkPermission | public void checkPermission(Permission perm)(Code) | | Disallow setting security manager, but otherwise delegate to parent.
|
deactivate | public void deactivate()(Code) | | Removes this security manager.
|
exitAttempted | public boolean exitAttempted()(Code) | | Returns whether a System.exit was attempted since the last time this method was called.
|
exitVM | public void exitVM(int status)(Code) | | Exits the VM unless exiting is presently blocked. Blocking exit is used in test cases that want to see if we
try to exit.
|
setBlockExit | public void setBlockExit(boolean b)(Code) | | Sets whether exiting the VM is unconditionally blocked or not. It's useful to block exiting to allow test cases
to pretend to exit, just to make sure it would have exited under certain conditions.
Parameters: b - If true, exiting will never be allowed until set false. |
Fields inherited from java.lang.SecurityManager | protected boolean inCheck(Code)(Java Doc)
|
|
|