diff options
Diffstat (limited to 'configmgr/source/treecache')
-rw-r--r-- | configmgr/source/treecache/cacheaccess.cxx | 18 | ||||
-rw-r--r-- | configmgr/source/treecache/cacheaccess.hxx | 3 | ||||
-rw-r--r-- | configmgr/source/treecache/cachecontroller.cxx | 132 | ||||
-rw-r--r-- | configmgr/source/treecache/cachecontroller.hxx | 3 | ||||
-rw-r--r-- | configmgr/source/treecache/cachemulticaster.cxx | 13 | ||||
-rw-r--r-- | configmgr/source/treecache/disposetimer.cxx | 19 | ||||
-rw-r--r-- | configmgr/source/treecache/disposetimer.hxx | 3 | ||||
-rw-r--r-- | configmgr/source/treecache/treemanager.cxx | 7 |
8 files changed, 0 insertions, 198 deletions
diff --git a/configmgr/source/treecache/cacheaccess.cxx b/configmgr/source/treecache/cacheaccess.cxx index 6f8101161f..831cd0f2f4 100644 --- a/configmgr/source/treecache/cacheaccess.cxx +++ b/configmgr/source/treecache/cacheaccess.cxx @@ -249,24 +249,6 @@ bool CacheLoadingAccess::findPendingChangedModules( std::vector< rtl::OUString > return !_rPendingList.empty(); } -// ----------------------------------------------------------------------------- -void CacheLoadingAccess::clearData(std::vector< rtl::Reference<CacheLine> >& _rList) SAL_THROW(()) -{ - CFG_TRACE_INFO("Tree Info: Removing all module trees for cleanup" ); - - ExtendedCacheData::ModuleList& rModules = this->m_aData.accessModuleList(); - - for(ExtendedCacheData::ModuleList::iterator it = rModules.begin(); - it != rModules.end(); - ++it) - { - if (it->second.is()) - _rList.push_back(it->second); - } - - rModules.clear(); - m_aDeadModules.clear(); -} // ------------------------------------------------------------------------- TimeStamp CacheLoadingAccess::collectDisposeList(std::vector< rtl::Reference<CacheLine> > & _rList, TimeStamp const & _aLimitTime, TimeInterval const & _aDelay) diff --git a/configmgr/source/treecache/cacheaccess.hxx b/configmgr/source/treecache/cacheaccess.hxx index fbe1396a9f..3956e7861c 100644 --- a/configmgr/source/treecache/cacheaccess.hxx +++ b/configmgr/source/treecache/cacheaccess.hxx @@ -134,9 +134,6 @@ namespace configmgr TimeStamp const & _aLimitTime, TimeInterval const & _aDelay); - /// clear the contained tree, return all remaining modules - void clearData( std::vector< rtl::Reference<CacheLine> >& _rDisposeList) SAL_THROW(()); - // stuff that is particular for CacheLoadingAccess /** add the given subtree at the given location, return the tree that is then pertinent and clientAcquire() it once diff --git a/configmgr/source/treecache/cachecontroller.cxx b/configmgr/source/treecache/cachecontroller.cxx index 6aa34a68ca..513e134e5a 100644 --- a/configmgr/source/treecache/cachecontroller.cxx +++ b/configmgr/source/treecache/cachecontroller.cxx @@ -151,138 +151,6 @@ void CacheController::dispose() SAL_THROW((com::sun::star::uno::RuntimeException } // ------------------------------------------------------------------------- -void CacheController::disposeOne(RequestOptions const & _aOptions, bool _bFlushUpdates) -{ - CFG_TRACE_INFO("CacheController: Disposing data and TreeInfo for user '%s' with locale '%s'", - OUSTRING2ASCII(_aOptions.getEntity()), OUSTRING2ASCII(_aOptions.getLocale()) ); - - m_pDisposer->clearTasks(_aOptions); - if (!m_pCacheWriter->clearTasks(_aOptions)) // had no pending updates - { - _bFlushUpdates = false; - } - else if (!_bFlushUpdates) - { - CFG_TRACE_WARNING_NI("Found orphaned Changes in the cache - Discarding."); - } - - rtl::Reference<CacheLoadingAccess> aRemoved = m_aCacheMap.remove(_aOptions); - - if (aRemoved.is()) - { - // got it out of reachability - now dispose/notify without lock - implDisposeOne(aRemoved, _aOptions, _bFlushUpdates); - } - else - CFG_TRACE_INFO_NI("- No affected TreeInfo found" ); -} - -// ------------------------------------------------------------------------- -void CacheController::disposeUser(RequestOptions const & _aUserOptions, bool _bFlushUpdates) -{ - CFG_TRACE_INFO("CacheController: Disposing data and TreeInfo(s) for user '%s'", - OUSTRING2ASCII(_aUserOptions.getEntity()) ); - - std::vector< std::pair< RequestOptions, rtl::Reference<CacheLoadingAccess> > > aDisposeList; - // collect the ones to dispose - { - rtl::OUString sUser = _aUserOptions.getEntity(); - OSL_ASSERT(sUser.getLength()); - - // This depends on the fact that Options are sorted (by struct ltOptions) - // so that all options belonging to one user are together - // (and that options with only a user set, sort first) - - CacheMap::Map aCacheData; - m_aCacheMap.swap(aCacheData); - - // find the lower_bound of all options for the user - CacheMap::Map::iterator const aFirst = aCacheData.lower_bound(_aUserOptions); - - // find the upper_bound of all options for the user (using the lower one) - CacheMap::Map::iterator aLast = aFirst; - while (aLast != aCacheData.end() && aLast->first.getEntity() == sUser) - ++aLast; - - if (aFirst != aLast) - { - aDisposeList.reserve( std::distance(aFirst, aLast) ); - - bool bHasPendingChanges = false; - - for (CacheMap::Map::iterator it = aFirst; it != aLast; ++it) - { - CFG_TRACE_INFO_NI("- Found TreeInfo for locale '%s'", OUSTRING2ASCII(it->first.getLocale()) ); - m_pDisposer->clearTasks(it->first); - - if (m_pCacheWriter->clearTasks(it->first)) - bHasPendingChanges = true; - - OSL_ASSERT(it->second.is()); - if (it->second.is()) - { - //aDisposeList.push_back( *it ); - aDisposeList.push_back( std::make_pair(it->first,it->second) ); - } - } - - if (!bHasPendingChanges) - _bFlushUpdates = false; - - else if (!_bFlushUpdates) - CFG_TRACE_WARNING_NI("Found orphaned Changes in the cache - Discarding."); - - aCacheData.erase(aFirst, aLast); - } - else - CFG_TRACE_INFO_NI("- No affected TreeInfo found" ); - - // replace the data into the map - m_aCacheMap.swap(aCacheData); - } - - // got all out of external reach - now dispose/notify without lock - for (std::vector< std::pair< RequestOptions, rtl::Reference<CacheLoadingAccess> > >::iterator i = aDisposeList.begin(); i != aDisposeList.end(); ++i) - { - if (i->second.is()) - implDisposeOne(i->second, i->first, _bFlushUpdates); - } -} - -// ------------------------------------------------------------------------- -void CacheController::implDisposeOne(rtl::Reference<CacheLoadingAccess> const & _aDisposedCache, RequestOptions const & _aOptions, bool _bFlushUpdates) -{ - OSL_ASSERT(_aDisposedCache.is()); - CFG_TRACE_INFO("Now removing Cache section (user '%s' with locale '%s')", - OUSTRING2ASCII(_aOptions.getEntity()), OUSTRING2ASCII(_aOptions.getLocale()) ); - - if (_bFlushUpdates) try - { - CFG_TRACE_INFO_NI("- Flushing pending changes" ); - - if ( !this->saveAllPendingChanges(_aDisposedCache,_aOptions) ) - { - CFG_TRACE_ERROR_NI("- Error while flushing - changes will be lost" ); - OSL_ENSURE(false,"Error while flushing changes from discarded Cache section - changes will be lost" ); - } - } - catch (uno::Exception& e) - { - (void)e; - CFG_TRACE_ERROR_NI("- Failed with exception %s (ignoring here)", OUSTRING2ASCII(e.Message) ); - } - - std::vector< rtl::Reference<CacheLine> > aDisposedList; - _aDisposedCache->clearData(aDisposedList); - - if (aDisposedList.size() > 0) - { - CFG_TRACE_INFO_NI("- Closing %d modules at the session",int(aDisposedList.size())); - this->closeModules(aDisposedList,_aOptions); - } -} - -// ------------------------------------------------------------------------- CacheController::CacheController(rtl::Reference< backend::IMergedDataProvider > const & _xBackend, const uno::Reference<uno::XComponentContext>& xContext) : m_aNotifier() diff --git a/configmgr/source/treecache/cachecontroller.hxx b/configmgr/source/treecache/cachecontroller.hxx index e62f82f9ae..bf6ca4b85e 100644 --- a/configmgr/source/treecache/cachecontroller.hxx +++ b/configmgr/source/treecache/cachecontroller.hxx @@ -311,9 +311,6 @@ namespace configmgr // disposing void disposeAll(bool _bFlushRemainingUpdates); - void disposeOne(RequestOptions const & _aOptions, bool _bFlushUpdates = true); - void disposeUser(RequestOptions const & _aUserOptions, bool _bFlushUpdates = true); - void implDisposeOne(rtl::Reference<CacheLoadingAccess> const & _aCache, RequestOptions const & _aOptions, bool _bFlushUpdates); void closeModules(std::vector< rtl::Reference<CacheLine> > & _aList, RequestOptions const & _aOptions); private: diff --git a/configmgr/source/treecache/cachemulticaster.cxx b/configmgr/source/treecache/cachemulticaster.cxx index d5c0e9a1ec..12e900fe76 100644 --- a/configmgr/source/treecache/cachemulticaster.cxx +++ b/configmgr/source/treecache/cachemulticaster.cxx @@ -52,20 +52,7 @@ namespace configmgr namespace { // manually implemented helpers, as rtl::References don't work well with std binders -// --------------------------------------------------------------------------- - - // replacing std::bind2nd( std::mem_fun(&aFunc), aArg ) - struct NotifyDisposing : std::unary_function<rtl::Reference<TreeManager>,void> - { - CacheController & m_arg; - NotifyDisposing(CacheController * _pProvider) SAL_THROW(()) - : m_arg(*_pProvider) - {} - - void operator()(rtl::Reference<TreeManager> const & _xListener) const SAL_THROW(()) - { _xListener->disposing(m_arg); } - }; // --------------------------------------------------------------------------- // replacing std::bind2nd( std::mem_fun(&TreeManager::componentCreated), _aComponentName ) diff --git a/configmgr/source/treecache/disposetimer.cxx b/configmgr/source/treecache/disposetimer.cxx index cabe6f39bc..c8afe1270a 100644 --- a/configmgr/source/treecache/disposetimer.cxx +++ b/configmgr/source/treecache/disposetimer.cxx @@ -77,25 +77,6 @@ bool equivalentOptions(RequestOptions const& lhs, RequestOptions const& rhs) } // ------------------------------------------------------------------------- -void OTreeDisposeScheduler::clearTasks(RequestOptions const& _aOptions) -{ - CFG_TRACE_INFO("Cancelling all data cleanup tasks for user '%s' with locale '%s'", - OUSTRING2ASCII(_aOptions.getEntity()), - OUSTRING2ASCII(_aOptions.getLocale())); - - Agenda::iterator it = m_aAgenda.begin(); - while(it != m_aAgenda.end()) - { - Agenda::iterator cur = it++; - if (equivalentOptions(_aOptions,cur->second)) - { - m_aAgenda.erase(cur); - CFG_TRACE_INFO_NI("- One pending task canceled"); - } - } -} -// ------------------------------------------------------------------------- - void OTreeDisposeScheduler::stopAndClearTasks() { CFG_TRACE_INFO("Cancelling all data cleanup tasks, Stopping Cleanup timer"); diff --git a/configmgr/source/treecache/disposetimer.hxx b/configmgr/source/treecache/disposetimer.hxx index 2f3beece63..b9ee058321 100644 --- a/configmgr/source/treecache/disposetimer.hxx +++ b/configmgr/source/treecache/disposetimer.hxx @@ -143,9 +143,6 @@ namespace configmgr /// ensure this will execute cleanup duties for _xOptions (no later than after getCleanupDelay() has elapsed) void scheduleCleanup(RequestOptions const & _aOptions); - /// stop and discard pending activities for _xOptions - void clearTasks(RequestOptions const & _aOptions); - /// stop and discard pending activities void stopAndClearTasks(); diff --git a/configmgr/source/treecache/treemanager.cxx b/configmgr/source/treecache/treemanager.cxx index 221939aba0..44b36bf53a 100644 --- a/configmgr/source/treecache/treemanager.cxx +++ b/configmgr/source/treecache/treemanager.cxx @@ -494,13 +494,6 @@ void TreeManager::nodeUpdated(TreeChangeList& _rChanges) // ---------------------------------------------------------------------------- -void TreeManager::disposing(backend::CacheController & /*_rProvider*/) SAL_THROW(()) -{ - CFG_TRACE_INFO("TreeManager: provider is being disposed"); - this->dispose(); -} -// ---------------------------------------------------------------------------- - void TreeManager::componentCreated(backend::ComponentRequest const & ) SAL_THROW(()) { CFG_TRACE_INFO("TreeManager: component was created"); |