java.lang.Object
org.apache.ojb.broker.metadata.RepositoryPersistor
- All Implemented Interfaces:
- org.apache.ojb.broker.util.configuration.Configurable
- public class RepositoryPersistor
- extends java.lang.Object
- implements org.apache.ojb.broker.util.configuration.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.15 2003/01/31 17:55:55 arminw Exp $
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
private static org.apache.ojb.broker.util.logging.Logger log
SER_FILE_PERFIX
private static final java.lang.String SER_FILE_PERFIX
- See Also:
- Constant Field Values
SER_FILE_SUFFIX
private static final java.lang.String SER_FILE_SUFFIX
- See Also:
- Constant Field Values
serFile
private static java.io.File serFile
useSerializedRepository
private boolean useSerializedRepository
RepositoryPersistor
public RepositoryPersistor()
configure
public void configure(org.apache.ojb.broker.util.configuration.Configuration pConfig)
throws org.apache.ojb.broker.util.configuration.ConfigurationException
- Description copied from interface:
org.apache.ojb.broker.util.configuration.Configurable
- configure an object using the Configuration pConfig
- Specified by:
configure in interface org.apache.ojb.broker.util.configuration.Configurable
writeToFile
public void writeToFile(DescriptorRepository repository,
ConnectionRepository conRepository,
java.io.OutputStream out)
- Write the DescriptorRepository to the given file name.
readDescriptorRepository
public DescriptorRepository readDescriptorRepository(java.lang.String filename)
throws java.net.MalformedURLException,
javax.xml.parsers.ParserConfigurationException,
org.xml.sax.SAXException,
java.io.IOException
- Read the repository configuration file.
If configuration property useSerializedRepository was true
all subsequent calls read a serialized version of the repository from the
system tmp dir (the filename argument will be ignored).
readConnectionRepository
public ConnectionRepository readConnectionRepository(java.lang.String filename)
throws java.net.MalformedURLException,
javax.xml.parsers.ParserConfigurationException,
org.xml.sax.SAXException,
java.io.IOException
- Read the repository configuration file and extract connection handling information.
deserialize
protected DescriptorRepository deserialize(java.io.File serFile)
serialize
protected void serialize(DescriptorRepository repository,
java.io.File file)
buildRepository
private java.lang.Object buildRepository(java.lang.String repositoryFileName,
java.lang.Class targetRepository)
throws java.net.MalformedURLException,
javax.xml.parsers.ParserConfigurationException,
org.xml.sax.SAXException,
java.io.IOException
buildURL
private java.net.URL buildURL(java.lang.String repositoryFileName)
throws java.net.MalformedURLException