|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.SecurityManager
junit.extensions.jfcunit.JFCTestCase.JFCSecurityManager
Security manager which proxies all calls to the original security manager. If the checkExit is called and the setAssertExit(true) then the SecurityException is thrown.
Field Summary | |
private java.lang.SecurityManager |
m_delegate
Original Security manager. |
Fields inherited from class java.lang.SecurityManager |
inCheck |
Constructor Summary | |
JFCTestCase.JFCSecurityManager(java.lang.SecurityManager delegate)
Constructor. |
Method Summary | |
void |
checkAccept(java.lang.String host,
int port)
Throws a SecurityException if the calling thread is not
permitted to accept a socket connection from the specified host and port
number. |
void |
checkAccess(java.lang.Thread t)
Throws a SecurityException if the calling thread is not
allowed to modify the thread argument. |
void |
checkAccess(java.lang.ThreadGroup g)
Throws a SecurityException if the calling thread is not
allowed to modify the thread group argument. |
void |
checkAwtEventQueueAccess()
Throws a SecurityException if the calling thread is not
allowed to access the AWT event queue. |
void |
checkConnect(java.lang.String host,
int port)
Throws a SecurityException if the calling thread is not
allowed to open a socket connection to the specified host and port number. |
void |
checkConnect(java.lang.String host,
int port,
java.lang.Object context)
Throws a SecurityException if the specified security context
is not allowed to open a socket connection to the specified host and port
number. |
void |
checkCreateClassLoader()
Throws a SecurityException if the calling thread is not
allowed to create a new class loader. |
void |
checkDelete(java.lang.String file)
Throws a SecurityException if the calling thread is not
allowed to delete the specified file. |
void |
checkExec(java.lang.String cmd)
Throws a SecurityException if the calling thread is not
allowed to create a subprocess. |
void |
checkExit(int status)
|
void |
checkLink(java.lang.String lib)
Throws a SecurityException if the calling thread is not
allowed to dynamic link the library code specified by the string argument
file. |
void |
checkListen(int port)
Throws a SecurityException if the calling thread is not
allowed to wait for a connection request on the specified local port
number. |
void |
checkMemberAccess(java.lang.Class clazz,
int which)
Throws a SecurityException if the calling thread is not
allowed to access members. |
void |
checkMulticast(java.net.InetAddress maddr)
Throws a SecurityException if the calling thread is not
allowed to use (join/leave/send/receive) IP multicast. |
void |
checkPackageAccess(java.lang.String pkg)
Throws a SecurityException if the calling thread is not
allowed to access the package specified by the argument. |
void |
checkPackageDefinition(java.lang.String pkg)
Throws a SecurityException if the calling thread is not
allowed to define classes in the package specified by the argument. |
void |
checkPermission(java.security.Permission perm)
|
void |
checkPermission(java.security.Permission perm,
java.lang.Object context)
Throws a SecurityException if the specified security context
is denied access to the resource specified by the given permission. |
void |
checkPrintJobAccess()
Throws a SecurityException if the calling thread is not
allowed to initiate a print job request. |
void |
checkPropertiesAccess()
Throws a SecurityException if the calling thread is not
allowed to access or modify the system properties. |
void |
checkPropertyAccess(java.lang.String key)
Throws a SecurityException if the calling thread is not
allowed to access the system property with the specified key
name. |
void |
checkRead(java.io.FileDescriptor fd)
Throws a SecurityException if the calling thread is not
allowed to read from the specified file descriptor. |
void |
checkRead(java.lang.String file)
Throws a SecurityException if the calling thread is not
allowed to read the file specified by the string argument. |
void |
checkRead(java.lang.String file,
java.lang.Object context)
Throws a SecurityException if the specified security context
is not allowed to read the file specified by the string argument. |
void |
checkSecurityAccess(java.lang.String target)
Determines whether the permission with the specified permission target name should be granted or denied. |
void |
checkSetFactory()
Throws a SecurityException if the calling thread is not
allowed to set the socket factory used by ServerSocket or
Socket , or the stream handler factory used by
URL . |
void |
checkSystemClipboardAccess()
Throws a SecurityException if the calling thread is not
allowed to access the system clipboard. |
boolean |
checkTopLevelWindow(java.lang.Object window)
Returns false if the calling thread is not trusted to bring
up the top-level window indicated by the window argument. |
void |
checkWrite(java.io.FileDescriptor fd)
Throws a SecurityException if the calling thread is not
allowed to write to the specified file descriptor. |
void |
checkWrite(java.lang.String file)
Throws a SecurityException if the calling thread is not
allowed to write to the file specified by the string argument. |
java.lang.Object |
getSecurityContext()
Creates an object that encapsulates the current execution environment. |
java.lang.ThreadGroup |
getThreadGroup()
Returns the thread group into which to instantiate any new thread being created at the time this is being called. |
Methods inherited from class java.lang.SecurityManager |
checkMulticast, classDepth, classLoaderDepth, currentClassLoader, currentLoadedClass, getClassContext, getInCheck, inClass, inClassLoader |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.lang.SecurityManager m_delegate
Constructor Detail |
public JFCTestCase.JFCSecurityManager(java.lang.SecurityManager delegate)
delegate
- Delegate security manager.Method Detail |
public void checkExit(int status)
status
- Status to be used.SecurityManager.checkExit(int)
public void checkPermission(java.security.Permission perm)
perm
- Permission to be checked.SecurityManager.checkPermission(java.security.Permission)
public void checkAccept(java.lang.String host, int port)
SecurityException
if the calling thread is not
permitted to accept a socket connection from the specified host and port
number.
host
- the host name of the socket connection.port
- the port number of the socket connection.public void checkAccess(java.lang.Thread t)
SecurityException
if the calling thread is not
allowed to modify the thread argument.
t
- the thread to be checked.public void checkAccess(java.lang.ThreadGroup g)
SecurityException
if the calling thread is not
allowed to modify the thread group argument.
g
- the thread group to be checked.public void checkAwtEventQueueAccess()
SecurityException
if the calling thread is not
allowed to access the AWT event queue.
public void checkConnect(java.lang.String host, int port)
SecurityException
if the calling thread is not
allowed to open a socket connection to the specified host and port number.
host
- the host name port to connect to.port
- the protocol port to connect to.public void checkConnect(java.lang.String host, int port, java.lang.Object context)
SecurityException
if the specified security context
is not allowed to open a socket connection to the specified host and port
number.
host
- the host name port to connect to.port
- the protocol port to connect to.context
- a system-dependent security context.public void checkCreateClassLoader()
SecurityException
if the calling thread is not
allowed to create a new class loader.
public void checkDelete(java.lang.String file)
SecurityException
if the calling thread is not
allowed to delete the specified file.
file
- the system-dependent filename.public void checkExec(java.lang.String cmd)
SecurityException
if the calling thread is not
allowed to create a subprocess.
cmd
- the specified system command.public void checkLink(java.lang.String lib)
SecurityException
if the calling thread is not
allowed to dynamic link the library code specified by the string argument
file.
lib
- the name of the library.public void checkListen(int port)
SecurityException
if the calling thread is not
allowed to wait for a connection request on the specified local port
number.
port
- the local port.public void checkMemberAccess(java.lang.Class clazz, int which)
SecurityException
if the calling thread is not
allowed to access members.
clazz
- the class that reflection is to be performed on.which
- type of access, PUBLIC or DECLARED.public void checkMulticast(java.net.InetAddress maddr)
SecurityException
if the calling thread is not
allowed to use (join/leave/send/receive) IP multicast.
maddr
- Internet group address to be used.public void checkPackageAccess(java.lang.String pkg)
SecurityException
if the calling thread is not
allowed to access the package specified by the argument.
pkg
- the package name.public void checkPackageDefinition(java.lang.String pkg)
SecurityException
if the calling thread is not
allowed to define classes in the package specified by the argument.
pkg
- the package name.public void checkPermission(java.security.Permission perm, java.lang.Object context)
SecurityException
if the specified security context
is denied access to the resource specified by the given permission.
perm
- the specified permissioncontext
- a system-dependent security context.public void checkPrintJobAccess()
SecurityException
if the calling thread is not
allowed to initiate a print job request.
public void checkPropertiesAccess()
SecurityException
if the calling thread is not
allowed to access or modify the system properties.
public void checkPropertyAccess(java.lang.String key)
SecurityException
if the calling thread is not
allowed to access the system property with the specified key
name.
key
- a system property key.public void checkRead(java.io.FileDescriptor fd)
SecurityException
if the calling thread is not
allowed to read from the specified file descriptor.
fd
- the system-dependent file descriptor.public void checkRead(java.lang.String file)
SecurityException
if the calling thread is not
allowed to read the file specified by the string argument.
file
- the system-dependent file name.public void checkRead(java.lang.String file, java.lang.Object context)
SecurityException
if the specified security context
is not allowed to read the file specified by the string argument.
file
- the system-dependent filename.context
- a system-dependent security context.public void checkSecurityAccess(java.lang.String target)
target
- the target name of the SecurityPermission
.public void checkSetFactory()
SecurityException
if the calling thread is not
allowed to set the socket factory used by ServerSocket
or
Socket
, or the stream handler factory used by
URL
.
public void checkSystemClipboardAccess()
SecurityException
if the calling thread is not
allowed to access the system clipboard.
public boolean checkTopLevelWindow(java.lang.Object window)
false
if the calling thread is not trusted to bring
up the top-level window indicated by the window
argument.
window
- the new window that is being created.
true
if the calling thread is trusted to put up
top-level windows; false
otherwise.public void checkWrite(java.io.FileDescriptor fd)
SecurityException
if the calling thread is not
allowed to write to the specified file descriptor.
fd
- the system-dependent file descriptor.public void checkWrite(java.lang.String file)
SecurityException
if the calling thread is not
allowed to write to the file specified by the string argument.
file
- the system-dependent filename.public java.lang.Object getSecurityContext()
public java.lang.ThreadGroup getThreadGroup()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |