/*  PAT: Persistent Applications Toolkit (patsystem.sf.net)
 *  Copyright (C) 2004, 2005  Tomasz Nazar, nthx at irc dot pl
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 *  Full version of the license is /docs/LICENSE.txt
 */
package org.nthx.pat;

/** A facade to some global PAT features.
 * 
 *  <p>This interface is introduced into root object (@@ pat.root), so it is 
 *  possible to execute code like this:
 *  <pre>
 *  {
 *      ((Persisteble)myRoot).takeSnapshot();
 *  }
 *  </pre> 
 *  <p>This is part of public API. 
 *
 *  @version $Id: Persisteble.java 3725 2005-06-09 23:57:03Z nthx $
 *  @author nthx@users.sourceforge.net
 */
public interface Persisteble
{
    /** Takes a snapshot of all business objects that root object references
     *  them (indirectly or directly).
     *  <p>Basically it serializes root object to disk.
     *  <p>There are possiblities of making snapshot human readable, by using 
     *  custom software serializing to XML.
     */ 
    public void takeSnapshot();
    
    
    /** Removes BO from an internal identity map of PAT.
     *  <p>This doesn't mean an object will be remNoved from the system. To do so
     *  one has to remove all references to the object and remove it from the map.
     * 
     *  @param identifiable business object (BO) to remove
     */ 
    public void removeBO(Identifiable identifiable);
    
    /** Inject root objet of the system into a field marked with 'pat.root_injected'
     *  annotation.
     * 
     *  @return root object of the system
     */ 
    public Object injectRoot();
}