1 /** 2 * com.mckoi.database.MasterTableListener 28 Aug 2002 3 * 4 * Mckoi SQL Database ( http://www.mckoi.com/database ) 5 * Copyright (C) 2000, 2001, 2002 Diehl and Associates, Inc. 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * Version 2 as published by the Free Software Foundation. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License Version 2 for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * Version 2 along with this program; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 * 20 * Change Log: 21 * 22 * 23 */ 24 25 package com.mckoi.database; 26 27 /** 28 * An interface that is notified of add/remove events on a 29 * MasterTableDataSource. The purpose of this interface is so that a high level 30 * function can listen for changes to the underlying table and cache high 31 * level representations of the rows as appropriate. 32 * 33 * @author Tobias Downer 34 */ 35 36 interface MasterTableListener { 37 38 /** 39 * Notifies of a new row addition to the underlying representation. Note 40 * that this addition doesn't necessarily mean that the change is a committed 41 * change. There is no way to tell if a change is committed or not. 42 * <p> 43 * SYNCHRONIZATION ISSUE: Note that extreme care should be taken with 44 * deadlock issues with this method. This is a call-back from 45 * MasterTableDataSource when its monikor is in a synchronized state. This 46 * means there is potential for deadlock if care is not taken. Listeners of 47 * this should event should not try and inspect the state of the database. 48 */ 49 void rowAdded(int row_number, RowData row_data); 50 51 /** 52 * Notifies that a row has been permanently removed from the underlying 53 * representation. This means the row has been committed removed and the 54 * table row garbage collector has decided it is eligible to be recycled. 55 * <p> 56 * Normally the garbage collector thread will notify of this event. 57 * <p> 58 * SYNCHRONIZATION ISSUE: Note that extreme care should be taken with 59 * deadlock issues with this method. This is a call-back from 60 * MasterTableDataSource when its monikor is in a synchronized state. This 61 * means there is potential for deadlock if care is not taken. Listeners of 62 * this should event should not try and inspect the state of the database. 63 */ 64 void rowRemoved(int row_number); 65 66 } 67 68