org.codehaus.spice.xmlpolicy.runtime
Class AbstractPolicy

java.lang.Object
  |
  +--java.security.Policy
        |
        +--org.codehaus.spice.xmlpolicy.runtime.AbstractPolicy
Direct Known Subclasses:
DefaultPolicy

public abstract class AbstractPolicy
extends Policy

Abstract Policy class that makes it easy to add permission sets to policy.

Author:
Peter Donald

Constructor Summary
AbstractPolicy()
           
 
Method Summary
protected  Permissions createPermissionSetFor(CodeSource codeSource)
          Create a set of permissions for a particular codesource.
protected  void error(String message, Throwable throwable)
          Error occured in policy.
 PermissionCollection getPermissions(CodeSource codeSource)
          Overide so we can have a per-application security policy with no side-effects to other applications.
 void refresh()
          Refresh policy.
 
Methods inherited from class java.security.Policy
getPermissions, getPolicy, implies, setPolicy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPolicy

public AbstractPolicy()
Method Detail

getPermissions

public PermissionCollection getPermissions(CodeSource codeSource)
Overide so we can have a per-application security policy with no side-effects to other applications.

Specified by:
getPermissions in class Policy
Parameters:
codeSource - the CodeSource to get permissions for
Returns:
the PermissionCollection

refresh

public void refresh()
Refresh policy. Ignored in this implementation.

Specified by:
refresh in class Policy

createPermissionSetFor

protected Permissions createPermissionSetFor(CodeSource codeSource)
Create a set of permissions for a particular codesource. These are read-write permissions and can be written till until the time in which they are applied to code.

Parameters:
codeSource - the code source
Returns:
the permission set

error

protected void error(String message,
                     Throwable throwable)
Error occured in policy. Subclasses should overide.



Copyright © 2002-2003 Codehaus. All Rights Reserved.