com.ibm.oti.shared

Class SharedClassPermission

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


    public class SharedClassPermission
    extends java.security.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";

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

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      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

        clone, finalize, 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:
        PermissionCollection
      • 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.

© Copyright IBM Corporation 1998, 2019. All Rights Reserved.