org.outerj.xreporter.datasource
Class DataSourceImpl

java.lang.Object
  extended byorg.outerj.xreporter.datasource.DataSourceImpl
All Implemented Interfaces:
org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.configuration.Configurable, DataSource, org.apache.avalon.framework.activity.Initializable

public class DataSourceImpl
extends java.lang.Object
implements DataSource, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.activity.Initializable

Implementation of DataSource. This object only manages the metadata of the DataSource, the actual JDBC connection-management is delegated to a ConnectionProvider. Do not create instances of this object, but request them from the DataSourceManager.


Field Summary
protected static java.util.Comparator comparator
           
protected  java.util.HashMap connectionProperties
           
protected  ConnectionProvider connectionProvider
           
protected  ConnectionProviderManager connectionProviderManager
           
protected  java.lang.String description
           
protected  java.lang.String dialectName
           
protected  java.lang.String id
           
protected  java.lang.String name
           
protected  java.lang.String sortCode1
           
protected  java.lang.String sortCode2
           
protected  java.util.HashSet supportedTypes
           
 
Constructor Summary
DataSourceImpl()
           
 
Method Summary
 void compose(org.apache.avalon.framework.component.ComponentManager componentManager)
           
 void configure(org.apache.avalon.framework.configuration.Configuration configuration)
           
static java.util.Comparator getComparator()
           
 java.sql.Connection getConnection()
           
 java.util.Map getConnectionProperties()
           
 java.lang.String getDescription(ResourceHandle resourceHandle)
           
 java.lang.String getDialectName()
           
 java.lang.String getId()
           
 java.lang.String getName(ResourceHandle resourceHandle)
           
 java.lang.String getSortCode1()
           
 java.lang.String getSortCode2()
           
 void initialize()
           
 boolean supportsType(java.lang.String typeName)
           
 void toSAX(org.xml.sax.ContentHandler contentHandler, Resources dataSourceUserBundle)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected java.lang.String id

name

protected java.lang.String name

description

protected java.lang.String description

sortCode1

protected java.lang.String sortCode1

sortCode2

protected java.lang.String sortCode2

dialectName

protected java.lang.String dialectName

supportedTypes

protected java.util.HashSet supportedTypes

comparator

protected static java.util.Comparator comparator

connectionProperties

protected java.util.HashMap connectionProperties

connectionProviderManager

protected ConnectionProviderManager connectionProviderManager

connectionProvider

protected ConnectionProvider connectionProvider
Constructor Detail

DataSourceImpl

public DataSourceImpl()
Method Detail

compose

public void compose(org.apache.avalon.framework.component.ComponentManager componentManager)
             throws org.apache.avalon.framework.component.ComponentException
Specified by:
compose in interface org.apache.avalon.framework.component.Composable
Throws:
org.apache.avalon.framework.component.ComponentException

configure

public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

initialize

public void initialize()
                throws java.lang.Exception
Specified by:
initialize in interface org.apache.avalon.framework.activity.Initializable
Throws:
java.lang.Exception

getId

public java.lang.String getId()
Specified by:
getId in interface DataSource

getName

public java.lang.String getName(ResourceHandle resourceHandle)
Specified by:
getName in interface DataSource

getDescription

public java.lang.String getDescription(ResourceHandle resourceHandle)
Specified by:
getDescription in interface DataSource

getSortCode1

public java.lang.String getSortCode1()
Specified by:
getSortCode1 in interface DataSource

getSortCode2

public java.lang.String getSortCode2()
Specified by:
getSortCode2 in interface DataSource

getDialectName

public java.lang.String getDialectName()
Specified by:
getDialectName in interface DataSource

supportsType

public boolean supportsType(java.lang.String typeName)
Specified by:
supportsType in interface DataSource

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Specified by:
getConnection in interface DataSource
Throws:
java.sql.SQLException

getConnectionProperties

public java.util.Map getConnectionProperties()
Specified by:
getConnectionProperties in interface DataSource

toSAX

public void toSAX(org.xml.sax.ContentHandler contentHandler,
                  Resources dataSourceUserBundle)
           throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

getComparator

public static java.util.Comparator getComparator()
Returns:
a comparator that can sort instances of this class based on their sortcodes