Class NoExitSecurityManager
java.lang.Object
java.lang.SecurityManager
org.apache.tools.ant.util.optional.NoExitSecurityManager
This is intended as a replacement for the default system manager.
The goal is to intercept System.exit calls and make it throw an
exception instead so that a System.exit in a task does not
fully terminate Ant.
This class is no longer supported in Java runtime versions 18 and higher.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
checkExit
(int status) Override SecurityManager#checkExit.void
checkPermission
(Permission perm) Override SecurityManager#checkPermission.Methods inherited from class java.lang.SecurityManager
checkAccept, checkAccess, checkAccess, checkConnect, checkConnect, checkCreateClassLoader, checkDelete, checkExec, checkLink, checkListen, checkMulticast, checkMulticast, checkPackageAccess, checkPackageDefinition, checkPermission, checkPrintJobAccess, checkPropertiesAccess, checkPropertyAccess, checkRead, checkRead, checkRead, checkSecurityAccess, checkSetFactory, checkWrite, checkWrite, getClassContext, getSecurityContext, getThreadGroup
-
Constructor Details
-
NoExitSecurityManager
public NoExitSecurityManager()
-
-
Method Details
-
checkExit
public void checkExit(int status) Override SecurityManager#checkExit. This throws an ExitException(status) exception.- Overrides:
checkExit
in classSecurityManager
- Parameters:
status
- the exit status
-
checkPermission
Override SecurityManager#checkPermission. This does nothing.- Overrides:
checkPermission
in classSecurityManager
- Parameters:
perm
- the requested permission.
-