org.axonframework.common.jdbc
Class SpringDataSourceConnectionProvider

java.lang.Object
  extended by org.axonframework.common.jdbc.SpringDataSourceConnectionProvider
All Implemented Interfaces:
ConnectionProvider

public class SpringDataSourceConnectionProvider
extends Object
implements ConnectionProvider

ConnectionProvider implementation that is aware of Transaction Managers and provides the connection attached to an active transaction manager, instead of asking a Data Source directly.

Since:
2.2
Author:
Allard Buijze

Constructor Summary
SpringDataSourceConnectionProvider(DataSource dataSource)
          Initialize the connection provider, using given dataSource to obtain a connection, when required.
 
Method Summary
 Connection getConnection()
          Returns a connection, ready for use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringDataSourceConnectionProvider

public SpringDataSourceConnectionProvider(DataSource dataSource)
Initialize the connection provider, using given dataSource to obtain a connection, when required.

Parameters:
dataSource - The data source to obtain connections from, when required
Method Detail

getConnection

public Connection getConnection()
                         throws SQLException
Description copied from interface: ConnectionProvider
Returns a connection, ready for use.

Specified by:
getConnection in interface ConnectionProvider
Returns:
a new connection to use
Throws:
SQLException - when an error occurs obtaining the connection


Copyright © 2010-2016. All Rights Reserved.