public class SimpleCachingHive extends BasicHive
BasicHive. If you want more control over your
cache you could for example use EHCache and extend BasicHive yourself. This cache is cleared when
a subject logs off but no guarantees are given that the cache will not be cleared prematurely or
how long it takes after a user logs off to clear the cached results.| Constructor and Description |
|---|
SimpleCachingHive() |
| Modifier and Type | Method and Description |
|---|---|
protected Boolean |
cacheLookUp(Subject subject,
Permission permission)
Allows subclasses to retrieve previously cached results and thus speed up the check.
|
protected void |
cacheResult(Subject subject,
Permission permission,
boolean result)
Allows subclasses to cache the result of a check and thus speed up this check the next time.
|
addPermission, addPrincipal, containsPermission, containsPrincipal, getPermissions, getPrincipals, hasPermission, isLocked, lockprotected Boolean cacheLookUp(Subject subject, Permission permission)
BasicHivecacheLookUp in class BasicHivesubject - (optional) subjectpermission - the permission to checkprotected void cacheResult(Subject subject, Permission permission, boolean result)
BasicHivecacheResult in class BasicHivesubject - (optional) subjectpermission - the permission to checkresult - the result of the permissionCopyright © 2015. All rights reserved.