1 26 27 package org.objectweb.jonas_lib.security.jacc; 28 29 import java.security.CodeSource ; 30 import java.security.Permission ; 31 import java.security.PermissionCollection ; 32 import java.security.Policy ; 33 import java.security.ProtectionDomain ; 34 35 36 41 public class JPolicyWrapper extends Policy { 42 43 46 private Policy wrappedPolicy = null; 47 48 51 private static final String CLASS_NAME = "org.objectweb.jonas_lib.security.jacc.JPolicy"; 52 53 54 57 public JPolicyWrapper() { 58 super(); 59 try { 60 ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); 61 Class clazz = classLoader.loadClass(CLASS_NAME); 62 wrappedPolicy = (Policy ) clazz.newInstance(); 63 } catch (Exception e) { 64 throw new RuntimeException ("JPolicyWrapper : Error with JACC/Policy object :" + e.getMessage()); 66 } 67 } 68 69 70 73 public void refresh() { 74 wrappedPolicy.refresh(); 75 } 76 77 84 public PermissionCollection getPermissions(CodeSource codesource) { 85 return wrappedPolicy.getPermissions(codesource); 86 } 87 88 95 public PermissionCollection getPermissions(ProtectionDomain domain) { 96 return wrappedPolicy.getPermissions(domain); 97 } 98 99 107 public boolean implies(ProtectionDomain domain, Permission permission) { 108 return wrappedPolicy.implies(domain, permission); 109 } 110 111 } 112 | Popular Tags |