netx.jnlp.runtime
class JNLPSecurityManager extends java.lang.SecurityManager
The JNLP security manager tracks windows created by an application, allowing those windows to be disposed when the application exits but the JVM does not. If security is not enabled then the first application to call System.exit will halt the JVM.
Constructor and Description |
---|
JNLPSecurityManager()
Creates a JNLP SecurityManager.
|
Modifier and Type | Method and Description |
---|---|
void |
checkExit(int status)
Checks whether the caller can exit the system.
|
void |
checkPermission(java.security.Permission perm)
Throws a SecurityException if the permission is denied,
otherwise return normally.
|
boolean |
checkTopLevelWindow(java.lang.Object window)
Checks whether the window can be displayed without an applet
warning banner, and adds the window to the list of windows to
be disposed when the calling application exits.
|
protected ApplicationInstance |
getApplication()
Return the current Application, or null if none can be
determined.
|
protected ApplicationInstance |
getApplication(java.lang.Class[] stack,
int maxDepth)
Return the current Application, or null.
|
protected ApplicationInstance |
getApplication(java.awt.Window window)
Return the application the opened the specified window (only
call from event dispatch thread).
|
java.lang.ThreadGroup |
getThreadGroup()
Returns the application's thread group if the application can
be determined; otherwise returns super.getThreadGroup()
|
boolean |
isExitClass()
Returns whether the exit class is present on the stack, or
true if no exit class is set.
|
void |
setExitClass(java.lang.Class exitClass)
Set the exit class, which is the only class that can exit the
JVM; if not set then any class can exit the JVM.
|
checkAccept, checkAccess, checkAccess, checkAwtEventQueueAccess, checkConnect, checkConnect, checkCreateClassLoader, checkDelete, checkExec, checkLink, checkListen, checkMemberAccess, checkMulticast, checkMulticast, checkPackageAccess, checkPackageDefinition, checkPermission, checkPrintJobAccess, checkPropertiesAccess, checkPropertyAccess, checkRead, checkRead, checkRead, checkSecurityAccess, checkSetFactory, checkSystemClipboardAccess, checkWrite, checkWrite, classDepth, classLoaderDepth, currentClassLoader, currentLoadedClass, getClassContext, getInCheck, getSecurityContext, inClass, inClassLoader
public boolean isExitClass()
public void setExitClass(java.lang.Class exitClass) throws java.lang.IllegalStateException
exitClass
- the exit classjava.lang.IllegalStateException
- if the exit class is already setprotected ApplicationInstance getApplication()
protected ApplicationInstance getApplication(java.awt.Window window)
protected ApplicationInstance getApplication(java.lang.Class[] stack, int maxDepth)
public java.lang.ThreadGroup getThreadGroup()
getThreadGroup
in class java.lang.SecurityManager
public void checkPermission(java.security.Permission perm)
checkPermission
in class java.lang.SecurityManager
public boolean checkTopLevelWindow(java.lang.Object window)
checkTopLevelWindow
in class java.lang.SecurityManager
public void checkExit(int status)
Calls not from Runtime.exit or with no exit class set will behave normally, and the exit class can always exit the JVM.
checkExit
in class java.lang.SecurityManager