@Beta public class RemotePolicyProvider extends AbstractPolicy implements RemotePolicy, ScalableNestedPolicy
Policy.Parameters
Modifier and Type | Field and Description |
---|---|
private Policy |
basePolicy |
private boolean |
basePolicyIsConcurrent |
private boolean |
basePolicyIsRemote |
private Object |
grantLock |
private boolean |
loggable |
private static Logger |
logger |
private static ProtectionDomain |
policyDomain |
private PermissionCollection |
policyPermissions |
private Guard |
protectionDomainPermission |
private PermissionGrant[] |
remotePolicyGrants |
private Permission |
remotePolicyPermission |
ALL_PERMISSION, comparator, umbrella
UNSUPPORTED_EMPTY_COLLECTION
Constructor and Description |
---|
RemotePolicyProvider(Policy basePolicy)
Creates a new
RemotePolicyProvider instance that wraps
around the given non-null base policy object. |
Modifier and Type | Method and Description |
---|---|
List<PermissionGrant> |
getPermissionGrants(ProtectionDomain domain)
Returns a new List containing immutable PermissionGrant's, the
List returned is not synchronised and must not be shared with policy
internal state.
|
PermissionCollection |
getPermissions(CodeSource codesource) |
PermissionCollection |
getPermissions(ProtectionDomain domain) |
boolean |
implies(ProtectionDomain domain,
Permission permission) |
private void |
processRemotePolicyGrants(PermissionGrant[] grants)
Any grants must first be checked for PermissionGrants, checkCallerHasGrants has
been provided for this purpose, then prior to calling this method,
the PermissionGrant's must be added to the grantsCache.
|
void |
replace(PermissionGrant[] grants)
Replaces the existing RemotePolicy's PermissionGrant's.
|
checkCallerHasGrants, checkNullElements, convert, expandUmbrella, extractGrantFromPolicy, processGrants
getInstance, getInstance, getInstance, getParameters, getPolicy, getProvider, getType, refresh, setPolicy
private static final Logger logger
private static final ProtectionDomain policyDomain
private volatile PermissionGrant[] remotePolicyGrants
private final Object grantLock
private final Permission remotePolicyPermission
private final Guard protectionDomainPermission
private final Policy basePolicy
private final boolean basePolicyIsRemote
private final boolean basePolicyIsConcurrent
private final PermissionCollection policyPermissions
private final boolean loggable
public RemotePolicyProvider(Policy basePolicy)
RemotePolicyProvider
instance that wraps
around the given non-null
base policy object.basePolicy
- base policy object containing information about
non-dynamic grantsNullPointerException
- if basePolicy
is
null
public void replace(PermissionGrant[] grants) throws IOException
RemotePolicy
replace
in interface RemotePolicy
IOException
private void processRemotePolicyGrants(PermissionGrant[] grants)
grants
- public PermissionCollection getPermissions(CodeSource codesource)
getPermissions
in class Policy
public PermissionCollection getPermissions(ProtectionDomain domain)
getPermissions
in class Policy
public boolean implies(ProtectionDomain domain, Permission permission)
public List<PermissionGrant> getPermissionGrants(ProtectionDomain domain)
ScalableNestedPolicy
getPermissionGrants
in interface ScalableNestedPolicy
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.