Class XMLFilePersistentObjectRepository

  extended byorg.apache.avalon.cornerstone.blocks.masterstore.AbstractFileRepository
      extended byorg.apache.avalon.cornerstone.blocks.masterstore.xml.AbstractXMLFilePersistentObjectRepository
          extended byorg.apache.avalon.cornerstone.blocks.masterstore.xml.XMLFilePersistentObjectRepository
All Implemented Interfaces:
Configurable, Contextualizable, Initializable, LogEnabled, ObjectRepository, Repository

public class XMLFilePersistentObjectRepository
extends AbstractXMLFilePersistentObjectRepository
implements ObjectRepository, Contextualizable, Initializable, Configurable, LogEnabled

This is a simple implementation of persistent object store using XML serialization from JDK 1.4 to a file system. This implementation of ObjectRepository comes with the following warning: "XMLEncoder provides suitable persistence delegates for all public subclasses of java.awt.Component in J2SE and the types of all of their properties, recursively. All other classes will be handled with the default persistence delegate which assumes the class follows the beans conventions" (snipped from the BugParade) Basically, don't use this block for anything other than Swing component serialization. Sun will have to do a lot of work writing a "PersistenceDelegate" to handle other JDK types let alone custom classes.

Paul Hammant, Stefano Mazzocchi, Federico Barbieri

Field Summary
Fields inherited from class org.apache.avalon.cornerstone.blocks.masterstore.AbstractFileRepository
BYTE_MASK, DEBUG, HANDLED_URL, HEX_DIGITS, m_baseDirectory, m_destination, m_extension, m_filter, m_name, m_path, monitor
Constructor Summary
Method Summary
 void configure(Configuration configuration)
          Configuration of the component by the container.
 void contextualize(Context context)
          Contextualization of the component by the container during which the working home directory will be provided.
 void enableLogging(Logger logger)
          Provide component with a logger.
 void initialize()
          Initialization of the component by the container.
protected  void initializeChild(AbstractFileRepository child)
Methods inherited from class org.apache.avalon.cornerstone.blocks.masterstore.xml.AbstractXMLFilePersistentObjectRepository
get, get, getExtensionDecorator, put
Methods inherited from class org.apache.avalon.cornerstone.blocks.masterstore.AbstractFileRepository
containsKey, createChildRepository, decode, encode, getChildRepository, getFile, getInputStream, getOutputStream, list, remove, setDestination
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface
containsKey, get, get, list, put, remove
Methods inherited from interface

Constructor Detail


public XMLFilePersistentObjectRepository()
Method Detail


public void enableLogging(Logger logger)
Description copied from interface: LogEnabled
Provide component with a logger.

Specified by:
enableLogging in interface LogEnabled
logger - the logger. Must not be null.


protected void initializeChild(AbstractFileRepository child)
                        throws java.lang.Exception
Specified by:
initializeChild in class AbstractFileRepository


public void contextualize(Context context)
                   throws ContextException
Contextualization of the component by the container during which the working home directory will be provided.

Specified by:
contextualize in interface Contextualizable
context - the supplied context object
ContextException - if context is invalid


public void initialize()
                throws java.lang.Exception
Initialization of the component by the container.

Specified by:
initialize in interface Initializable
java.lang.Exception - if a initialization stage error occurs


public void configure(Configuration configuration)
               throws ConfigurationException
Configuration of the component by the container.

Specified by:
configure in interface Configurable
configuration - the configuration
ConfigurationException - if a configuration error occurs

Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.