/* * @(#) Verifiable.java - Interface for object self-integrity check. * (c) 2000 Ivan Maidanski http://ivmai.chat.ru * Freeware class library sources. All rights reserved. ** * Language: Java [pure] * Tested with: JDK v1.1.6 * Last modified: 2000-12-15 11:40:00 GMT+03:00 */ /* * This software is the proprietary information of the author. ** * Permission to use, copy, and distribute this software and its * documentation for non-commercial purposes and without fee is * hereby granted provided that this copyright notice appears in all * copies. ** * This software should not be modified in any way; any found bug * should be reported to the author. ** * The author disclaims all warranties with regard to this software, * including all implied warranties of merchantability and fitness. * In no event shall the author be liable for any special, indirect * or consequential damages or any damages whatsoever resulting from * loss of use, data or profits, whether in an action of contract, * negligence or other tortuous action, arising out of or in * connection with the use or performance of this software. */ package ivmai.util; /** * Interface for object self-integrity check. ** * A class implementing this interface gives the programmer (or, * mainly, the debugger) the opportunity to check the consistency of * internal structures of the object of such class. If there is * nothing to check in some class then the class should not * implement this interface. ** * @version 2.0 * @author Ivan Maidanski ** * @since 2.0 */ public interface Verifiable { /** * Verifies this object for its integrity. ** * This method is mostly used for debug purpose only. By default, * deep integrity (internal consistency) check is performed (that * is, all variable fields of this object are verified * too). Internal state of object is not altered. If internal * consistency is violated somehow (due to an error in Java VM or * due to a programmer error) then InternalError is * thrown (with some detailed message). Important notes: * static final fields should not be checked. This * method should be synchronized outside (unless the object is not * mutable). ** * @exception InternalError * if integrity violation is detected. */ public abstract void integrityCheck(); }