Tag: cws_src680_utf2
User: kso     
Date: 05/02/14 04:14:10

Modified:
 /dba/connectivity/source/cpool/
  ZConnectionPool.cxx, ZConnectionPool.hxx, ZPoolCollection.cxx

Log:
 #109709# - apartment aware timer worker.

File Changes:

Directory: /dba/connectivity/source/cpool/
==========================================

File [changed]: ZConnectionPool.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/cpool/ZConnectionPool.cxx?r1=1.15&r2=1.15.208.1
Delta lines:  +14 -12
---------------------
--- ZConnectionPool.cxx 19 Mar 2003 16:38:16 -0000      1.15
+++ ZConnectionPool.cxx 14 Feb 2005 12:14:06 -0000      1.15.208.1
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: ZConnectionPool.cxx,v $
  *
- *  $Revision: 1.15 $
+ *  $Revision: 1.15.208.1 $
  *
- *  last change: $Author: hr $ $Date: 2003/03/19 16:38:16 $
+ *  last change: $Author: kso $ $Date: 2005/02/14 12:14:06 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -111,6 +111,7 @@
 //==========================================================================
 void SAL_CALL OPoolTimer::onShot()
 {
+    ::comphelper::Apartment::Guard aGuard(m_xApartment);
        m_pPool->invalidatePooledConnections();
 }
 namespace
@@ -127,7 +128,8 @@
 //= OConnectionPool
 //==========================================================================
 //--------------------------------------------------------------------------
-OConnectionPool::OConnectionPool(const Reference< XDriver >& _xDriver,
+OConnectionPool::OConnectionPool(const Reference< XMultiServiceFactory >& 
_xMSF,
+                                 const Reference< XDriver >& _xDriver,
                                                                 const 
Reference< XInterface >& _xDriverNode,
                                                                 const 
Reference< ::com::sun::star::reflection::XProxyFactory >& _rxProxyFactory)
        :m_xDriver(_xDriver)
@@ -148,7 +150,7 @@
        OPoolCollection::getNodeValue(getTimeoutNodeName(),m_xDriverNode) >>= 
m_nALiveCount;
        calculateTimeOuts(m_nALiveCount);
        
-       m_xInvalidator = new OPoolTimer(this,::vos::TTimeValue(m_nTimeOut,0));
+    m_xInvalidator = new 
OPoolTimer(_xMSF,this,::vos::TTimeValue(m_nTimeOut,0));
        m_xInvalidator->start();
 }
 // 
-----------------------------------------------------------------------------

File [changed]: ZConnectionPool.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/cpool/ZConnectionPool.hxx?r1=1.7&r2=1.7.118.1
Delta lines:  +29 -17
---------------------
--- ZConnectionPool.hxx 6 Oct 2003 15:37:50 -0000       1.7
+++ ZConnectionPool.hxx 14 Feb 2005 12:14:07 -0000      1.7.118.1
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: ZConnectionPool.hxx,v $
  *
- *  $Revision: 1.7 $
+ *  $Revision: 1.7.118.1 $
  *
- *  last change: $Author: rt $ $Date: 2003/10/06 15:37:50 $
+ *  last change: $Author: kso $ $Date: 2005/02/14 12:14:07 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -64,6 +64,9 @@
 #ifndef _COM_SUN_STAR_LANG_XEVENTLISTENER_HPP_
 #include <com/sun/star/lang/XEventListener.hpp>
 #endif
+#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#endif
 #ifndef _COM_SUN_STAR_SDBC_XPOOLEDCONNECTION_HPP_
 #include <com/sun/star/sdbc/XPooledConnection.hpp>
 #endif
@@ -88,6 +91,9 @@
 #ifndef _COMPHELPER_STLTYPES_HXX_
 #include <comphelper/stl_types.hxx>
 #endif
+#ifndef INCLUDED_COMPHELPER_APARTMENTHELPER_HXX
+#include "comphelper/apartmenthelper.hxx"
+#endif
 #ifndef _OSL_MUTEX_HXX_
 #include <osl/mutex.hxx>
 #endif
@@ -110,10 +116,15 @@
        class OPoolTimer : public ::vos::OTimer
        {
                OConnectionPool* m_pPool;
+        ::comphelper::Apartment::ApartmentAwareReference< 
::com::sun::star::uno::XApartment > m_xApartment;
        public:
-               OPoolTimer(OConnectionPool* _pPool,const ::vos::TTimeValue& 
_Time) 
+        OPoolTimer(
+            const ::com::sun::star::uno::Reference< 
::com::sun::star::lang::XMultiServiceFactory >& _xMSF,
+            OConnectionPool* _pPool,
+            const ::vos::TTimeValue& _Time)
                        : ::vos::OTimer(_Time)
                        ,m_pPool(_pPool)
+            ,m_xApartment( 
_xMSF,::comphelper::Apartment::queryCurrentApartment(_xMSF ))
                {}
        protected:
                virtual void SAL_CALL onShot();
@@ -195,7 +206,8 @@
                // the dtor will be called from the last instance  (last 
release call)
                virtual ~OConnectionPool();
        public:
-               OConnectionPool(const ::com::sun::star::uno::Reference< 
::com::sun::star::sdbc::XDriver >& _xDriver,
+        OConnectionPool(const ::com::sun::star::uno::Reference< 
::com::sun::star::lang::XMultiServiceFactory >& _xMSF,
+                        const ::com::sun::star::uno::Reference< 
::com::sun::star::sdbc::XDriver >& _xDriver,
                                                const 
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& 
_xDriverNode,
                                                const 
::com::sun::star::uno::Reference< ::com::sun::star::reflection::XProxyFactory 
>& _rxProxyFactory);
 

File [changed]: ZPoolCollection.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/cpool/ZPoolCollection.cxx?r1=1.8&r2=1.8.182.1
Delta lines:  +4 -4
-------------------
--- ZPoolCollection.cxx 22 May 2003 10:48:59 -0000      1.8
+++ ZPoolCollection.cxx 14 Feb 2005 12:14:08 -0000      1.8.182.1
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: ZPoolCollection.cxx,v $
  *
- *  $Revision: 1.8 $
+ *  $Revision: 1.8.182.1 $
  *
- *  last change: $Author: vg $ $Date: 2003/05/22 10:48:59 $
+ *  last change: $Author: kso $ $Date: 2005/02/14 12:14:08 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -379,7 +379,7 @@
                Reference<XPropertySet> xProp(_xDriverNode,UNO_QUERY);
                if(xProp.is())
                        
xProp->addPropertyChangeListener(getEnableNodeName(),this);
-               OConnectionPool* pConnectionPool = new 
OConnectionPool(_xDriver,_xDriverNode,m_xProxyFactory);
+               OConnectionPool* pConnectionPool = new 
OConnectionPool(m_xServiceFactory,_xDriver,_xDriverNode,m_xProxyFactory);
                pConnectionPool->acquire();
                aFind = 
m_aPools.insert(OConnectionPools::value_type(_sImplName,pConnectionPool)).first;
        }




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to