Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
External Datasource implementation support
- Loading branch information
1 parent
17f533e
commit 8826758
Showing
5 changed files
with
167 additions
and
16 deletions.
There are no files selected for viewing
66 changes: 66 additions & 0 deletions
66
batoo-jdbc/src/main/java/org/batoo/jpa/jdbc/AbstractDataSource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* Copyright (c) 2012 - Batoo Software ve Consultancy Ltd. | ||
* | ||
* This copyrighted material is made available to anyone wishing to use, modify, | ||
* copy, or redistribute it subject to the terms and conditions of the GNU | ||
* Lesser General Public License, as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License | ||
* for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this distribution; if not, write to: | ||
* Free Software Foundation, Inc. | ||
* 51 Franklin Street, Fifth Floor | ||
* Boston, MA 02110-1301 USA | ||
*/ | ||
package org.batoo.jpa.jdbc; | ||
|
||
import java.sql.Connection; | ||
import java.sql.SQLException; | ||
|
||
import javax.sql.DataSource; | ||
|
||
/** | ||
* Abstract class for implementing pluggable data source | ||
* | ||
* @author asimarslan | ||
* @since $version | ||
*/ | ||
public abstract class AbstractDataSource implements DataSource { | ||
|
||
/** | ||
* finalize the underlining implementation | ||
* | ||
* @since $version | ||
*/ | ||
public abstract void close(); | ||
|
||
/** | ||
* {@inheritDoc} | ||
* | ||
*/ | ||
@Override | ||
public abstract Connection getConnection() throws SQLException; | ||
|
||
/** | ||
* initialize the underlining implementation | ||
* | ||
* @param persistanceUnitName | ||
* @param hintName | ||
* @since $version | ||
*/ | ||
|
||
public abstract void open(String persistanceUnitName, String hintName); | ||
|
||
/** | ||
* release the connection | ||
* | ||
* @param connection | ||
* @since $version | ||
*/ | ||
public abstract void releaseConnection(Connection connection); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here, nonJTA and JTA are mixed.
This should be ...getNonJtaDataSource() ?