public class SimplePolicyProvider extends Policy
Policy.Parameters
UNSUPPORTED_EMPTY_COLLECTION
Constructor and Description |
---|
SimplePolicyProvider()
Create a new instance of SimplePolicyProvider
Delegates to existing policy provider
|
Modifier and Type | Method and Description |
---|---|
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.
|
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.
|
boolean |
implies(ProtectionDomain domain,
Permission permission)
Evaluates the global policy for the permissions granted to the ProtectionDomain and tests whether the permission is
granted.
|
void |
refresh()
Refreshes/reloads the policy configuration.
|
getInstance, getInstance, getInstance, getParameters, getPolicy, getProvider, getType, setPolicy
public SimplePolicyProvider()
public PermissionCollection getPermissions(CodeSource codesource)
getPermissions
in class Policy
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.public PermissionCollection getPermissions(ProtectionDomain domain)
getPermissions
in class Policy
domain
- the ProtectionDomain associated with the caller.ProtectionDomain
,
SecureClassLoader
public boolean implies(ProtectionDomain domain, Permission permission)
implies
in class Policy
domain
- the ProtectionDomain to testpermission
- the Permission object to be tested for implication.ProtectionDomain
Copyright © 2019. All rights reserved.