org.objectweb.jonas_lib.security.jacc
Class JPolicyWrapper

java.lang.Object
  extended byjava.security.Policy
      extended byorg.objectweb.jonas_lib.security.jacc.JPolicyWrapper

public class JPolicyWrapper
extends java.security.Policy

Wrapper to the JPolicy class. This is used to instantiate the real Policy object by using Thread classloader.

Author:
Florent Benoit

Constructor Summary
JPolicyWrapper()
          Default constructor
 
Method Summary
 java.security.PermissionCollection getPermissions(java.security.CodeSource codesource)
          Evaluates the global policy and returns a PermissionCollection object specifying the set of permissions allowed given the characteristics of the protection domain.
 java.security.PermissionCollection getPermissions(java.security.ProtectionDomain domain)
          Evaluates the global policy and returns a PermissionCollection object specifying the set of permissions allowed given the characteristics of the protection domain.
 boolean implies(java.security.ProtectionDomain domain, java.security.Permission permission)
          Evaluates the global policy for the permissions granted to the ProtectionDomain and tests whether the permission is granted.
 void refresh()
          Refreshes/reloads the policy configuration.
 
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

JPolicyWrapper

public JPolicyWrapper()
Default constructor

Method Detail

refresh

public void refresh()
Refreshes/reloads the policy configuration.


getPermissions

public java.security.PermissionCollection getPermissions(java.security.CodeSource codesource)
Evaluates the global policy and returns a PermissionCollection object specifying the set of permissions allowed given the characteristics of the protection domain.

Parameters:
codesource - the given codesource on which retrieve permissions
Returns:
permissions

getPermissions

public java.security.PermissionCollection getPermissions(java.security.ProtectionDomain domain)
Evaluates the global policy and returns a PermissionCollection object specifying the set of permissions allowed given the characteristics of the protection domain.

Parameters:
domain - the given domain on which retrieve permissions
Returns:
permissions

implies

public boolean implies(java.security.ProtectionDomain domain,
                       java.security.Permission permission)
Evaluates the global policy for the permissions granted to the ProtectionDomain and tests whether the permission is granted.

Parameters:
domain - the ProtectionDomain to test.
permission - the Permission object to be tested for implication.
Returns:
true if "permission" is a proper subset of a permission granted to this ProtectionDomain.