This utility class associates a
. When a
is
used, * the container will always associate the called thread with an
AccessControlContext * containing only the principal of the requested
Servlet/Filter.
This class uses reflection to invoke the invoke methods.
| Method from org.apache.catalina.security.SecurityUtil Detail: |
public static void doAsPrivilege(String methodName,
Servlet targetObject) throws Exception {
doAsPrivilege(methodName, targetObject, null, null, null);
}
Perform work as a particular Subject. Here the work
will be granted to a null subject. |
public static void doAsPrivilege(String methodName,
Filter targetObject) throws Exception {
doAsPrivilege(methodName, targetObject, null, null);
}
Perform work as a particular Subject. Here the work
will be granted to a null subject. |
public static void doAsPrivilege(String methodName,
Servlet targetObject,
Class[] targetType,
Object[] targetArguments) throws Exception {
doAsPrivilege(methodName,
targetObject,
targetType,
targetArguments,
null);
}
Perform work as a particular Subject. Here the work
will be granted to a null subject. |
public static void doAsPrivilege(String methodName,
Filter targetObject,
Class[] targetType,
Object[] targetArguments) throws Exception {
doAsPrivilege(
methodName, targetObject, targetType, targetArguments, null);
}
Perform work as a particular Subject. Here the work
will be granted to a null subject. |
public static void doAsPrivilege(String methodName,
Servlet targetObject,
Class[] targetType,
Object[] targetArguments,
Principal principal) throws Exception {
Method method = null;
Method[] methodsCache = null;
if(objectCache.containsKey(targetObject)){
methodsCache = (Method[])objectCache.get(targetObject);
method = findMethod(methodsCache, methodName);
if (method == null){
method = createMethodAndCacheIt(methodsCache,
methodName,
targetObject,
targetType);
}
} else {
method = createMethodAndCacheIt(methodsCache,
methodName,
targetObject,
targetType);
}
execute(method, targetObject, targetArguments, principal);
}
Perform work as a particular Subject. Here the work
will be granted to a null subject. |
public static void doAsPrivilege(String methodName,
Filter targetObject,
Class[] targetType,
Object[] targetArguments,
Principal principal) throws Exception {
Method method = null;
Method[] methodsCache = null;
if(objectCache.containsKey(targetObject)){
methodsCache = (Method[])objectCache.get(targetObject);
method = findMethod(methodsCache, methodName);
if (method == null){
method = createMethodAndCacheIt(methodsCache,
methodName,
targetObject,
targetType);
}
} else {
method = createMethodAndCacheIt(methodsCache,
methodName,
targetObject,
targetType);
}
execute(method, targetObject, targetArguments, principal);
}
Perform work as a particular Subject. Here the work
will be granted to a null subject. |
public static boolean isPackageProtectionEnabled() {
if (packageDefinitionEnabled && Globals.IS_SECURITY_ENABLED){
return true;
}
return false;
}
Return the SecurityManager only if Security is enabled AND
package protection mechanism is enabled. |
public static void remove(Object cachedObject) {
objectCache.remove(cachedObject);
}
Remove the object from the cache. |