Package org.jboss.security.jacc
Class DelegatingPolicy
- java.lang.Object
-
- java.security.Policy
-
- org.jboss.security.jacc.DelegatingPolicy
-
public class DelegatingPolicy extends Policy
A JAAC Policy provider implementation that delegates any non-JACC permissions to the java.security.Policy either passed in to the ctor, or the pre existing Policy.getPolicy value.- Version:
- $Revision$
- Author:
- Scott.Stark@jboss.org
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.security.Policy
Policy.Parameters
-
-
Field Summary
-
Fields inherited from class java.security.Policy
UNSUPPORTED_EMPTY_COLLECTION
-
-
Constructor Summary
Constructors Constructor Description DelegatingPolicy()
DelegatingPolicy(Policy delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
commit(String contextID)
May need to make this synchronized to allow the move from the open to active policy map atomic.void
delete(String contextID)
Class<?>[]
getExternalPermissionTypes()
static DelegatingPolicy
getInstance()
PermissionCollection
getPermissions(CodeSource cs)
Return the permission collection associated with the cs.PermissionCollection
getPermissions(ProtectionDomain domain)
Policy
getPolicyProxy()
boolean
implies(ProtectionDomain domain, Permission permission)
String
listContextPolicies()
Access the current ContextPolicy instancesvoid
refresh()
We dynamically manage the active policies on commit so refresh is a noop.void
setExternalPermissionTypes(Class<?>[] externalPermissionTypes)
-
Methods inherited from class java.security.Policy
getInstance, getInstance, getInstance, getParameters, getPolicy, getProvider, getType, setPolicy
-
-
-
-
Constructor Detail
-
DelegatingPolicy
public DelegatingPolicy()
-
DelegatingPolicy
public DelegatingPolicy(Policy delegate)
-
-
Method Detail
-
getInstance
public static DelegatingPolicy getInstance()
-
getExternalPermissionTypes
public Class<?>[] getExternalPermissionTypes()
-
setExternalPermissionTypes
public void setExternalPermissionTypes(Class<?>[] externalPermissionTypes)
-
getPermissions
public PermissionCollection getPermissions(ProtectionDomain domain)
- Overrides:
getPermissions
in classPolicy
-
implies
public boolean implies(ProtectionDomain domain, Permission permission)
-
getPermissions
public PermissionCollection getPermissions(CodeSource cs)
Return the permission collection associated with the cs. If there is no active JACC PolicyContext then the delegate value for getPermissions(CodeSource) is returned. Otherwise the JACC policy context permissions are returned.- Overrides:
getPermissions
in classPolicy
- Parameters:
cs
- - the CodeSource- Returns:
- the associated permission collection
-
refresh
public void refresh()
We dynamically manage the active policies on commit so refresh is a noop. Its not clear from the spec whether committed policies should not be visible until a refresh.
-
listContextPolicies
public String listContextPolicies()
Access the current ContextPolicy instances- Returns:
- Map
of the contextID to policy mappings
-
getPolicyProxy
public Policy getPolicyProxy()
- Returns:
- A proxy for our Policy interface
-
commit
public void commit(String contextID) throws javax.security.jacc.PolicyContextException
May need to make this synchronized to allow the move from the open to active policy map atomic. Right now the assumption is that a single thread is active for a given contextID.- Parameters:
contextID
-- Throws:
javax.security.jacc.PolicyContextException
-
delete
public void delete(String contextID) throws javax.security.jacc.PolicyContextException
- Throws:
javax.security.jacc.PolicyContextException
-
-