public class DecoratingDataSource extends DelegatingDataSource
ConnectionDecorator
s.Constructor and Description |
---|
DecoratingDataSource(DataSource ds)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addDecorator(ConnectionDecorator decorator)
Add a connection decorator.
|
void |
addDecorators(Collection<ConnectionDecorator> decorators)
Add multiple connection decorators efficiently.
|
void |
clearDecorators()
Clear all decorators.
|
Connection |
getConnection() |
Connection |
getConnection(String user,
String pass) |
Collection<ConnectionDecorator> |
getDecorators()
Return a read-only list of connection decorators in the order they were
added.
|
boolean |
removeDecorator(ConnectionDecorator decorator)
Remove a connection decorator.
|
appendInfo, close, equals, getDelegate, getInnermostDelegate, getLoginTimeout, getLogWriter, getParentLogger, hashCode, isWrapperFor, setLoginTimeout, setLogWriter, toString, unwrap
public DecoratingDataSource(DataSource ds)
public Collection<ConnectionDecorator> getDecorators()
public void addDecorator(ConnectionDecorator decorator)
public void addDecorators(Collection<ConnectionDecorator> decorators)
public boolean removeDecorator(ConnectionDecorator decorator)
public void clearDecorators()
public Connection getConnection() throws SQLException
getConnection
in interface DataSource
getConnection
in class DelegatingDataSource
SQLException
public Connection getConnection(String user, String pass) throws SQLException
getConnection
in interface DataSource
getConnection
in class DelegatingDataSource
SQLException
Copyright © 2006–2017 Apache Software Foundation. All rights reserved.