ewe.security
Class mSecurityManager

java.lang.Object
  extended byjava.lang.SecurityManager
      extended byewe.security.mSecurityManager

public abstract class mSecurityManager
extends SecurityManager


Field Summary
 
Fields inherited from class java.lang.SecurityManager
inCheck
 
Constructor Summary
mSecurityManager()
           
 
Method Summary
 void checkAccess(Thread t)
          Check if the current thread is allowed to modify another Thread.
 void checkAccess(ThreadGroup tg)
          Check if the current thread is allowed to modify a ThreadGroup.
 mThreadGroup checkAssignMThreadGroup(mThreadGroup group)
           
 void checkCreateClassLoader()
          Check if the current thread is allowed to create a ClassLoader.
 void checkCreateSecurityManager(SecurityManager obj)
           
 void checkDelete(String filename)
          Check if the current thread is allowed to delete the given file.
abstract  void checkLocalFileAccess()
           
 void checkPassAuthority(ClassLoader from, ClassLoader to)
           
 void checkRead(String filename, Object context)
          Check if the current thread is allowed to read the given file.
protected  Class findFirstInstanceof(Class aClass)
           
 PropertyList getAuthorizers(ClassLoader loader, boolean forWriting)
           
 
Methods inherited from class java.lang.SecurityManager
checkAccept, checkConnect, checkConnect, checkExec, checkExit, checkLink, checkListen, checkMemberAccess, checkPackageAccess, checkPackageDefinition, checkPrintJobAccess, checkPropertiesAccess, checkPropertyAccess, checkRead, checkSecurityAccess, checkSetFactory, checkSystemClipboardAccess, checkTopLevelWindow, checkWrite, classDepth, classLoaderDepth, currentClassLoader, currentLoadedClass, getClassContext, getInCheck, getSecurityContext, inClass, inClassLoader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, toString
 

Constructor Detail

mSecurityManager

public mSecurityManager()
Method Detail

checkLocalFileAccess

public abstract void checkLocalFileAccess()

getAuthorizers

public PropertyList getAuthorizers(ClassLoader loader,
                                   boolean forWriting)

findFirstInstanceof

protected Class findFirstInstanceof(Class aClass)

checkCreateClassLoader

public void checkCreateClassLoader()
Description copied from class: SecurityManager
Check if the current thread is allowed to create a ClassLoader. This method is called from ClassLoader.ClassLoader(), and checks RuntimePermission("createClassLoader"). If you override this, you should call super.checkCreateClassLoader() rather than throwing an exception.

Overrides:
checkCreateClassLoader in class SecurityManager
See Also:
ClassLoader.ClassLoader()

checkPassAuthority

public final void checkPassAuthority(ClassLoader from,
                                     ClassLoader to)

checkCreateSecurityManager

public void checkCreateSecurityManager(SecurityManager obj)

checkAssignMThreadGroup

public mThreadGroup checkAssignMThreadGroup(mThreadGroup group)

checkAccess

public final void checkAccess(Thread t)
Description copied from class: SecurityManager
Check if the current thread is allowed to modify another Thread. This is called by Thread.stop(), suspend(), resume(), interrupt(), destroy(), setPriority(), setName(), and setDaemon(). The default implementation checks RuntimePermission("modifyThread") on system threads (ie. threads in ThreadGroup with a null parent), and returns silently on other threads.

If you override this, you must do two things. First, call super.checkAccess(t), to make sure you are not relaxing requirements. Second, if the calling thread has RuntimePermission("modifyThread"), return silently, so that core classes (the Classpath library!) can modify any thread.

Overrides:
checkAccess in class SecurityManager
Parameters:
t - the other Thread to check
See Also:
Thread#stop(), Thread#suspend(), Thread#resume(), Thread#setPriority(int), Thread#setName(String), Thread#setDaemon(boolean)

checkAccess

public final void checkAccess(ThreadGroup tg)
Description copied from class: SecurityManager
Check if the current thread is allowed to modify a ThreadGroup. This is called by Thread.Thread() (to add a thread to the ThreadGroup), ThreadGroup.ThreadGroup() (to add this ThreadGroup to a parent), ThreadGroup.stop(), suspend(), resume(), interrupt(), destroy(), setDaemon(), and setMaxPriority(). The default implementation checks RuntimePermission("modifyThread") on the system group (ie. the one with a null parent), and returns silently on other groups.

If you override this, you must do two things. First, call super.checkAccess(t), to make sure you are not relaxing requirements. Second, if the calling thread has RuntimePermission("modifyThreadGroup"), return silently, so that core classes (the Classpath library!) can modify any thread.

Overrides:
checkAccess in class SecurityManager
Parameters:
tg - the ThreadGroup to check
See Also:
Thread#Thread(), ThreadGroup#ThreadGroup(), ThreadGroup#stop(), ThreadGroup#suspend(), ThreadGroup#resume(), ThreadGroup#interrupt(), ThreadGroup#setDaemon(boolean), ThreadGroup#setMaxPriority(int)

checkRead

public void checkRead(String filename,
                      Object context)
Description copied from class: SecurityManager
Check if the current thread is allowed to read the given file. using the given security context. The context must be a result of a previous call to getSecurityContext(). The default implementation checks AccessControlContext.checkPermission(new FilePermission(filename, "read")). If you override this, call super.checkRead rather than throwing an exception.

Overrides:
checkRead in class SecurityManager
Parameters:
filename - the full name of the file to access
context - the context to determine access for
See Also:
SecurityManager.getSecurityContext(), AccessControlContext#checkPermission(Permission)

checkDelete

public void checkDelete(String filename)
Description copied from class: SecurityManager
Check if the current thread is allowed to delete the given file. This method is called from File.delete(). The default implementation checks FilePermission(filename, "delete"). If you override this, call super.checkDelete rather than throwing an exception.

Overrides:
checkDelete in class SecurityManager
Parameters:
filename - the full name of the file to delete
See Also:
File#delete()