com.ibm.oti.shared

Class SharedClassPermission

  1. java.lang.Object
  2. extended byjava.security.Permission
  3. extended byjava.security.BasicPermission
  4. extended bycom.ibm.oti.shared.SharedClassPermission
All implemented interfaces:
java.io.Serializable, java.security.Guard

  1. public class SharedClassPermission
  2. 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

Constructor and Description
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

Modifier and Type Method and Description
  1. 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.
  1. java.lang.String
getActions()
Answers the actions associated with the receiver.
  1. int
hashCode()
Answers an integer hash code for the receiver.
  1. boolean
implies(java.security.Permission permission)
Indicates whether the argument permission is implied by the receiver.
  1. 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
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

SharedClassPermission

  1. public SharedClassPermission(java.lang.ClassLoader loader,
  2. 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

  1. public SharedClassPermission(java.lang.String classLoaderClassName,
  2. 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

  1. 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:

newPermissionCollection

  1. 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

  1. 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:

getActions

  1. 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

  1. 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.