NetscapeSecuritypublic class NetscapeSecurity extends Object implements JMFSecurity
Fields Summary |
---|
public static JMFSecurity | security | private static Method | enablePrivilege | private static Class | privilegeManager | private static boolean | linkEnabled | private static Object[] | readPropArgs | private static Object[] | readFileArgs | private static Object[] | writeFileArgs | private static Object[] | deleteFileArgs | private static Object[] | threadArgs | private static Object[] | threadGroupArgs | private static Object[] | linkArgs | private static Object[] | connectArgs | public static Object[] | windowArgs | public static Object[] | multicastArgs | private static Hashtable | table | private Method[] | methodArray | private Class[] | classArray | private Object[] | arguments |
Constructors Summary |
---|
private NetscapeSecurity()
|
Methods Summary |
---|
public java.lang.String | getName()
return "jmf-security-netscape";
| public boolean | isLinkPermissionEnabled()
return linkEnabled;
| public void | loadLibrary(java.lang.String name)
try {
if (linkEnabled) {
requestPermission(methodArray, classArray, arguments, JMFSecurity.LINK);
} else {
throw new UnsatisfiedLinkError("No LINK privilege");
}
methodArray[0].invoke(classArray[0], arguments[0]);
System.loadLibrary(name);
} catch (Exception e) {
linkEnabled = false;
// LINK permission should be removed from the interface as it is not useful
permissionFailureNotification(JMFSecurity.LINK);
throw new UnsatisfiedLinkError("Unable to get " + name +
" privilege " + e);
}
| public void | permissionFailureNotification(int permission)
table.remove(new Integer(permission));
| public void | requestPermission(java.lang.reflect.Method[] m, java.lang.Class[] c, java.lang.Object[][] args, int request)
//if ( (enablePrivilege == null) || (cl != null) ) {
if (enablePrivilege == null) {
throw new SecurityException("Cannot request permission");
}
m[0] = enablePrivilege;
c[0] = privilegeManager;
Object value = table.get(new Integer(request));
if (value == null) {
throw new SecurityException("Permission previously denied by user " + request);
}
args[0] = (Object[]) value;
| public void | requestPermission(java.lang.reflect.Method[] m, java.lang.Class[] c, java.lang.Object[][] args, int request, java.lang.String parameter)
requestPermission(m, c, args, request);
|
|