1 23 package com.sun.enterprise.security; 24 25 import java.security.Permission ; 26 import com.sun.enterprise.security.CachedPermission; 27 import com.sun.enterprise.security.PermissionCache; 28 32 33 public class CachedPermissionImpl extends Object implements CachedPermission { 34 35 PermissionCache permissionCache; 36 Permission permission; 37 boolean granted; 38 Epoch epoch; 39 40 public CachedPermissionImpl(PermissionCache c, Permission p) { 41 this.permissionCache = c; 42 this.permission = p; 43 epoch = new Epoch(); 44 } 45 46 public Permission getPermission() { 47 return this.permission; 48 } 49 50 public PermissionCache getPermissionCache() { 51 return this.permissionCache; 52 } 53 54 public boolean checkPermission() { 56 boolean granted = false; 57 if (permissionCache != null) { 58 granted = permissionCache.checkPermission(this.permission,this.epoch); 59 } 60 return granted; 61 } 62 63 class Epoch { 66 67 int epoch; 68 boolean granted; 69 70 Epoch() { 71 this.epoch = 0; 72 this.granted = false; 73 } 74 } 75 76 } 77 78 79 80 | Popular Tags |