org.apache.cocoon.databases.bridge.spring.avalon
Class SpringToAvalonDataSourceWrapper

java.lang.Object
  extended byorg.apache.cocoon.databases.bridge.spring.avalon.SpringToAvalonDataSourceWrapper
All Implemented Interfaces:
Component, Configurable, DataSource, DataSourceComponent, ThreadSafe

public class SpringToAvalonDataSourceWrapper
extends Object
implements DataSource, DataSourceComponent

Wrapper bean for DataSource that implements DataSourceComponent additionally in order to provide access to DataSources for Avalon components.


Field Summary
 
Fields inherited from interface org.apache.avalon.excalibur.datasource.DataSourceComponent
ROLE
 
Constructor Summary
SpringToAvalonDataSourceWrapper()
           
 
Method Summary
 void configure(Configuration arg0)
           
 Connection getConnection()
           
 Connection getConnection(String username, String password)
           
 int getLoginTimeout()
           
 PrintWriter getLogWriter()
           
 DataSource getWrappedBean()
           
 boolean isWrapperFor(Class iface)
           
 void setLoginTimeout(int seconds)
           
 void setLogWriter(PrintWriter out)
           
 void setWrappedBean(DataSource wrappedBean)
           
 Object unwrap(Class iface)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringToAvalonDataSourceWrapper

public SpringToAvalonDataSourceWrapper()
Method Detail

getWrappedBean

public DataSource getWrappedBean()
Returns:
the wrappedBean

setWrappedBean

public void setWrappedBean(DataSource wrappedBean)
Parameters:
wrappedBean - the wrappedBean to set

getConnection

public Connection getConnection()
                         throws SQLException
Specified by:
getConnection in interface DataSource
Returns:
Throws:
SQLException
See Also:
DataSource.getConnection()

getConnection

public Connection getConnection(String username,
                                String password)
                         throws SQLException
Specified by:
getConnection in interface DataSource
Parameters:
username -
password -
Returns:
Throws:
SQLException
See Also:
DataSource.getConnection(java.lang.String, java.lang.String)

getLoginTimeout

public int getLoginTimeout()
                    throws SQLException
Specified by:
getLoginTimeout in interface DataSource
Returns:
Throws:
SQLException
See Also:
CommonDataSource

getLogWriter

public PrintWriter getLogWriter()
                         throws SQLException
Specified by:
getLogWriter in interface DataSource
Returns:
Throws:
SQLException
See Also:
CommonDataSource

setLoginTimeout

public void setLoginTimeout(int seconds)
                     throws SQLException
Specified by:
setLoginTimeout in interface DataSource
Parameters:
seconds -
Throws:
SQLException
See Also:
CommonDataSource

setLogWriter

public void setLogWriter(PrintWriter out)
                  throws SQLException
Specified by:
setLogWriter in interface DataSource
Parameters:
out -
Throws:
SQLException
See Also:
CommonDataSource

isWrapperFor

public boolean isWrapperFor(Class iface)
                     throws SQLException
Parameters:
iface -
Returns:
Throws:
SQLException
See Also:
Wrapper

unwrap

public Object unwrap(Class iface)
              throws SQLException
Parameters:
iface -
Returns:
Throws:
SQLException
See Also:
Wrapper

configure

public void configure(Configuration arg0)
               throws ConfigurationException
Specified by:
configure in interface Configurable
Throws:
ConfigurationException


Copyright © 1999-2008 The Apache Software Foundation. All Rights Reserved.