Class SimplePolicyProvider


  • public class SimplePolicyProvider
    extends Policy
    Author:
    monzillo
    • Constructor Detail

      • SimplePolicyProvider

        public SimplePolicyProvider()
        Create a new instance of SimplePolicyProvider delegates to existing policy provider unless one is not defined, in which case it trys to load default sun provider
    • Method Detail

      • getPermissions

        public PermissionCollection getPermissions​(CodeSource codesource)
        Evaluates the global policy and returns a PermissionCollection object specifying the set of permissions allowed for code from the specified code source.
        Overrides:
        getPermissions in class Policy
        Parameters:
        codesource - the CodeSource associated with the caller. This encapsulates the original location of the code (where the code came from) and the public key(s) of its signer.
        Returns:
        the set of permissions allowed for code from codesource according to the policy.The returned set of permissions must be a new mutable instance and it must support heterogeneous Permission types.
      • getPermissions

        public PermissionCollection getPermissions​(ProtectionDomain domain)
        Evaluates the global policy and returns a PermissionCollection object specifying the set of permissions allowed given the characteristics of the protection domain.
        Overrides:
        getPermissions in class Policy
        Parameters:
        domain - the ProtectionDomain associated with the caller.
        Returns:
        the set of permissions allowed for the domain according to the policy.The returned set of permissions must be a new mutable instance and it must support heterogeneous Permission types.
        Since:
        1.4
        See Also:
        ProtectionDomain, SecureClassLoader
      • implies

        public boolean implies​(ProtectionDomain domain,
                               Permission permission)
        Evaluates the global policy for the permissions granted to the ProtectionDomain and tests whether the permission is granted.
        Overrides:
        implies in class Policy
        Parameters:
        domain - the ProtectionDomain to test
        permission - the Permission object to be tested for implication.
        Returns:
        true if "permission" is a proper subset of a permission granted to this ProtectionDomain.
        Since:
        1.4
        See Also:
        ProtectionDomain
      • refresh

        public void refresh()
        Refreshes/reloads the policy configuration. The behavior of this method depends on the implementation. For example, calling refresh on a file-based policy will cause the file to be re-read.
        Overrides:
        refresh in class Policy