com.ibm.oti.shared
Class SharedClassPermission

java.lang.Object
  extended by java.security.Permission
      extended by java.security.BasicPermission
          extended by com.ibm.oti.shared.SharedClassPermission
All Implemented Interfaces:
java.io.Serializable, java.security.Guard

public class SharedClassPermission
extends java.security.BasicPermission

Security permission to govern classloader access to the shared class cache.

Usage: To grant permission to a classloader, add permission in java.policy file.
Eg. com.ibm.oti.shared.SharedClassPermission "classloaders.myClassLoader", "read,write";

"read" allows a classloader to load classes from the shared cache
"write" allows a classloader to add classes to the shared cache

Version:
initial
Author:
OTI
See Also:
Serialized Form

Constructor Summary
SharedClassPermission(java.lang.ClassLoader loader, java.lang.String actions)
          Constructs a new instance of this class.
SharedClassPermission(java.lang.String classLoaderClassName, java.lang.String actions)
          Constructs a new instance of this class.
 
Method Summary
 boolean equals(java.lang.Object o)
          Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.
 java.lang.String getActions()
          Answers the actions associated with the receiver.
 int hashCode()
          Answers an integer hash code for the receiver.
 boolean implies(java.security.Permission permission)
          Indicates whether the argument permission is implied by the receiver.
 java.security.PermissionCollection newPermissionCollection()
          Answers a new PermissionCollection for holding permissions of this class.
 
Methods inherited from class java.security.Permission
checkGuard, getName, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SharedClassPermission

public SharedClassPermission(java.lang.ClassLoader loader,
                             java.lang.String actions)
Constructs a new instance of this class.

Parameters:
loader - java.lang.ClassLoader the ClassLoader requiring the permission.
actions - java.lang.String the actions which are applicable to it.

SharedClassPermission

public SharedClassPermission(java.lang.String classLoaderClassName,
                             java.lang.String actions)
Constructs a new instance of this class.

Parameters:
classLoaderClassName - java.lang.String the className of the ClassLoader requiring the permission.
actions - java.lang.String the actions which are applicable to it.
Method Detail

equals

public boolean equals(java.lang.Object o)
Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison. In this case, the receiver must be for the same property as the argument, and must have the same actions.

Overrides:
equals in class java.security.BasicPermission
Parameters:
o - the object to compare with this object
Returns:
true if the object is the same as this object false if it is different from this object
See Also:
hashCode()

newPermissionCollection

public java.security.PermissionCollection newPermissionCollection()
Answers a new PermissionCollection for holding permissions of this class. Answer null if any permission collection can be used.

Overrides:
newPermissionCollection in class java.security.BasicPermission
Returns:
a new PermissionCollection or null
See Also:
BasicPermissionCollection

hashCode

public int hashCode()
Answers an integer hash code for the receiver. Any two objects which answer true when passed to equals must answer the same value for this method.

Overrides:
hashCode in class java.security.BasicPermission
Returns:
the receiver's hash
See Also:
equals(java.lang.Object)

getActions

public java.lang.String getActions()
Answers the actions associated with the receiver. The result will be either "read", "write", or "read,write".

Overrides:
getActions in class java.security.BasicPermission
Returns:
String the actions associated with the receiver.

implies

public boolean implies(java.security.Permission permission)
Indicates whether the argument permission is implied by the receiver.

Overrides:
implies in class java.security.BasicPermission
Parameters:
permission - java.security.Permission the permission to check
Returns:
boolean true if the argument permission is implied by the receiver, and false if it is not.