Dashboard Builder Commons 6.1.0.CR1

org.jboss.dashboard.database
Class ExternalDataSource

java.lang.Object
  extended by org.jboss.dashboard.database.ExternalDataSource
All Implemented Interfaces:
Wrapper, CommonDataSource, DataSource

public class ExternalDataSource
extends Object
implements DataSource

A data source implementation that bounds its connections to the underlying transaction.

When a connection is requested it gets a connection from the pool and attach such connection to the current transaction. When the transaction completes the data source connection is automatically completed as well.


Field Summary
protected  DataSourceEntry dataSourceEntry
           
protected static org.slf4j.Logger log
           
protected  String name
           
 
Constructor Summary
ExternalDataSource()
           
 
Method Summary
protected  boolean getAutoCommit(Connection conn)
           
 Connection getConnection()
           
 Connection getConnection(String username, String password)
           
 DataSourceEntry getDataSourceEntry()
           
 int getLoginTimeout()
           
 PrintWriter getLogWriter()
           
 String getName()
           
 Logger getParentLogger()
           
 boolean isDisableAutoCommit()
           
 boolean isWrapperFor(Class<?> c)
           
protected  void setAutoCommit(Connection conn, boolean autocommit)
           
 void setDataSourceEntry(DataSourceEntry dataSourceEntry)
           
 void setDisableAutoCommit(boolean disableAutoCommit)
           
 void setLoginTimeout(int seconds)
           
 void setLogWriter(PrintWriter out)
           
 void setName(String name)
           
<T> T
unwrap(Class<T> c)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static transient org.slf4j.Logger log

name

protected String name

dataSourceEntry

protected DataSourceEntry dataSourceEntry
Constructor Detail

ExternalDataSource

public ExternalDataSource()
Method Detail

getName

public String getName()

setName

public void setName(String name)

setDataSourceEntry

public void setDataSourceEntry(DataSourceEntry dataSourceEntry)

getDataSourceEntry

public DataSourceEntry getDataSourceEntry()

getLoginTimeout

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

setLoginTimeout

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

getLogWriter

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

setLogWriter

public void setLogWriter(PrintWriter out)
                  throws SQLException
Specified by:
setLogWriter in interface CommonDataSource
Throws:
SQLException

isDisableAutoCommit

public boolean isDisableAutoCommit()

setDisableAutoCommit

public void setDisableAutoCommit(boolean disableAutoCommit)

getConnection

public Connection getConnection(String username,
                                String password)
                         throws SQLException
Specified by:
getConnection in interface DataSource
Throws:
SQLException

getConnection

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

getParentLogger

public Logger getParentLogger()

getAutoCommit

protected boolean getAutoCommit(Connection conn)

setAutoCommit

protected void setAutoCommit(Connection conn,
                             boolean autocommit)

isWrapperFor

public boolean isWrapperFor(Class<?> c)
Specified by:
isWrapperFor in interface Wrapper

unwrap

public <T> T unwrap(Class<T> c)
Specified by:
unwrap in interface Wrapper

Dashboard Builder Commons 6.1.0.CR1

Copyright © 2012-2014 JBoss by Red Hat. All Rights Reserved.