|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.SecurityManager | +--net.drijf.javaone.StrictSecurityManager
This class implements a more strict Security manager than the
standard SecurityManager
. In particular, it:
System.exit()
for code
that is of unknown origin,AllPermissions
. While this is not according to
specification of Sun, it gives some hints on how a policy could be
defined that allows for subtractive permissions.
Fields inherited from class java.lang.SecurityManager |
inCheck |
Constructor Summary | |
StrictSecurityManager()
|
Method Summary | |
void |
checkAccess(java.lang.ThreadGroup g)
Check access to the ThreadGroup. |
void |
checkExit(int code)
Prevent access to System.exit() , even if
AllPermission has been granted. |
void |
checkPermission(java.security.Permission perm)
Check if setting the security manager is allowed. |
protected void |
checkTrusted(java.lang.String className)
Check is we trust the class with the given name. |
Methods inherited from class java.lang.SecurityManager |
checkAccept, checkAccess, checkAwtEventQueueAccess, checkConnect, checkConnect, checkCreateClassLoader, checkDelete, checkExec, checkLink, checkListen, checkMemberAccess, checkMulticast, checkMulticast, checkPackageAccess, checkPackageDefinition, checkPermission, 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 |
public StrictSecurityManager()
Method Detail |
public void checkAccess(java.lang.ThreadGroup g)
modifyThreadGroup
permission has been granted.checkAccess
in class java.lang.SecurityManager
g
- the thread group to check access to.public void checkExit(int code)
System.exit()
, even if
AllPermission has been granted. The only case that is
allowed shutdown: all code on the stack is found to be OK by
checkTrusted
- Overrides:
checkExit
in class java.lang.SecurityManager
- See Also:
checkTrusted(java.lang.String)
protected void checkTrusted(java.lang.String className)
className
- the name of the class to check.public void checkPermission(java.security.Permission perm)
"setSecurityManagerPermission"
.checkPermission
in class java.lang.SecurityManager
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |