#82494# - Workaround to reduce CPU load in case config data are broken.

This commit is contained in:
Kai Sommerfeld 2000-12-21 08:31:52 +00:00
parent 76c92d6c36
commit f22f3967e0
4 changed files with 34 additions and 10 deletions

View file

@ -2,9 +2,9 @@
*
* $RCSfile: hierarchydata.cxx,v $
*
* $Revision: 1.11 $
* $Revision: 1.12 $
*
* last change: $Author: kso $ $Date: 2000-12-10 15:13:51 $
* last change: $Author: kso $ $Date: 2000-12-21 09:31:52 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -139,7 +139,8 @@ HierarchyEntry::HierarchyEntry(
const Reference< XMultiServiceFactory >& rSMgr,
HierarchyContentProvider* pProvider,
const OUString& rURL )
: m_xSMgr( rSMgr )
: m_xSMgr( rSMgr ),
m_bTriedToGetRootReadAccess( sal_False )
{
if ( pProvider )
{
@ -1038,6 +1039,14 @@ Reference< XHierarchicalNameAccess > HierarchyEntry::getRootReadAccess()
osl::Guard< osl::Mutex > aGuard( m_aMutex );
if ( !m_xRootReadAccess.is() )
{
if ( m_bTriedToGetRootReadAccess ) // #82494#
{
OSL_ENSURE( sal_False,
"HierarchyEntry::getRootReadAccess - "
"Unable to read any config data! -> #82494#" );
return Reference< XHierarchicalNameAccess >();
}
try
{
if ( !m_xConfigProvider.is() )
@ -1056,6 +1065,8 @@ Reference< XHierarchicalNameAccess > HierarchyEntry::getRootReadAccess()
aArguments[ 0 ]
<<= OUString::createFromAscii( HIERARCHY_ROOT_DB_KEY );
m_bTriedToGetRootReadAccess = sal_True;
m_xRootReadAccess = Reference< XHierarchicalNameAccess >(
m_xConfigProvider->createInstanceWithArguments(
OUString::createFromAscii(

View file

@ -2,9 +2,9 @@
*
* $RCSfile: hierarchydata.hxx,v $
*
* $Revision: 1.6 $
* $Revision: 1.7 $
*
* last change: $Author: kso $ $Date: 2000-12-10 15:13:51 $
* last change: $Author: kso $ $Date: 2000-12-21 09:31:52 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -116,6 +116,7 @@ class HierarchyEntry
::com::sun::star::uno::Reference<
::com::sun::star::container::XHierarchicalNameAccess >
m_xRootReadAccess;
sal_Bool m_bTriedToGetRootReadAccess; // #82494#
private:
::rtl::OUString createPathFromHierarchyURL( const ::rtl::OUString& rURL );

View file

@ -2,9 +2,9 @@
*
* $RCSfile: hierarchyprovider.cxx,v $
*
* $Revision: 1.3 $
* $Revision: 1.4 $
*
* last change: $Author: kso $ $Date: 2000-12-10 15:13:51 $
* last change: $Author: kso $ $Date: 2000-12-21 09:31:52 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -100,7 +100,8 @@ using namespace hierarchy_ucp;
HierarchyContentProvider::HierarchyContentProvider(
const Reference< XMultiServiceFactory >& rXSMgr )
: ::ucb::ContentProviderImplHelper( rXSMgr )
: ::ucb::ContentProviderImplHelper( rXSMgr ),
m_bTriedToGetRootReadAccess( sal_False )
{
}
@ -268,6 +269,14 @@ HierarchyContentProvider::getRootConfigReadNameAccess()
vos::OGuard aGuard( m_aMutex );
if ( !m_xRootConfigReadNameAccess.is() )
{
if ( m_bTriedToGetRootReadAccess ) // #82494#
{
OSL_ENSURE( sal_False,
"HierarchyContentProvider::getRootConfigReadNameAccess - "
"Unable to read any config data! -> #82494#" );
return Reference< XHierarchicalNameAccess >();
}
try
{
getConfigProvider();
@ -278,6 +287,8 @@ HierarchyContentProvider::getRootConfigReadNameAccess()
aArguments[ 0 ] <<= OUString::createFromAscii(
"/org.openoffice.ucb.Hierarchy/Root" );
m_bTriedToGetRootReadAccess = sal_True;
m_xRootConfigReadNameAccess
= Reference< XHierarchicalNameAccess >(
m_xConfigProvider->createInstanceWithArguments(

View file

@ -2,9 +2,9 @@
*
* $RCSfile: hierarchyprovider.hxx,v $
*
* $Revision: 1.3 $
* $Revision: 1.4 $
*
* last change: $Author: kso $ $Date: 2000-12-10 15:13:51 $
* last change: $Author: kso $ $Date: 2000-12-21 09:31:52 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -105,6 +105,7 @@ class HierarchyContentProvider : public ::ucb::ContentProviderImplHelper,
com::sun::star::uno::Reference<
com::sun::star::container::XHierarchicalNameAccess >
m_xRootConfigReadNameAccess;
sal_Bool m_bTriedToGetRootReadAccess; // #82494#
public:
HierarchyContentProvider(