summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorKai Sommerfeld <kso@openoffice.org>2000-12-21 08:31:52 +0000
committerKai Sommerfeld <kso@openoffice.org>2000-12-21 08:31:52 +0000
commitf22f3967e0f8cd0691648f4a23914bd98f011d10 (patch)
tree2d68a8fa10e2ca1fa8cadbc810e663f731ec74a8 /ucb
parent76c92d6c36b3c09c4eaa38fd742296c0c2f66243 (diff)
#82494# - Workaround to reduce CPU load in case config data are broken.
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/hierarchy/hierarchydata.cxx17
-rw-r--r--ucb/source/ucp/hierarchy/hierarchydata.hxx5
-rw-r--r--ucb/source/ucp/hierarchy/hierarchyprovider.cxx17
-rw-r--r--ucb/source/ucp/hierarchy/hierarchyprovider.hxx5
4 files changed, 34 insertions, 10 deletions
diff --git a/ucb/source/ucp/hierarchy/hierarchydata.cxx b/ucb/source/ucp/hierarchy/hierarchydata.cxx
index 736e4230e68d..4cce370acd98 100644
--- a/ucb/source/ucp/hierarchy/hierarchydata.cxx
+++ b/ucb/source/ucp/hierarchy/hierarchydata.cxx
@@ -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(
diff --git a/ucb/source/ucp/hierarchy/hierarchydata.hxx b/ucb/source/ucp/hierarchy/hierarchydata.hxx
index 68f73492ddc8..a8f197745351 100644
--- a/ucb/source/ucp/hierarchy/hierarchydata.hxx
+++ b/ucb/source/ucp/hierarchy/hierarchydata.hxx
@@ -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 );
diff --git a/ucb/source/ucp/hierarchy/hierarchyprovider.cxx b/ucb/source/ucp/hierarchy/hierarchyprovider.cxx
index 1e8de1f93f68..fab14ee3d1bb 100644
--- a/ucb/source/ucp/hierarchy/hierarchyprovider.cxx
+++ b/ucb/source/ucp/hierarchy/hierarchyprovider.cxx
@@ -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(
diff --git a/ucb/source/ucp/hierarchy/hierarchyprovider.hxx b/ucb/source/ucp/hierarchy/hierarchyprovider.hxx
index 11396f012616..dd5a473fb9ec 100644
--- a/ucb/source/ucp/hierarchy/hierarchyprovider.hxx
+++ b/ucb/source/ucp/hierarchy/hierarchyprovider.hxx
@@ -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(