Package org.apache.openjpa.lib.jdbc
Class DecoratingDataSource
java.lang.Object
org.apache.openjpa.lib.jdbc.DelegatingDataSource
org.apache.openjpa.lib.jdbc.DecoratingDataSource
- All Implemented Interfaces:
Wrapper,CommonDataSource,DataSource,Closeable
- Direct Known Subclasses:
DistributedDataSource
Delegating data source that maintains a list of
ConnectionDecorators.- Author:
- Abe White
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDecorator(ConnectionDecorator decorator) Add a connection decorator.voidaddDecorators(Collection<ConnectionDecorator> decorators) Add multiple connection decorators efficiently.voidClear all decorators.getConnection(String user, String pass) Return a read-only list of connection decorators in the order they were added.booleanremoveDecorator(ConnectionDecorator decorator) Remove a connection decorator.Methods inherited from class org.apache.openjpa.lib.jdbc.DelegatingDataSource
appendInfo, close, equals, getDelegate, getInnermostDelegate, getLoginTimeout, getLogWriter, getParentLogger, hashCode, isWrapperFor, setLoginTimeout, setLogWriter, toString, unwrapMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilderMethods inherited from interface javax.sql.DataSource
createConnectionBuilder
-
Constructor Details
-
DecoratingDataSource
Constructor. Supply wrapped data source.
-
-
Method Details
-
getDecorators
Return a read-only list of connection decorators in the order they were added. -
addDecorator
Add a connection decorator. -
addDecorators
Add multiple connection decorators efficiently. -
removeDecorator
Remove a connection decorator. -
clearDecorators
public void clearDecorators()Clear all decorators. -
getConnection
- Specified by:
getConnectionin interfaceDataSource- Overrides:
getConnectionin classDelegatingDataSource- Throws:
SQLException
-
getConnection
- Specified by:
getConnectionin interfaceDataSource- Overrides:
getConnectionin classDelegatingDataSource- Throws:
SQLException
-