Class JNLPPolicy


  • public class JNLPPolicy
    extends java.security.Policy
    Policy for JNLP environment. This class delegates to the system policy but always grants permissions to the JNLP code and system CodeSources (no separate policy file needed). This class may also grant permissions to applications at runtime if approved by the user.
    Version:
    $Revision: 1.7 $
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.security.Policy

        java.security.Policy.Parameters
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.net.URI jreExtDir  
      private static Logger LOG  
      private static java.security.CodeSource shellSource
      classes from this source have all permissions
      private java.security.Policy systemJnlpPolicy
      the system level policy for jnlps
      private static java.security.Policy systemPolicy
      the previous policy
      private static java.security.CodeSource systemSource
      classes from this source have all permissions
      private java.security.Policy userJnlpPolicy
      the user-level policy for jnlps
      • Fields inherited from class java.security.Policy

        UNSUPPORTED_EMPTY_COLLECTION
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected JNLPPolicy()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private java.security.Permissions getAllPermissions()
      Return an all-permissions collection.
      java.security.PermissionCollection getPermissions​(java.security.CodeSource source)
      Return a mutable, heterogeneous-capable permission collection for the source.
      private java.security.Policy getPolicyFromConfig​(java.lang.String key)
      Constructs a delegate policy based on a config setting
      private java.security.Policy getPolicyFromUrl​(java.lang.String policyLocation)
      Loads a policy from a URI
      boolean implies​(java.security.ProtectionDomain domain, java.security.Permission permission)  
      private boolean isSystemJar​(java.security.CodeSource source)
      Returns true if the CodeSource corresponds to a system jar.
      void refresh()
      Refresh.
      • Methods inherited from class java.security.Policy

        getInstance, getInstance, getInstance, getParameters, getPermissions, getPolicy, getProvider, getType, setPolicy
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOG

        private static final Logger LOG
      • shellSource

        private static java.security.CodeSource shellSource
        classes from this source have all permissions
      • systemSource

        private static java.security.CodeSource systemSource
        classes from this source have all permissions
      • systemPolicy

        private static java.security.Policy systemPolicy
        the previous policy
      • jreExtDir

        private final java.net.URI jreExtDir
      • systemJnlpPolicy

        private java.security.Policy systemJnlpPolicy
        the system level policy for jnlps
      • userJnlpPolicy

        private java.security.Policy userJnlpPolicy
        the user-level policy for jnlps
    • Constructor Detail

      • JNLPPolicy

        protected JNLPPolicy()
    • Method Detail

      • getPermissions

        public java.security.PermissionCollection getPermissions​(java.security.CodeSource source)
        Return a mutable, heterogeneous-capable permission collection for the source.
        Overrides:
        getPermissions in class java.security.Policy
      • refresh

        public void refresh()
        Refresh.
        Overrides:
        refresh in class java.security.Policy
      • getAllPermissions

        private java.security.Permissions getAllPermissions()
        Return an all-permissions collection.
      • isSystemJar

        private boolean isSystemJar​(java.security.CodeSource source)
        Returns true if the CodeSource corresponds to a system jar. That is, it's part of the JRE.
      • getPolicyFromConfig

        private java.security.Policy getPolicyFromConfig​(java.lang.String key)
        Constructs a delegate policy based on a config setting
        Parameters:
        key - a KEY_* in DeploymentConfiguration
        Returns:
        a policy based on the configuration set by the user
      • getPolicyFromUrl

        private java.security.Policy getPolicyFromUrl​(java.lang.String policyLocation)
        Loads a policy from a URI
        Parameters:
        policyLocation - the URI of the policy
        Returns:
        a policy based on the configuration set by the user
      • implies

        public boolean implies​(java.security.ProtectionDomain domain,
                               java.security.Permission permission)
        Overrides:
        implies in class java.security.Policy