Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : :
30 : : #include <cachedcontentresultsetstub.hxx>
31 : : #include <com/sun/star/sdbc/FetchDirection.hpp>
32 : : #include <com/sun/star/ucb/FetchError.hpp>
33 : : #include <osl/diagnose.h>
34 : :
35 : : using namespace com::sun::star::beans;
36 : : using namespace com::sun::star::lang;
37 : : using namespace com::sun::star::sdbc;
38 : : using namespace com::sun::star::ucb;
39 : : using namespace com::sun::star::uno;
40 : : using namespace com::sun::star::util;
41 : : using namespace cppu;
42 : :
43 : : using ::rtl::OUString;
44 : :
45 : 0 : CachedContentResultSetStub::CachedContentResultSetStub( Reference< XResultSet > xOrigin )
46 : : : ContentResultSetWrapper( xOrigin )
47 : : , m_nColumnCount( 0 )
48 : : , m_bColumnCountCached( sal_False )
49 : : , m_bNeedToPropagateFetchSize( sal_True )
50 : : , m_bFirstFetchSizePropagationDone( sal_False )
51 : : , m_nLastFetchSize( 1 )//this value is not important at all
52 : : , m_bLastFetchDirection( sal_True )//this value is not important at all
53 : : , m_aPropertyNameForFetchSize( OUString("FetchSize") )
54 : 0 : , m_aPropertyNameForFetchDirection( OUString("FetchDirection") )
55 : : {
56 : 0 : impl_init();
57 : 0 : }
58 : :
59 : 0 : CachedContentResultSetStub::~CachedContentResultSetStub()
60 : : {
61 : 0 : impl_deinit();
62 : 0 : }
63 : :
64 : : //--------------------------------------------------------------------------
65 : : // XInterface methods.
66 : : //--------------------------------------------------------------------------
67 : 0 : XINTERFACE_COMMON_IMPL( CachedContentResultSetStub )
68 : :
69 : 0 : Any SAL_CALL CachedContentResultSetStub
70 : : ::queryInterface( const Type& rType )
71 : : throw ( RuntimeException )
72 : : {
73 : : //list all interfaces inclusive baseclasses of interfaces
74 : :
75 : 0 : Any aRet = ContentResultSetWrapper::queryInterface( rType );
76 : 0 : if( aRet.hasValue() )
77 : 0 : return aRet;
78 : :
79 : : aRet = cppu::queryInterface( rType
80 : : , static_cast< XTypeProvider* >( this )
81 : : , static_cast< XServiceInfo* >( this )
82 : : , static_cast< XFetchProvider* >( this )
83 : : , static_cast< XFetchProviderForContentAccess* >( this )
84 : 0 : );
85 : :
86 : 0 : return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
87 : : }
88 : :
89 : : //--------------------------------------------------------------------------
90 : : // own methods. ( inherited )
91 : : //--------------------------------------------------------------------------
92 : :
93 : : //virtual
94 : 0 : void SAL_CALL CachedContentResultSetStub
95 : : ::impl_propertyChange( const PropertyChangeEvent& rEvt )
96 : : throw( RuntimeException )
97 : : {
98 : 0 : impl_EnsureNotDisposed();
99 : :
100 : : //don't notify events on fetchsize and fetchdirection to the above CachedContentResultSet
101 : : //because it will ignore them anyway and we can save this remote calls
102 : 0 : if( rEvt.PropertyName == m_aPropertyNameForFetchSize
103 : 0 : || rEvt.PropertyName == m_aPropertyNameForFetchDirection )
104 : 0 : return;
105 : :
106 : 0 : PropertyChangeEvent aEvt( rEvt );
107 : 0 : aEvt.Source = static_cast< XPropertySet * >( this );
108 : 0 : aEvt.Further = sal_False;
109 : :
110 : 0 : impl_notifyPropertyChangeListeners( aEvt );
111 : : }
112 : :
113 : :
114 : : //virtual
115 : 0 : void SAL_CALL CachedContentResultSetStub
116 : : ::impl_vetoableChange( const PropertyChangeEvent& rEvt )
117 : : throw( PropertyVetoException,
118 : : RuntimeException )
119 : : {
120 : 0 : impl_EnsureNotDisposed();
121 : :
122 : : //don't notify events on fetchsize and fetchdirection to the above CachedContentResultSet
123 : : //because it will ignore them anyway and we can save this remote calls
124 : 0 : if( rEvt.PropertyName == m_aPropertyNameForFetchSize
125 : 0 : || rEvt.PropertyName == m_aPropertyNameForFetchDirection )
126 : 0 : return;
127 : :
128 : 0 : PropertyChangeEvent aEvt( rEvt );
129 : 0 : aEvt.Source = static_cast< XPropertySet * >( this );
130 : 0 : aEvt.Further = sal_False;
131 : :
132 : 0 : impl_notifyVetoableChangeListeners( aEvt );
133 : : }
134 : :
135 : : //--------------------------------------------------------------------------
136 : : // XTypeProvider methods.
137 : : //--------------------------------------------------------------------------
138 : :
139 : 0 : XTYPEPROVIDER_COMMON_IMPL( CachedContentResultSetStub )
140 : : //list all interfaces exclusive baseclasses
141 : 0 : Sequence< Type > SAL_CALL CachedContentResultSetStub
142 : : ::getTypes()
143 : : throw( RuntimeException )
144 : : {
145 : : static Sequence< Type >* pTypes = NULL;
146 : 0 : if( !pTypes )
147 : : {
148 : 0 : osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() );
149 : 0 : if( !pTypes )
150 : : {
151 : 0 : pTypes = new Sequence< Type >(13);
152 : 0 : (*pTypes)[0] = CPPU_TYPE_REF( XTypeProvider );
153 : 0 : (*pTypes)[1] = CPPU_TYPE_REF( XServiceInfo );
154 : 0 : (*pTypes)[2] = CPPU_TYPE_REF( XComponent );
155 : 0 : (*pTypes)[3] = CPPU_TYPE_REF( XCloseable );
156 : 0 : (*pTypes)[4] = CPPU_TYPE_REF( XResultSetMetaDataSupplier );
157 : 0 : (*pTypes)[5] = CPPU_TYPE_REF( XPropertySet );
158 : 0 : (*pTypes)[6] = CPPU_TYPE_REF( XPropertyChangeListener );
159 : 0 : (*pTypes)[7] = CPPU_TYPE_REF( XVetoableChangeListener );
160 : 0 : (*pTypes)[8] = CPPU_TYPE_REF( XResultSet );
161 : 0 : (*pTypes)[9] = CPPU_TYPE_REF( XContentAccess );
162 : 0 : (*pTypes)[10] = CPPU_TYPE_REF( XRow );
163 : 0 : (*pTypes)[11] = CPPU_TYPE_REF( XFetchProvider );
164 : 0 : (*pTypes)[12] = CPPU_TYPE_REF( XFetchProviderForContentAccess );
165 : 0 : }
166 : : }
167 : 0 : return *pTypes;
168 : : }
169 : :
170 : : //--------------------------------------------------------------------------
171 : : // XServiceInfo methods.
172 : : //--------------------------------------------------------------------------
173 : :
174 : 0 : XSERVICEINFO_NOFACTORY_IMPL_1( CachedContentResultSetStub,
175 : : OUString( "com.sun.star.comp.ucb.CachedContentResultSetStub" ),
176 : : OUString( CACHED_CRS_STUB_SERVICE_NAME ) );
177 : :
178 : : //-----------------------------------------------------------------
179 : : // XFetchProvider methods.
180 : : //-----------------------------------------------------------------
181 : :
182 : : #define FETCH_XXX( impl_loadRow, loadInterface ) \
183 : : impl_EnsureNotDisposed(); \
184 : : if( !m_xResultSetOrigin.is() ) \
185 : : { \
186 : : OSL_FAIL( "broadcaster was disposed already" ); \
187 : : throw RuntimeException(); \
188 : : } \
189 : : impl_propagateFetchSizeAndDirection( nRowCount, bDirection ); \
190 : : FetchResult aRet; \
191 : : aRet.StartIndex = nRowStartPosition; \
192 : : aRet.Orientation = bDirection; \
193 : : aRet.FetchError = FetchError::SUCCESS; /*ENDOFDATA, EXCEPTION*/ \
194 : : sal_Int32 nOldOriginal_Pos = m_xResultSetOrigin->getRow(); \
195 : : if( impl_isForwardOnly() ) \
196 : : { \
197 : : if( nOldOriginal_Pos != nRowStartPosition ) \
198 : : { \
199 : : /*@todo*/ \
200 : : aRet.FetchError = FetchError::EXCEPTION; \
201 : : return aRet; \
202 : : } \
203 : : if( nRowCount != 1 ) \
204 : : aRet.FetchError = FetchError::EXCEPTION; \
205 : : \
206 : : aRet.Rows.realloc( 1 ); \
207 : : \
208 : : try \
209 : : { \
210 : : impl_loadRow( aRet.Rows[0], loadInterface ); \
211 : : } \
212 : : catch( SQLException& ) \
213 : : { \
214 : : aRet.Rows.realloc( 0 ); \
215 : : aRet.FetchError = FetchError::EXCEPTION; \
216 : : return aRet; \
217 : : } \
218 : : return aRet; \
219 : : } \
220 : : aRet.Rows.realloc( nRowCount ); \
221 : : sal_Bool bOldOriginal_AfterLast = sal_False; \
222 : : if( !nOldOriginal_Pos ) \
223 : : bOldOriginal_AfterLast = m_xResultSetOrigin->isAfterLast(); \
224 : : sal_Int32 nN = 1; \
225 : : sal_Bool bValidNewPos = sal_False; \
226 : : try \
227 : : { \
228 : : try \
229 : : { \
230 : : /*if( nOldOriginal_Pos != nRowStartPosition )*/ \
231 : : bValidNewPos = m_xResultSetOrigin->absolute( nRowStartPosition ); \
232 : : } \
233 : : catch( SQLException& ) \
234 : : { \
235 : : aRet.Rows.realloc( 0 ); \
236 : : aRet.FetchError = FetchError::EXCEPTION; \
237 : : return aRet; \
238 : : } \
239 : : if( !bValidNewPos ) \
240 : : { \
241 : : aRet.Rows.realloc( 0 ); \
242 : : aRet.FetchError = FetchError::EXCEPTION; \
243 : : \
244 : : /*restore old position*/ \
245 : : if( nOldOriginal_Pos ) \
246 : : m_xResultSetOrigin->absolute( nOldOriginal_Pos ); \
247 : : else if( bOldOriginal_AfterLast ) \
248 : : m_xResultSetOrigin->afterLast(); \
249 : : else \
250 : : m_xResultSetOrigin->beforeFirst(); \
251 : : \
252 : : return aRet; \
253 : : } \
254 : : for( ; nN <= nRowCount; ) \
255 : : { \
256 : : impl_loadRow( aRet.Rows[nN-1], loadInterface ); \
257 : : nN++; \
258 : : if( nN <= nRowCount ) \
259 : : { \
260 : : if( bDirection ) \
261 : : { \
262 : : if( !m_xResultSetOrigin->next() ) \
263 : : { \
264 : : aRet.Rows.realloc( nN-1 ); \
265 : : aRet.FetchError = FetchError::ENDOFDATA; \
266 : : break; \
267 : : } \
268 : : } \
269 : : else \
270 : : { \
271 : : if( !m_xResultSetOrigin->previous() ) \
272 : : { \
273 : : aRet.Rows.realloc( nN-1 ); \
274 : : aRet.FetchError = FetchError::ENDOFDATA; \
275 : : break; \
276 : : } \
277 : : } \
278 : : } \
279 : : } \
280 : : } \
281 : : catch( SQLException& ) \
282 : : { \
283 : : aRet.Rows.realloc( nN-1 ); \
284 : : aRet.FetchError = FetchError::EXCEPTION; \
285 : : } \
286 : : /*restore old position*/ \
287 : : if( nOldOriginal_Pos ) \
288 : : m_xResultSetOrigin->absolute( nOldOriginal_Pos ); \
289 : : else if( bOldOriginal_AfterLast ) \
290 : : m_xResultSetOrigin->afterLast(); \
291 : : else \
292 : : m_xResultSetOrigin->beforeFirst(); \
293 : : return aRet;
294 : :
295 : 0 : FetchResult SAL_CALL CachedContentResultSetStub
296 : : ::fetch( sal_Int32 nRowStartPosition
297 : : , sal_Int32 nRowCount, sal_Bool bDirection )
298 : : throw( RuntimeException )
299 : : {
300 : 0 : impl_init_xRowOrigin();
301 : 0 : FETCH_XXX( impl_getCurrentRowContent, m_xRowOrigin );
302 : : }
303 : :
304 : 0 : sal_Int32 SAL_CALL CachedContentResultSetStub
305 : : ::impl_getColumnCount()
306 : : {
307 : : sal_Int32 nCount;
308 : : sal_Bool bCached;
309 : : {
310 : 0 : osl::Guard< osl::Mutex > aGuard( m_aMutex );
311 : 0 : nCount = m_nColumnCount;
312 : 0 : bCached = m_bColumnCountCached;
313 : : }
314 : 0 : if( !bCached )
315 : : {
316 : : try
317 : : {
318 : 0 : Reference< XResultSetMetaData > xMetaData = getMetaData();
319 : 0 : if( xMetaData.is() )
320 : 0 : nCount = xMetaData->getColumnCount();
321 : : }
322 : 0 : catch( SQLException& )
323 : : {
324 : : OSL_FAIL( "couldn't determine the column count" );
325 : 0 : nCount = 0;
326 : : }
327 : : }
328 : 0 : osl::Guard< osl::Mutex > aGuard( m_aMutex );
329 : 0 : m_nColumnCount = nCount;
330 : 0 : m_bColumnCountCached = sal_True;
331 : 0 : return m_nColumnCount;
332 : : }
333 : :
334 : 0 : void SAL_CALL CachedContentResultSetStub
335 : : ::impl_getCurrentRowContent( Any& rRowContent
336 : : , Reference< XRow > xRow )
337 : : throw ( SQLException, RuntimeException )
338 : : {
339 : 0 : sal_Int32 nCount = impl_getColumnCount();
340 : :
341 : 0 : Sequence< Any > aContent( nCount );
342 : 0 : for( sal_Int32 nN = 1; nN <= nCount; nN++ )
343 : : {
344 : 0 : aContent[nN-1] = xRow->getObject( nN, NULL );
345 : : }
346 : :
347 : 0 : rRowContent <<= aContent;
348 : 0 : }
349 : :
350 : 0 : void SAL_CALL CachedContentResultSetStub
351 : : ::impl_propagateFetchSizeAndDirection( sal_Int32 nFetchSize, sal_Bool bFetchDirection )
352 : : throw ( RuntimeException )
353 : : {
354 : : //this is done only for the case, that there is another CachedContentResultSet in the chain of underlying ResulSets
355 : :
356 : : //we do not propagate the property 'FetchSize' or 'FetchDirection' via 'setPropertyValue' from the above CachedContentResultSet to save remote calls
357 : :
358 : : //if the underlying ResultSet has a property FetchSize and FetchDirection,
359 : : //we will set these properties, if the new given parameters are different from the last ones
360 : :
361 : 0 : if( !m_bNeedToPropagateFetchSize )
362 : 0 : return;
363 : :
364 : : sal_Bool bNeedAction;
365 : : sal_Int32 nLastSize;
366 : : sal_Bool bLastDirection;
367 : : sal_Bool bFirstPropagationDone;
368 : : {
369 : 0 : osl::Guard< osl::Mutex > aGuard( m_aMutex );
370 : 0 : bNeedAction = m_bNeedToPropagateFetchSize;
371 : 0 : nLastSize = m_nLastFetchSize;
372 : 0 : bLastDirection = m_bLastFetchDirection;
373 : 0 : bFirstPropagationDone = m_bFirstFetchSizePropagationDone;
374 : : }
375 : 0 : if( bNeedAction )
376 : : {
377 : 0 : if( nLastSize == nFetchSize
378 : : && bLastDirection == bFetchDirection
379 : : && bFirstPropagationDone == sal_True )
380 : 0 : return;
381 : :
382 : 0 : if(!bFirstPropagationDone)
383 : : {
384 : : //check whether the properties 'FetchSize' and 'FetchDirection' do exist
385 : :
386 : 0 : Reference< XPropertySetInfo > xPropertySetInfo = getPropertySetInfo();
387 : 0 : sal_Bool bHasSize = xPropertySetInfo->hasPropertyByName( m_aPropertyNameForFetchSize );
388 : 0 : sal_Bool bHasDirection = xPropertySetInfo->hasPropertyByName( m_aPropertyNameForFetchDirection );
389 : :
390 : 0 : if(!bHasSize || !bHasDirection)
391 : : {
392 : 0 : osl::Guard< osl::Mutex > aGuard( m_aMutex );
393 : 0 : m_bNeedToPropagateFetchSize = sal_False;
394 : 0 : return;
395 : 0 : }
396 : : }
397 : :
398 : 0 : sal_Bool bSetSize = ( nLastSize !=nFetchSize ) || !bFirstPropagationDone;
399 : 0 : sal_Bool bSetDirection = ( bLastDirection !=bFetchDirection ) || !bFirstPropagationDone;
400 : :
401 : : {
402 : 0 : osl::Guard< osl::Mutex > aGuard( m_aMutex );
403 : 0 : m_bFirstFetchSizePropagationDone = sal_True;
404 : 0 : m_nLastFetchSize = nFetchSize;
405 : 0 : m_bLastFetchDirection = bFetchDirection;
406 : : }
407 : :
408 : 0 : if( bSetSize )
409 : : {
410 : 0 : Any aValue;
411 : 0 : aValue <<= nFetchSize;
412 : : try
413 : : {
414 : 0 : setPropertyValue( m_aPropertyNameForFetchSize, aValue );
415 : : }
416 : 0 : catch( com::sun::star::uno::Exception& ) {}
417 : : }
418 : 0 : if( bSetDirection )
419 : : {
420 : 0 : sal_Int32 nFetchDirection = FetchDirection::FORWARD;
421 : 0 : if( !bFetchDirection )
422 : 0 : nFetchDirection = FetchDirection::REVERSE;
423 : 0 : Any aValue;
424 : 0 : aValue <<= nFetchDirection;
425 : : try
426 : : {
427 : 0 : setPropertyValue( m_aPropertyNameForFetchDirection, aValue );
428 : : }
429 : 0 : catch( com::sun::star::uno::Exception& ) {}
430 : : }
431 : :
432 : : }
433 : : }
434 : :
435 : : //-----------------------------------------------------------------
436 : : // XFetchProviderForContentAccess methods.
437 : : //-----------------------------------------------------------------
438 : :
439 : 0 : void SAL_CALL CachedContentResultSetStub
440 : : ::impl_getCurrentContentIdentifierString( Any& rAny
441 : : , Reference< XContentAccess > xContentAccess )
442 : : throw ( RuntimeException )
443 : : {
444 : 0 : rAny <<= xContentAccess->queryContentIdentifierString();
445 : 0 : }
446 : :
447 : 0 : void SAL_CALL CachedContentResultSetStub
448 : : ::impl_getCurrentContentIdentifier( Any& rAny
449 : : , Reference< XContentAccess > xContentAccess )
450 : : throw ( RuntimeException )
451 : : {
452 : 0 : rAny <<= xContentAccess->queryContentIdentifier();
453 : 0 : }
454 : :
455 : 0 : void SAL_CALL CachedContentResultSetStub
456 : : ::impl_getCurrentContent( Any& rAny
457 : : , Reference< XContentAccess > xContentAccess )
458 : : throw ( RuntimeException )
459 : : {
460 : 0 : rAny <<= xContentAccess->queryContent();
461 : 0 : }
462 : :
463 : : //virtual
464 : 0 : FetchResult SAL_CALL CachedContentResultSetStub
465 : : ::fetchContentIdentifierStrings( sal_Int32 nRowStartPosition
466 : : , sal_Int32 nRowCount, sal_Bool bDirection )
467 : : throw( com::sun::star::uno::RuntimeException )
468 : : {
469 : 0 : impl_init_xContentAccessOrigin();
470 : 0 : FETCH_XXX( impl_getCurrentContentIdentifierString, m_xContentAccessOrigin );
471 : : }
472 : :
473 : : //virtual
474 : 0 : FetchResult SAL_CALL CachedContentResultSetStub
475 : : ::fetchContentIdentifiers( sal_Int32 nRowStartPosition
476 : : , sal_Int32 nRowCount, sal_Bool bDirection )
477 : : throw( com::sun::star::uno::RuntimeException )
478 : : {
479 : 0 : impl_init_xContentAccessOrigin();
480 : 0 : FETCH_XXX( impl_getCurrentContentIdentifier, m_xContentAccessOrigin );
481 : : }
482 : :
483 : : //virtual
484 : 0 : FetchResult SAL_CALL CachedContentResultSetStub
485 : : ::fetchContents( sal_Int32 nRowStartPosition
486 : : , sal_Int32 nRowCount, sal_Bool bDirection )
487 : : throw( com::sun::star::uno::RuntimeException )
488 : : {
489 : 0 : impl_init_xContentAccessOrigin();
490 : 0 : FETCH_XXX( impl_getCurrentContent, m_xContentAccessOrigin );
491 : : }
492 : :
493 : : //--------------------------------------------------------------------------
494 : : //--------------------------------------------------------------------------
495 : : // class CachedContentResultSetStubFactory
496 : : //--------------------------------------------------------------------------
497 : : //--------------------------------------------------------------------------
498 : :
499 : 0 : CachedContentResultSetStubFactory::CachedContentResultSetStubFactory(
500 : 0 : const Reference< XMultiServiceFactory > & rSMgr )
501 : : {
502 : 0 : m_xSMgr = rSMgr;
503 : 0 : }
504 : :
505 : 0 : CachedContentResultSetStubFactory::~CachedContentResultSetStubFactory()
506 : : {
507 : 0 : }
508 : :
509 : : //--------------------------------------------------------------------------
510 : : // CachedContentResultSetStubFactory XInterface methods.
511 : : //--------------------------------------------------------------------------
512 : :
513 : 0 : XINTERFACE_IMPL_3( CachedContentResultSetStubFactory,
514 : : XTypeProvider,
515 : : XServiceInfo,
516 : : XCachedContentResultSetStubFactory );
517 : :
518 : : //--------------------------------------------------------------------------
519 : : // CachedContentResultSetStubFactory XTypeProvider methods.
520 : : //--------------------------------------------------------------------------
521 : :
522 : 0 : XTYPEPROVIDER_IMPL_3( CachedContentResultSetStubFactory,
523 : : XTypeProvider,
524 : : XServiceInfo,
525 : : XCachedContentResultSetStubFactory );
526 : :
527 : : //--------------------------------------------------------------------------
528 : : // CachedContentResultSetStubFactory XServiceInfo methods.
529 : : //--------------------------------------------------------------------------
530 : :
531 : 0 : XSERVICEINFO_IMPL_1( CachedContentResultSetStubFactory,
532 : : OUString( "com.sun.star.comp.ucb.CachedContentResultSetStubFactory" ),
533 : 0 : OUString( CACHED_CRS_STUB_FACTORY_NAME ) );
534 : :
535 : : //--------------------------------------------------------------------------
536 : : // Service factory implementation.
537 : : //--------------------------------------------------------------------------
538 : :
539 : 0 : ONE_INSTANCE_SERVICE_FACTORY_IMPL( CachedContentResultSetStubFactory );
540 : :
541 : : //--------------------------------------------------------------------------
542 : : // CachedContentResultSetStubFactory XCachedContentResultSetStubFactory methods.
543 : : //--------------------------------------------------------------------------
544 : :
545 : : //virtual
546 : 0 : Reference< XResultSet > SAL_CALL CachedContentResultSetStubFactory
547 : : ::createCachedContentResultSetStub(
548 : : const Reference< XResultSet > & xSource )
549 : : throw( RuntimeException )
550 : : {
551 : 0 : if( xSource.is() )
552 : : {
553 : 0 : Reference< XResultSet > xRet;
554 : 0 : xRet = new CachedContentResultSetStub( xSource );
555 : 0 : return xRet;
556 : : }
557 : 0 : return NULL;
558 : : }
559 : :
560 : :
561 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|