org.simpleframework.xml.strategy.WriteState Maven / Gradle / Ivy
/*
* WriteState.java April 2007
*
* Copyright (C) 2007, Niall Gallagher
*
* 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.
*
* 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
*/
package org.simpleframework.xml.strategy;
import org.simpleframework.xml.util.WeakCache;
/**
* The WriteState
object is used to store all graphs that
* are currently been written with a given cycle strategy. The goal of
* this object is to act as a temporary store for graphs such that
* when the persistence session has completed the write graph will be
* garbage collected. This ensures that there are no lingering object
* reference that could cause a memory leak. If a graph for the given
* session key does not exist then a new one is created.
*
* @author Niall Gallagher
*
* @see org.simpleframework.xml.strategy.WriteGraph
*/
class WriteState extends WeakCache