org.jboss.security.jacc
Class DelegatingPolicy

java.lang.Object
  extended by java.security.Policy
      extended by 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: 57203 $
Author:
Scott.Stark@jboss.org

Constructor Summary
DelegatingPolicy()
           
DelegatingPolicy(Policy delegate)
           
 
Method Summary
 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 instances
 void 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
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(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 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.

Specified by:
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.

Specified by:
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


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.