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: 86122 $
- Author:
- Scott.Stark@jboss.org
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DelegatingPolicy
public DelegatingPolicy()
DelegatingPolicy
public DelegatingPolicy(Policy delegate)
getInstance
public static DelegatingPolicy getInstance()
getExternalPermissionTypes
public Class<?>[] getExternalPermissionTypes()
setExternalPermissionTypes
public void setExternalPermissionTypes(Class<?>[] externalPermissionTypes)
getPermissions
public PermissionCollection getPermissions(ProtectionDomain domain)
- Overrides:
getPermissions
in class Policy
implies
public boolean implies(ProtectionDomain domain,
Permission permission)
- Overrides:
implies
in class Policy
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 class Policy
- 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.
- Overrides:
refresh
in class Policy
getPolicyProxy
public Policy getPolicyProxy()
- Returns:
- A proxy for our Policy interface
listContextPolicies
public String listContextPolicies()
- Access the current ContextPolicy instances
- Returns:
- Map of the contextID to policy mappings
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
getPermissionsForRole
protected Permissions getPermissionsForRole(String role)
throws javax.security.jacc.PolicyContextException
- Throws:
javax.security.jacc.PolicyContextException
Copyright © 2009 JBoss Inc.. All Rights Reserved.