org.jboss.security.jacc
Class DelegatingPolicy

java.lang.Object
  extended byjava.security.Policy
      extended byorg.jboss.security.jacc.DelegatingPolicy

public class DelegatingPolicy
extends java.security.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.


Constructor Summary
DelegatingPolicy()
           
DelegatingPolicy(java.security.Policy delegate)
           
 
Method Summary
 void commit(java.lang.String contextID)
          May need to make this synchronized to allow the move from the open to active policy map atomic.
 void delete(java.lang.String contextID)
           
static DelegatingPolicy (src) getInstance()
           
 java.security.PermissionCollection getPermissions(java.security.CodeSource cs)
          Return the permission collection associated with the cs.
 java.security.PermissionCollection getPermissions(java.security.ProtectionDomain domain)
           
 java.security.Policy getPolicyProxy()
           
 boolean implies(java.security.ProtectionDomain domain, java.security.Permission permission)
           
 java.lang.String listContextPolicies()
          Access the current ContextPolicy instances
 void refresh()
          We dynamically manage the active policies on commit so refresh is a noop.
 
Methods inherited from class java.security.Policy
getPolicy, setPolicy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegatingPolicy

public DelegatingPolicy()

DelegatingPolicy

public DelegatingPolicy(java.security.Policy delegate)
Method Detail

getInstance

public static DelegatingPolicy (src)  getInstance()

getPermissions

public java.security.PermissionCollection getPermissions(java.security.ProtectionDomain domain)

implies

public boolean implies(java.security.ProtectionDomain domain,
                       java.security.Permission permission)

getPermissions

public java.security.PermissionCollection getPermissions(java.security.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.

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.


getPolicyProxy

public java.security.Policy getPolicyProxy()
Returns:
A proxy for our Policy interface

listContextPolicies

public java.lang.String listContextPolicies()
Access the current ContextPolicy instances

Returns:
Map of the contextID to policy mappings

commit

public void commit(java.lang.String contextID)
            throws PolicyContextException (src) 
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:
PolicyContextException (src)

delete

public void delete(java.lang.String contextID)
            throws PolicyContextException (src) 
Throws:
PolicyContextException (src)