FileDocCategorySizeDatePackage
DefaultSecurity.javaAPI DocJMF 2.1.1e2042Mon May 12 12:20:50 BST 2003com.sun.media

DefaultSecurity

public class DefaultSecurity extends Object implements JMFSecurity

Fields Summary
public static JMFSecurity
security
private static ClassLoader
clsLoader
private static Class
cls
private static Method
dummyMethodRef
Constructors Summary
private DefaultSecurity()


    
Methods Summary
public static voiddummyMethod()


     

    	security = new DefaultSecurity();
        try {
	    cls = security.getClass();
	    clsLoader = cls.getClassLoader();
	    dummyMethodRef = cls.getMethod("dummyMethod",new Class[0]);
        } catch (Exception e) {
	    System.out.println(e);
	}

    

    
public java.lang.StringgetName()

	return "default";
    
public booleanisLinkPermissionEnabled()

         if (clsLoader == null)  {
           return true;
          }
         else {
           return false;
         }

    
public voidloadLibrary(java.lang.String name)

	if (clsLoader == null) {
	    System.loadLibrary(name);
	}
	else {
	    throw new UnsatisfiedLinkError("Unable to get link privilege to " + name);
	}
    
public voidpermissionFailureNotification(int permission)

    
public voidrequestPermission(java.lang.reflect.Method[] m, java.lang.Class[] c, java.lang.Object[][] args, int request)


	//	if (clsLoader == null) {
	    m[0] = dummyMethodRef;
	    c[0] = cls;
	    args[0] = null;

	    // Dont throw SecurityException if clsLoader is not null
	    // as we may be able to get some permissions.
// 	}
// 	else {
// 	    throw new SecurityException("DefaultSecurity : Cannot request permission");
// 	}
    
public voidrequestPermission(java.lang.reflect.Method[] m, java.lang.Class[] c, java.lang.Object[][] args, int request, java.lang.String parameter)

	requestPermission(m, c, args, request);