Class SharedClassPermission

All Implemented Interfaces:
Serializable, Guard

public class SharedClassPermission extends BasicPermission
SharedClassPermission provides security permission to govern ClassLoader access to the shared class cache.

Usage: To grant permission to a ClassLoader, add permission in the java.policy file. For example,

  com.ibm.oti.shared.SharedClassPermission "classloaders.myClassLoader", "read,write";
Possible actions are:
  • "read" allows a ClassLoader to load classes from the shared cache
  • "write" allows a ClassLoader to add classes to the shared cache
See Also:
  • Constructor Details

    • SharedClassPermission

      public SharedClassPermission(ClassLoader loader, String actions)
      Constructs a new instance of this class.
      Parameters:
      loader - ClassLoader the ClassLoader requiring the permission
      actions - String the actions which are applicable to it
    • SharedClassPermission

      public SharedClassPermission(String classLoaderClassName, String actions)
      Constructs a new instance of this class.
      Parameters:
      classLoaderClassName - String the name of the ClassLoader class requiring the permission
      actions - String the actions which are applicable to it
  • Method Details

    • equals

      public boolean equals(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 BasicPermission
      Parameters:
      o - the object to compare with this object
      Returns:
      boolean true if the object is the same as this object, false if it is different from this object
      See Also:
    • newPermissionCollection

      public PermissionCollection newPermissionCollection()
      Answers a new PermissionCollection for holding permissions of this class.
      Overrides:
      newPermissionCollection in class BasicPermission
      Returns:
      a new PermissionCollection
      See Also:
    • hashCode

      public int hashCode()
      Answers the 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 BasicPermission
      Returns:
      the receiver's hash code
      See Also:
    • getActions

      public String getActions()
      Answers the actions associated with the receiver.

      The result will be either "read", "write", or "read,write".

      Overrides:
      getActions in class BasicPermission
      Returns:
      String the actions associated with the receiver
    • implies

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