helma.main
Class HelmaSecurityManager

java.lang.Object
  extended by java.lang.SecurityManager
      extended by helma.main.HelmaSecurityManager

public class HelmaSecurityManager
extends java.lang.SecurityManager

Liberal security manager for Helma system that makes sure application code is not allowed to exit the VM and set a security manager. This class can be subclassed to implement actual security policies. It contains a utility method getApplication that can be used to determine the name of the application trying to execute the action in question, if any.


Field Summary
 
Fields inherited from class java.lang.SecurityManager
inCheck
 
Constructor Summary
HelmaSecurityManager()
           
 
Method Summary
 void checkAccept(java.lang.String host, int port)
           
 void checkAccess(java.lang.Thread thread)
           
 void checkAccess(java.lang.ThreadGroup group)
           
 void checkAwtEventQueueAccess()
           
 void checkConnect(java.lang.String host, int port)
           
 void checkConnect(java.lang.String host, int port, java.lang.Object context)
           
 void checkCreateClassLoader()
           
 void checkDelete(java.lang.String file)
           
 void checkExec(java.lang.String cmd)
           
 void checkExit(int status)
           
 void checkLink(java.lang.String lib)
           
 void checkListen(int port)
           
 void checkMemberAccess(java.lang.Class clazz, int which)
           
 void checkMulticast(java.net.InetAddress addr)
           
 void checkMulticast(java.net.InetAddress addr, byte ttl)
           
 void checkPackageAccess(java.lang.String pkg)
           
 void checkPackageDefinition(java.lang.String pkg)
           
 void checkPermission(java.security.Permission p)
           
 void checkPermission(java.security.Permission p, java.lang.Object context)
           
 void checkPrintJobAccess()
           
 void checkPropertiesAccess()
           
 void checkPropertyAccess(java.lang.String key)
           
 void checkRead(java.io.FileDescriptor fdesc)
           
 void checkRead(java.lang.String file)
           
 void checkRead(java.lang.String file, java.lang.Object context)
           
 void checkSecurityAccess(java.lang.String target)
           
 void checkSetFactory()
           
 void checkSystemClipboardAccess()
           
 boolean checkTopLevelWindow(java.lang.Object window)
           
 void checkWrite(java.io.FileDescriptor fdesc)
           
 void checkWrite(java.lang.String file)
           
protected  java.lang.String getApplication()
          Utility method that returns the name of the application trying to execute the code in question.
 
Methods inherited from class java.lang.SecurityManager
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

HelmaSecurityManager

public HelmaSecurityManager()
Method Detail

checkPermission

public void checkPermission(java.security.Permission p)
Overrides:
checkPermission in class java.lang.SecurityManager
Parameters:
p - ...

checkPermission

public void checkPermission(java.security.Permission p,
                            java.lang.Object context)
Overrides:
checkPermission in class java.lang.SecurityManager
Parameters:
p - ...
context - ...

checkCreateClassLoader

public void checkCreateClassLoader()
Overrides:
checkCreateClassLoader in class java.lang.SecurityManager

checkAccess

public void checkAccess(java.lang.Thread thread)
Overrides:
checkAccess in class java.lang.SecurityManager
Parameters:
thread - ...

checkAccess

public void checkAccess(java.lang.ThreadGroup group)
Overrides:
checkAccess in class java.lang.SecurityManager
Parameters:
group - ...

checkExit

public void checkExit(int status)
Overrides:
checkExit in class java.lang.SecurityManager
Parameters:
status - ...

checkExec

public void checkExec(java.lang.String cmd)
Overrides:
checkExec in class java.lang.SecurityManager
Parameters:
cmd - ...

checkLink

public void checkLink(java.lang.String lib)
Overrides:
checkLink in class java.lang.SecurityManager
Parameters:
lib - ...

checkRead

public void checkRead(java.io.FileDescriptor fdesc)
Overrides:
checkRead in class java.lang.SecurityManager
Parameters:
fdesc - ...

checkRead

public void checkRead(java.lang.String file)
Overrides:
checkRead in class java.lang.SecurityManager
Parameters:
file - ...

checkRead

public void checkRead(java.lang.String file,
                      java.lang.Object context)
Overrides:
checkRead in class java.lang.SecurityManager
Parameters:
file - ...
context - ...

checkWrite

public void checkWrite(java.io.FileDescriptor fdesc)
Overrides:
checkWrite in class java.lang.SecurityManager
Parameters:
fdesc - ...

checkWrite

public void checkWrite(java.lang.String file)
Overrides:
checkWrite in class java.lang.SecurityManager
Parameters:
file - ...

checkDelete

public void checkDelete(java.lang.String file)
Overrides:
checkDelete in class java.lang.SecurityManager
Parameters:
file - ...

checkConnect

public void checkConnect(java.lang.String host,
                         int port)
Overrides:
checkConnect in class java.lang.SecurityManager
Parameters:
host - ...
port - ...

checkConnect

public void checkConnect(java.lang.String host,
                         int port,
                         java.lang.Object context)
Overrides:
checkConnect in class java.lang.SecurityManager
Parameters:
host - ...
port - ...
context - ...

checkListen

public void checkListen(int port)
Overrides:
checkListen in class java.lang.SecurityManager
Parameters:
port - ...

checkAccept

public void checkAccept(java.lang.String host,
                        int port)
Overrides:
checkAccept in class java.lang.SecurityManager
Parameters:
host - ...
port - ...

checkMulticast

public void checkMulticast(java.net.InetAddress addr)
Overrides:
checkMulticast in class java.lang.SecurityManager
Parameters:
addr - ...

checkMulticast

public void checkMulticast(java.net.InetAddress addr,
                           byte ttl)
Overrides:
checkMulticast in class java.lang.SecurityManager
Parameters:
addr - ...
ttl - ...

checkPropertiesAccess

public void checkPropertiesAccess()
Overrides:
checkPropertiesAccess in class java.lang.SecurityManager

checkPropertyAccess

public void checkPropertyAccess(java.lang.String key)
Overrides:
checkPropertyAccess in class java.lang.SecurityManager
Parameters:
key - ...

checkTopLevelWindow

public boolean checkTopLevelWindow(java.lang.Object window)
Overrides:
checkTopLevelWindow in class java.lang.SecurityManager
Parameters:
window - ...
Returns:
...

checkPrintJobAccess

public void checkPrintJobAccess()
Overrides:
checkPrintJobAccess in class java.lang.SecurityManager

checkSystemClipboardAccess

public void checkSystemClipboardAccess()
Overrides:
checkSystemClipboardAccess in class java.lang.SecurityManager

checkAwtEventQueueAccess

public void checkAwtEventQueueAccess()
Overrides:
checkAwtEventQueueAccess in class java.lang.SecurityManager

checkPackageAccess

public void checkPackageAccess(java.lang.String pkg)
Overrides:
checkPackageAccess in class java.lang.SecurityManager
Parameters:
pkg - ...

checkPackageDefinition

public void checkPackageDefinition(java.lang.String pkg)
Overrides:
checkPackageDefinition in class java.lang.SecurityManager
Parameters:
pkg - ...

checkSetFactory

public void checkSetFactory()
Overrides:
checkSetFactory in class java.lang.SecurityManager

checkMemberAccess

public void checkMemberAccess(java.lang.Class clazz,
                              int which)
Overrides:
checkMemberAccess in class java.lang.SecurityManager
Parameters:
clazz - ...
which - ...

checkSecurityAccess

public void checkSecurityAccess(java.lang.String target)
Overrides:
checkSecurityAccess in class java.lang.SecurityManager
Parameters:
target - ...

getApplication

protected java.lang.String getApplication()
Utility method that returns the name of the application trying to execute the code in question. Returns null if the current code does not belong to any application.



Copyright © 1998-1998-${year} Helma.org. All Rights Reserved.