Class 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
    • Constructor Detail

      • DelegatingPolicy

        public DelegatingPolicy()
      • DelegatingPolicy

        public DelegatingPolicy​(Policy delegate)
    • Method Detail

      • getExternalPermissionTypes

        public Class<?>[] getExternalPermissionTypes()
      • setExternalPermissionTypes

        public void setExternalPermissionTypes​(Class<?>[] externalPermissionTypes)
      • 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
      • 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