1 28 29 package com.caucho.security; 30 31 import com.caucho.config.ConfigException; 32 import com.caucho.config.types.InstantiationConfig; 33 import com.caucho.log.Log; 34 import com.caucho.util.L10N; 35 36 import java.security.Permission ; 37 import java.util.logging.Logger ; 38 39 42 public class PermissionConfig { 43 static final Logger log = Log.open(PermissionConfig.class); 44 static final L10N L = new L10N(PermissionConfig.class); 45 46 private InstantiationConfig _type; 47 48 private Permission _perm; 49 50 53 public void setType(InstantiationConfig type) 54 throws ConfigException 55 { 56 if (! Permission .class.isAssignableFrom(type.getType())) 57 throw new ConfigException(L.l("`{0}' must extend java.security.Permission", 58 type)); 59 60 _type = type; 61 } 62 63 66 public void addArg(Object obj) 67 { 68 _type.addArg(obj); 69 } 70 71 74 public void init() 75 throws Exception 76 { 77 _perm = (Permission ) _type.create(); 78 } 79 80 83 public Permission getPermission() 84 { 85 return _perm; 86 } 87 88 } 89 | Popular Tags |