Interface Protectable

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void disableAccess()
      Disable previous access to the object for modifications on the current thread.
      void enableAccess​(java.lang.Object protectKey)
      Enable access to the object for modifications on the current thread.
      void protect​(java.lang.Object protectionKey)
      Protect this object from modifications.
      void unprotect​(java.lang.Object protectionKey)
      Allows the object to be modified if the protectionKey matches the key used to protect the object.
    • Method Detail

      • protect

        void protect​(java.lang.Object protectionKey)
              throws java.lang.SecurityException
        Protect this object from modifications.
        Parameters:
        protectionKey - the key used to protect the object.
        Throws:
        java.lang.SecurityException - if the object is already protected.
      • unprotect

        void unprotect​(java.lang.Object protectionKey)
                throws java.lang.SecurityException
        Allows the object to be modified if the protectionKey matches the key used to protect the object.
        Parameters:
        protectionKey - the key used to protect the object.
        Throws:
        java.lang.SecurityException - if the object is protected and the key doesn't match.
      • enableAccess

        void enableAccess​(java.lang.Object protectKey)
        Enable access to the object for modifications on the current thread.
        Parameters:
        protectKey - the key used to protect modifications.
      • disableAccess

        void disableAccess()
        Disable previous access to the object for modifications on the current thread.