org.xquark.bridge
Class Mapping

java.lang.Object
  |
  +--org.xquark.bridge.Mapping

public class Mapping
extends java.lang.Object

An object implementing this class represents a processed mapping file. Objects of this class are thread-safe and can be reused multiple times.
This class uses a cache for loaded mapping files, so that the loading overhead is reduced. The cache mechanism can be overriden to reload a modified file.


Constructor Summary
Mapping(javax.sql.DataSource dataSource, org.xml.sax.InputSource source, boolean reload, java.lang.ClassLoader classLoader, org.xquark.schema.SchemaManager schemaManager, java.util.HashMap mappingMetadata)
          Constructor.
 
Method Summary
 void close()
          Frees all resources associated to the object
 javax.sql.DataSource getDataSource()
          Returns the JDBC data source used by this mapping.
 Mapper getMapper()
          Creates a new Mapper object for storing a set of XML documents in the database
 java.lang.String getSystemId()
          Returns the system id (the URL) of the mapping file, if known.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Mapping

public Mapping(javax.sql.DataSource dataSource,
               org.xml.sax.InputSource source,
               boolean reload,
               java.lang.ClassLoader classLoader,
               org.xquark.schema.SchemaManager schemaManager,
               java.util.HashMap mappingMetadata)
        throws XMLDBCException
Constructor.

Parameters:
dataSource - a JDBC data source
source - the SAX InputSource encapsulating the mapping file
reload - true means that the mapping file should be reloaded, even if it is present in the cache
classLoader - ClassLoader used for loading user generators
schemaManager - SchemaManager for schemas
mappingMetadata - if not null, a HashMap holding previously loaded mapping metadata
Throws:
XMLDBCException - if an error occured while loading the mapping file. The underlying exception provides the root cause for the exception
Method Detail

close

public void close()
           throws XMLDBCException
Frees all resources associated to the object

Throws:
XMLDBCException - if a database connection error occured.

getMapper

public Mapper getMapper()
                 throws XMLDBCException
Creates a new Mapper object for storing a set of XML documents in the database

Returns:
a Mapper object
Throws:
XMLDBCException - if a database connection error occured.
See Also:
Mapper

getSystemId

public java.lang.String getSystemId()
Returns the system id (the URL) of the mapping file, if known.

Returns:
the system id of the mapping file, or null if unknown.

getDataSource

public javax.sql.DataSource getDataSource()
Returns the JDBC data source used by this mapping.

Returns:
a JDBC datasource.


Copyright © 2004 Université de Versailles Saint-Quentin, XQuark Group. All rights reserved.