26#include <com/sun/star/sdbc/XPooledConnection.hpp>
27#include <com/sun/star/sdbc/XDriver.hpp>
28#include <com/sun/star/beans/PropertyValue.hpp>
29#include <com/sun/star/beans/XPropertyChangeListener.hpp>
30#include <com/sun/star/reflection/XProxyFactory.hpp>
32#include <osl/mutex.hxx>
35#include <rtl/digest.h>
39 class OConnectionPool;
52 virtual void SAL_CALL
onShot()
override;
86 for(
i=0;
i < RTL_DIGEST_LENGTH_SHA1 && (
x.m_pBuffer[
i] >=
y.m_pBuffer[
i]); ++
i)
88 return i < RTL_DIGEST_LENGTH_SHA1;
97 TConnectionMap::iterator
aPos;
101 typedef std::map< css::uno::Reference< css::sdbc::XConnection>,
104 class OConnectionPool :
public ::cppu::WeakImplHelper< css::beans::XPropertyChangeListener>
120 const css::uno::Sequence< css::beans::PropertyValue >& _rInfo);
121 css::uno::Reference< css::sdbc::XConnection>
getPooledConnection(TConnectionMap::iterator
const & _rIter);
129 OConnectionPool(
const css::uno::Reference< css::sdbc::XDriver >& _xDriver,
130 const css::uno::Reference< css::uno::XInterface >& _xDriverNode,
131 const css::uno::Reference< css::reflection::XProxyFactory >& _rxProxyFactory);
134 void clear(
bool _bDispose);
137 css::uno::Reference< css::sdbc::XConnection >
getConnectionWithInfo(
const OUString& url,
const css::uno::Sequence< css::beans::PropertyValue >& info );
139 virtual void SAL_CALL
disposing(
const css::lang::EventObject& Source )
override;
141 virtual void SAL_CALL
propertyChange(
const css::beans::PropertyChangeEvent& evt )
override;
::rtl::Reference< OPoolTimer > m_xInvalidator
css::uno::Reference< css::sdbc::XConnection > getConnectionWithInfo(const OUString &url, const css::uno::Sequence< css::beans::PropertyValue > &info)
css::uno::Reference< css::sdbc::XDriver > m_xDriver
css::uno::Reference< css::sdbc::XConnection > createNewConnection(const OUString &_rURL, const css::uno::Sequence< css::beans::PropertyValue > &_rInfo)
css::uno::Reference< css::uno::XInterface > m_xDriverNode
css::uno::Reference< css::reflection::XProxyFactory > m_xProxyFactory
void clear(bool _bDispose)
OConnectionPool(const css::uno::Reference< css::sdbc::XDriver > &_xDriver, const css::uno::Reference< css::uno::XInterface > &_xDriverNode, const css::uno::Reference< css::reflection::XProxyFactory > &_rxProxyFactory)
TActiveConnectionMap m_aActiveConnections
virtual ~OConnectionPool() override
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
css::uno::Reference< css::sdbc::XConnection > getPooledConnection(TConnectionMap::iterator const &_rIter)
void invalidatePooledConnections()
virtual void SAL_CALL propertyChange(const css::beans::PropertyChangeEvent &evt) override
OPoolTimer - Invalidates the connection pool.
virtual void SAL_CALL onShot() override
OPoolTimer(OConnectionPool *_pPool, const ::salhelper::TTimeValue &Time)
OConnectionPool * m_pPool
std::vector< css::uno::Reference< css::sdbc::XPooledConnection > > TPooledConnections
std::map< css::uno::Reference< css::sdbc::XConnection >, TActiveConnectionInfo > TActiveConnectionMap
std::map< TDigestHolder, TConnectionPool, TDigestLess > TConnectionMap
TConnectionMap::iterator aPos
css::uno::Reference< css::sdbc::XPooledConnection > xPooledConnection
TPooledConnections aConnections
sal_uInt8 m_pBuffer[RTL_DIGEST_LENGTH_SHA1]
bool operator()(const TDigestHolder &x, const TDigestHolder &y) const