Class StdConnectionInterceptor
java.lang.Object
pl.decerto.hyperon.runtime.dao.util.StdConnectionInterceptor
- All Implemented Interfaces:
ConnectionInterceptor
Simple connection interceptor, without any DI usages. Used by
HyperonEngineFactory to create all required
components by hyperon-runtime, like engine, DAOs, etc.- Author:
- przemek hertel
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetConnection(DataSource dataSource) Attempts to establish a connection with the givendataSource.voidreleaseConnection(Connection connection) Close the givenconnectionthat was established toDataSource.
-
Constructor Details
-
StdConnectionInterceptor
public StdConnectionInterceptor()
-
-
Method Details
-
getConnection
Description copied from interface:ConnectionInterceptorAttempts to establish a connection with the givendataSource.- Specified by:
getConnectionin interfaceConnectionInterceptor- Parameters:
dataSource- data source for which connection should be established. Can't be null.- Returns:
- a connection to the data source
- Throws:
SQLException- if a database access error occurs
-
releaseConnection
Description copied from interface:ConnectionInterceptorClose the givenconnectionthat was established toDataSource.- Specified by:
releaseConnectionin interfaceConnectionInterceptor- Parameters:
connection- Connection to close. Ifnull, then nothing happens- See Also:
-