diff options
author | Frank Schönheit <fs@openoffice.org> | 2001-05-25 09:56:23 +0000 |
---|---|---|
committer | Frank Schönheit <fs@openoffice.org> | 2001-05-25 09:56:23 +0000 |
commit | 2eea835a28c63057a2e08fe4339bdaca843ddf3a (patch) | |
tree | 935d525e076a82e9727776ae3e2b0d11fe6a8c47 /connectivity/source/cpool/ZDriverWrapper.hxx | |
parent | #65293# one more dep. (diff) | |
download | core-2eea835a28c63057a2e08fe4339bdaca843ddf3a.tar.gz core-2eea835a28c63057a2e08fe4339bdaca843ddf3a.zip |
initial checkin - driver rerouting it's connect through the connection pool
Diffstat (limited to 'connectivity/source/cpool/ZDriverWrapper.hxx')
-rw-r--r-- | connectivity/source/cpool/ZDriverWrapper.hxx | 132 |
1 files changed, 132 insertions, 0 deletions
diff --git a/connectivity/source/cpool/ZDriverWrapper.hxx b/connectivity/source/cpool/ZDriverWrapper.hxx new file mode 100644 index 000000000000..e16c73a75a17 --- /dev/null +++ b/connectivity/source/cpool/ZDriverWrapper.hxx @@ -0,0 +1,132 @@ +/************************************************************************* + * + * $RCSfile: ZDriverWrapper.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: fs $ $Date: 2001-05-25 10:56:23 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc.. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _CONNECTIVITY_CPOOL_ZDRIVERWRAPPER_HXX_ +#define _CONNECTIVITY_CPOOL_ZDRIVERWRAPPER_HXX_ + +#ifndef _COM_SUN_STAR_SDBC_XDRIVER_HPP_ +#include <com/sun/star/sdbc/XDriver.hpp> +#endif +#ifndef _CPPUHELPER_IMPLBASE1_HXX_ +#include <cppuhelper/implbase1.hxx> +#endif +#ifndef _OSL_MUTEX_HXX_ +#include <osl/mutex.hxx> +#endif +#ifndef _COM_SUN_STAR_UNO_XAGGREGATION_HPP_ +#include <com/sun/star/uno/XAggregation.hpp> +#endif + +//........................................................................ +namespace connectivity +{ +//........................................................................ + + class OConnectionPool; + //==================================================================== + //= ODriverWrapper + //==================================================================== + typedef ::cppu::WeakImplHelper1 < ::com::sun::star::sdbc::XDriver + > ODriverWrapper_BASE; + + class ODriverWrapper : public ODriverWrapper_BASE + { + protected: + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > + m_xDriverAggregate; + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > + m_xDriver; + OConnectionPool* m_pConnectionPool; + + public: + /** creates a new wrapper for a driver + @param _rxAggregateDriver + the driver to aggregate. The object will be reset to <NULL/> when returning from the ctor. + */ + ODriverWrapper( + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation >& _rxAggregateDriver, + OConnectionPool* _pPool + ); + + /// dtor + ~ODriverWrapper(); + + protected: + virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL connect( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL acceptsURL( const ::rtl::OUString& url ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getMajorVersion( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getMinorVersion( ) throw (::com::sun::star::uno::RuntimeException); + }; + +//........................................................................ +} // namespace connectivity +//........................................................................ + +#endif // _CONNECTIVITY_CPOOL_ZDRIVERWRAPPER_HXX_ + +/************************************************************************* + * history: + * $Log: not supported by cvs2svn $ + * + * Revision 1.0 25.05.01 11:03:45 fs + ************************************************************************/ + |