net.larsan.norna.util
Class ThreadScopePermission

java.lang.Object
  |
  +--java.security.Permission
        |
        +--net.larsan.norna.util.ThreadScopePermission
All Implemented Interfaces:
java.security.Guard, java.io.Serializable

public class ThreadScopePermission
extends java.security.Permission

This permission is used to limit the access to the ThreadScope. Any attempt to use the thread scope without it will fail.

This permission takes an empty tager and can handle four different actions:

      "enter, exit, current, clear"
 
The action guard the use of the methods with their name on the ThreadScope. Usually a service is granted the following permission when loaded:
      net.larsan.norna.util.ThreadScopePermission "", "enter,exit,current";
 
The action can be specified as "*" for a blanket permission.

Version:
Alpha-0.2 / 2002-10-06 21:37
Author:
Lars J. Nilsson
See Also:
ThreadScope, Serialized Form

Constructor Summary
ThreadScopePermission(java.lang.String action)
          Create permission without a target.
ThreadScopePermission(java.lang.String target, java.lang.String action)
          Create permission.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Check equality on target name and actions.
 java.lang.String getActions()
          Get the actions of this permission.
 int hashCode()
          Get hash code based on target name and actions
 boolean implies(java.security.Permission perm)
          Check if a permission is 'implied' by this permission.
 
Methods inherited from class java.security.Permission
checkGuard, getName, newPermissionCollection, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ThreadScopePermission

public ThreadScopePermission(java.lang.String target,
                             java.lang.String action)
Create permission. The target is not used and the action is the methds on the ThreadScope the permission is about.

Parameters:
target - Target for the permission, not used
action - Permitted method, e.g. enter, exit, clear or current, or "*" for blanket permission

ThreadScopePermission

public ThreadScopePermission(java.lang.String action)
Create permission without a target. The target is not used and the action is the methds on the ThreadScope the permission is about.

Parameters:
action - Permitted method, e.g. enter, exit, clear or current, or "*" for blanket permission
Method Detail

implies

public boolean implies(java.security.Permission perm)
Check if a permission is 'implied' by this permission.

Specified by:
implies in class java.security.Permission

getActions

public java.lang.String getActions()
Get the actions of this permission.

Specified by:
getActions in class java.security.Permission
Returns:
The actions of this permission

equals

public boolean equals(java.lang.Object obj)
Check equality on target name and actions.

Specified by:
equals in class java.security.Permission

hashCode

public int hashCode()
Get hash code based on target name and actions

Specified by:
hashCode in class java.security.Permission