com.sun.jini.phoenix
Class ExecOptionPermission

java.lang.Object
  extended by java.security.Permission
      extended by com.sun.jini.phoenix.ExecOptionPermission
All Implemented Interfaces:
Serializable, Guard

public final class ExecOptionPermission
extends Permission

Represents permission to use a specific option or options in the command for creating an activation group. An instance of this class contains a name (also referred to as a "target name") but no actions list; you either have the named permission or you don't. The target name can be any of the following forms:

 "literal"
 literal*
 literal{fpname}
 string
 
A target name is parsed according to the first form (in the order given above) that it matches. A literal is zero or more arbitrary characters. An fpname is zero or more characters, none of which are '{'. A string is zero or more arbitrary characters that do not match any of the previous forms.

An option option matches a target name of the form "literal" if option is equal to literal.

An option option matches a target name of the form literal* if option starts with literal.

An option option matches a target name of the form literal{fpname} if option starts with literal and the remainder of option matches fpname according to the matching semantics defined by FilePermission; that is, if a FilePermission created with target name fpname (and some actions) implies a FilePermission created with the remainder of option (and the same actions).

An option option matches a target name of the form string if option is equal to string.

Since:
2.0
Author:
Sun Microsystems, Inc.
See Also:
Serialized Form

Constructor Summary
ExecOptionPermission(String name)
          Constructs an instance with the specified name.
 
Method Summary
 boolean equals(Object obj)
          Two instances of this class are equal if each implies the other; that is, every option that matches the name of one instance matches the name of the other instance.
 String getActions()
          Returns the empty string.
 int hashCode()
          Returns a hash code value for this object.
 boolean implies(Permission p)
          Returns true if the specified permission is an instance of ExecOptionPermission and every option that matches the name of specified permission also matches the name of this permission; returns false otherwise.
 
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

ExecOptionPermission

public ExecOptionPermission(String name)
Constructs an instance with the specified name.

Parameters:
name - the target name
Throws:
NullPointerException - if the name is null
Method Detail

implies

public boolean implies(Permission p)
Returns true if the specified permission is an instance of ExecOptionPermission and every option that matches the name of specified permission also matches the name of this permission; returns false otherwise.

Specified by:
implies in class Permission
Parameters:
p - the permission to check
Returns:
true if the specified permission is an instance of ExecOptionPermission and every option that matches the name of specified permission also matches the name of this permission; false otherwise

equals

public boolean equals(Object obj)
Two instances of this class are equal if each implies the other; that is, every option that matches the name of one instance matches the name of the other instance.

Specified by:
equals in class Permission

hashCode

public int hashCode()
Returns a hash code value for this object.

Specified by:
hashCode in class Permission

getActions

public String getActions()
Returns the empty string.

Specified by:
getActions in class Permission


Copyright 2007, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.