/** Allows subclasses to discard the object. When an object is discarded, * it is released from the list of objects registered in the system. * Then the contents of the parent folder (if it still exists) are rescanned, which * may result in the creation of a new data object for the primary file. * <P> * The normal use of this method is to change the type of a data object. * Because this would usually only be invoked from * the original data object, it is protected. */ protected void dispose () { DataObjectPool.Item item = this.item; if (item != null) { item.deregister (true); item.setDataObject(null); firePropertyChange (PROP_VALID, Boolean.TRUE, Boolean.FALSE); } }
/** Private constructor. At this time the constructor receives * the primary file and pool item where it should register itself. * * @param pf primary file * @param item the item to register into * @param loader loader that created the data object */ private DataObject (FileObject pf, DataObjectPool.Item item, DataLoader loader) { this.item = item; this.loader = loader; item.setDataObject (this); }
public void run () throws IOException { handleDelete (); item.deregister(false); item.setDataObject(null); } });