eXo Kernel :: Component :: Common Service 2.4.3-CLD

org.exoplatform.services.jdbc.impl
Class ManagedDataSource

java.lang.Object
  extended by org.exoplatform.services.jdbc.impl.ManagedDataSource
All Implemented Interfaces:
Wrapper, CommonDataSource, DataSource

public class ManagedDataSource
extends Object
implements DataSource

This classes is used to wrap the original DataSource in order to be able to support the managed data sources with a limited amount of changes. A DataSource is expected to be wrapped only when a data source is defined and has been configured as managed

Version:
$Id$
Author:
Nicolas Filotto

Constructor Summary
ManagedDataSource(DataSource ds, TransactionManager tm, boolean checkIfTxActive)
          default constructor
 
Method Summary
 Connection getConnection()
           
 Connection getConnection(String username, String password)
           
 int getLoginTimeout()
           
 PrintWriter getLogWriter()
           
 Logger getParentLogger()
           
 boolean isWrapperFor(Class<?> iface)
           
 void setLoginTimeout(int seconds)
           
 void setLogWriter(PrintWriter out)
           
<T> T
unwrap(Class<T> iface)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManagedDataSource

public ManagedDataSource(DataSource ds,
                         TransactionManager tm,
                         boolean checkIfTxActive)
default constructor

Method Detail

getLogWriter

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

getLoginTimeout

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

setLogWriter

public void setLogWriter(PrintWriter out)
                  throws SQLException
Specified by:
setLogWriter in interface CommonDataSource
Throws:
SQLException
See Also:
CommonDataSource.setLogWriter(java.io.PrintWriter)

setLoginTimeout

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

isWrapperFor

public boolean isWrapperFor(Class<?> iface)
                     throws SQLException
Specified by:
isWrapperFor in interface Wrapper
Throws:
SQLException
See Also:
Wrapper.isWrapperFor(java.lang.Class)

unwrap

public <T> T unwrap(Class<T> iface)
         throws SQLException
Specified by:
unwrap in interface Wrapper
Throws:
SQLException
See Also:
Wrapper.unwrap(java.lang.Class)

getConnection

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

getConnection

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

getParentLogger

public Logger getParentLogger()
                       throws SQLFeatureNotSupportedException
Throws:
SQLFeatureNotSupportedException
See Also:
javax.sql.CommonDataSource#getParentLogger()

eXo Kernel :: Component :: Common Service 2.4.3-CLD

Copyright © 2013 eXo Platform SAS. All Rights Reserved.