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
ConnectionDecorator
s.- Author:
- Abe White
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDecorator
(ConnectionDecorator decorator) Add a connection decorator.void
addDecorators
(Collection<ConnectionDecorator> decorators) Add multiple connection decorators efficiently.void
Clear all decorators.getConnection
(String user, String pass) Return a read-only list of connection decorators in the order they were added.boolean
removeDecorator
(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, unwrap
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilder
Methods 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:
getConnection
in interfaceDataSource
- Overrides:
getConnection
in classDelegatingDataSource
- Throws:
SQLException
-
getConnection
- Specified by:
getConnection
in interfaceDataSource
- Overrides:
getConnection
in classDelegatingDataSource
- Throws:
SQLException
-