Interface ncsa.horizon.util.OneWayWriteProtection
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface ncsa.horizon.util.OneWayWriteProtection

public interface OneWayWriteProtection
extends Object
an interface that allows users to temporarily update non-public data. Classes implementing this interface allow users to update non-public data via public methods until the writeProtect() method is called. From that point on, these methods throw a WriteProtectionException, indicating that the data may no longer be updated.

Classes implementing this interface should have an internal storage item (e.g. a boolean) that is set when writeProtect() is called. The methods that write data in need of protection should check the status of that item; if it is set, they should throw a WriteProtectionException.

It is not intended that implementations allow write protection to be turned off (i.e. it is one way); instead, a clone method should be defined so that the write protection on the new copy is turned off.

Thread safety should be considered when implementing this class.


Method Index

 o isWriteProtected()
return whether write protection is on
 o writeProtect()
turn on write protection

Methods

 o writeProtect
  public abstract boolean writeProtect()
turn on write protection
Returns:
whether the write protection was changed
 o isWriteProtected
  public abstract boolean isWriteProtected()
return whether write protection is on

All Packages  Class Hierarchy  This Package  Previous  Next  Index