org.apache.ojb.broker.metadata
Class RepositoryPersistor

java.lang.Object
  extended by org.apache.ojb.broker.metadata.RepositoryPersistor
All Implemented Interfaces:
Configurable

public class RepositoryPersistor
extends Object
implements Configurable

This class is responsible for reading and writing DescriptorRepository objects from and to persistent media. Currently only XML file based persistence is supported.

Version:
$Id: RepositoryPersistor.java,v 1.1 2007-08-24 22:17:29 ewestfal Exp $
Author:
Thomas Mahler, Armin Waibel

Constructor Summary
RepositoryPersistor()
           
 
Method Summary
 void configure(Configuration pConfig)
          configure an object using the Configuration pConfig
protected  DescriptorRepository deserialize(File serFile)
           
 ConnectionRepository readConnectionRepository(InputStream inst)
          Read the repository configuration file and extract connection handling information.
 ConnectionRepository readConnectionRepository(String filename)
          Read the repository configuration file and extract connection handling information.
 DescriptorRepository readDescriptorRepository(InputStream inst)
           
 DescriptorRepository readDescriptorRepository(String filename)
          Read the repository configuration file.
protected  void serialize(DescriptorRepository repository, File file)
           
 void writeToFile(DescriptorRepository repository, ConnectionRepository conRepository, OutputStream out)
          Write the DescriptorRepository to the given output object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RepositoryPersistor

public RepositoryPersistor()
Method Detail

configure

public void configure(Configuration pConfig)
               throws ConfigurationException
Description copied from interface: Configurable
configure an object using the Configuration pConfig

Specified by:
configure in interface Configurable
Parameters:
pConfig - the Configuration object used to configure current instance
Throws:
ConfigurationException

writeToFile

public void writeToFile(DescriptorRepository repository,
                        ConnectionRepository conRepository,
                        OutputStream out)
Write the DescriptorRepository to the given output object.


readDescriptorRepository

public DescriptorRepository readDescriptorRepository(String filename)
                                              throws MalformedURLException,
                                                     ParserConfigurationException,
                                                     SAXException,
                                                     IOException
Read the repository configuration file.
If configuration property useSerializedRepository is true all subsequent calls read a serialized version of the repository. The directory where the serialized repository is stored can be specified with the serializedRepositoryPath entry in OJB.properties. Once a serialized repository is found changes to repository.xml will be ignored. To force consideration of these changes the serialized repository must be deleted manually.

Throws:
MalformedURLException
ParserConfigurationException
SAXException
IOException

readDescriptorRepository

public DescriptorRepository readDescriptorRepository(InputStream inst)
                                              throws MalformedURLException,
                                                     ParserConfigurationException,
                                                     SAXException,
                                                     IOException
Throws:
MalformedURLException
ParserConfigurationException
SAXException
IOException

readConnectionRepository

public ConnectionRepository readConnectionRepository(String filename)
                                              throws MalformedURLException,
                                                     ParserConfigurationException,
                                                     SAXException,
                                                     IOException
Read the repository configuration file and extract connection handling information.

Throws:
MalformedURLException
ParserConfigurationException
SAXException
IOException

readConnectionRepository

public ConnectionRepository readConnectionRepository(InputStream inst)
                                              throws MalformedURLException,
                                                     ParserConfigurationException,
                                                     SAXException,
                                                     IOException
Read the repository configuration file and extract connection handling information.

Throws:
MalformedURLException
ParserConfigurationException
SAXException
IOException

deserialize

protected DescriptorRepository deserialize(File serFile)

serialize

protected void serialize(DescriptorRepository repository,
                         File file)


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.