Class PermissionCacheFactory


  • public class PermissionCacheFactory
    extends Object
    This class is the factory for creating and managing PermissionCache.
    Author:
    Shing Wai Chan
    • Constructor Detail

      • PermissionCacheFactory

        public PermissionCacheFactory()
    • Method Detail

      • createPermissionCache

        public static PermissionCache createPermissionCache​(String pcID,
                                                            CodeSource codesource,
                                                            Permission[] perms,
                                                            String name)
        Create a PermissionCache object. If the corresponding object exists, then it will overwrite the previous one.
        Parameters:
        pcID - - a string identifying the policy context and which must be set when getPermissions is called (internally). This value may be null, in which case the permisions of the default policy context will be cached.
        codesource - - the codesource argument to be used in the call to getPermissions. This value may be null.
        perms - - an array of Permission objects identifying the permission types that will be managed by the cache. This value may be null, in which case all permissions obtained by the getPermissions call will be cached.
        name - - a string corresponding to a value returned by Permission.getName() only permissions whose getName() value matches the name parameter will be included in the cache. This value may be null, in which case permission name dos not factor into the permission caching.
      • createPermissionCache

        public static PermissionCache createPermissionCache​(String pcID,
                                                            CodeSource codesource,
                                                            Class clazz,
                                                            String name)
        Create a PermissionCache object. If the corresponding object exists, then it will overwrite the previous one.
        Parameters:
        pcID - - a string identifying the policy context and which must be set when getPermissions is called (internally). This value may be null, in which case the permisions of the default policy context will be cached.
        codesource - - the codesource argument to be used in the call to getPermissions. This value may be null.
        clazz - - a class object identifying the permission type that will be managed by the cache. This value may be null, in which case all permissions obtained by the getPermissions call will be cached.
        name - - a string corresponding to a value returned by Permission.getName() only permissions whose getName() value matches the name parameter will be included in the cache. This value may be null, in which case permission name dos not factor into the permission caching.
      • resetCaches

        public static void resetCaches()
        This resets all caches inside the factory.