summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configmgr/source/treecache/disposetimer.cxx33
-rw-r--r--configmgr/source/treecache/disposetimer.hxx29
2 files changed, 34 insertions, 28 deletions
diff --git a/configmgr/source/treecache/disposetimer.cxx b/configmgr/source/treecache/disposetimer.cxx
index 07e0557ac8ba..6ac9f768d0d4 100644
--- a/configmgr/source/treecache/disposetimer.cxx
+++ b/configmgr/source/treecache/disposetimer.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: disposetimer.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: lla $ $Date: 2001-01-29 13:02:58 $
+ * last change: $Author: dg $ $Date: 2001-02-13 16:14:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -399,7 +399,7 @@ void OTreeCacheWriteScheduler::stopAndWriteCache()
m_xTimer->stop(); // just to be sure
m_xTimer.unbind(); // just to be sure
}
- runDisposer();
+ runWriter();
}
// -------------------------------------------------------------------------
void OTreeCacheWriteScheduler::Timer::onShot()
@@ -415,7 +415,7 @@ void OTreeCacheWriteScheduler::onTimerShot()
try
{
- runDisposer();
+ runWriter();
}
catch (...)
{
@@ -428,7 +428,7 @@ void OTreeCacheWriteScheduler::onTimerShot()
implStartBefore(aNewTime);
}
// -------------------------------------------------------------------------
-void OTreeCacheWriteScheduler::runDisposer()
+void OTreeCacheWriteScheduler::runWriter()
{
// Write Cache
CFG_TRACE_INFO("Starting lasy write");
@@ -441,13 +441,17 @@ void OTreeCacheWriteScheduler::runDisposer()
vos::ORef< OOptions > xTaskOption = *it;
if (xTaskOption.isValid())
{
- sal_Int32 nErrorCount = writeOneTreeFoundByOption(xTaskOption);
- if (nErrorCount == 0)
+ try
+ {
+ writeOneTreeFoundByOption(xTaskOption);
+ }
+ catch (uno::Exception&)
{
it = m_aWriteList.erase(it);
}
- else
- ++it;
+
+ // TODO error handling not correct at the moment
+ it = m_aWriteList.erase(it);
}
else
{
@@ -459,17 +463,14 @@ void OTreeCacheWriteScheduler::runDisposer()
}
// -----------------------------------------------------------------------------
-sal_Int32 OTreeCacheWriteScheduler::writeOneTreeFoundByOption(vos::ORef< OOptions > const& _xOptions)
+void OTreeCacheWriteScheduler::writeOneTreeFoundByOption(vos::ORef< OOptions > const& _xOptions) throw (lang::WrappedTargetException, uno::RuntimeException)
{
- sal_Int32 nErrorCount = 0;
if (TreeInfo* pInfo = m_rTreeManager.requestTreeInfo(_xOptions,false))
{
CFG_TRACE_INFO_NI("- Found matching data container (TreeInfo) - collecting data");
-
- nErrorCount = pInfo->syncPending(_xOptions, m_rTreeManager);
+ pInfo->syncPending(_xOptions, m_rTreeManager);
// we got a pending list with pointers from TreeInfo.
}
- return nErrorCount;
}
// -----------------------------------------------------------------------------
@@ -505,7 +506,7 @@ void OTreeCacheWriteScheduler::implStartBefore(TimeStamp const& _aTime)
}
// -----------------------------------------------------------------------------
-void OTreeCacheWriteScheduler::scheduleWrite(vos::ORef< OOptions > const& _xOptions, bool _bSync)
+void OTreeCacheWriteScheduler::scheduleWrite(vos::ORef< OOptions > const& _xOptions, bool _bAsync) throw (lang::WrappedTargetException, uno::RuntimeException)
{
OSL_ASSERT(_xOptions.isValid());
OSL_ENSURE(_xOptions->getLocale().getLength() >0, "ERROR: OTreeDisposeScheduler: cannot handle complete user scheduling");
@@ -517,7 +518,7 @@ void OTreeCacheWriteScheduler::scheduleWrite(vos::ORef< OOptions > const& _xOpti
CFG_TRACE_INFO_NI("- cache write will be started in about %d seconds", int(m_aCleanupInterval.getTimeValue().Seconds));
- if (_bSync || m_bSyncron)
+ if (_bAsync)
{
// lasy writing
m_aWriteList.push_back(_xOptions);
diff --git a/configmgr/source/treecache/disposetimer.hxx b/configmgr/source/treecache/disposetimer.hxx
index 2f637542eda1..df4acc7d9c97 100644
--- a/configmgr/source/treecache/disposetimer.hxx
+++ b/configmgr/source/treecache/disposetimer.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: disposetimer.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: lla $ $Date: 2001-01-29 13:02:58 $
+ * last change: $Author: dg $ $Date: 2001-02-13 16:14:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,15 +62,25 @@
#ifndef CONFIGMGR_DISPOSETIMER_HXX
#define CONFIGMGR_DISPOSETIMER_HXX
+#ifndef _COM_SUN_STAR_LANG_WRAPPEDTARGETEXCEPTION_HPP_
+#include <com/sun/star/lang/WrappedTargetException.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_UNO_RUNTIMEEXCEPTION_HPP_
+#include <com/sun/star/uno/RuntimeException.hpp>
+#endif
+
#include "apitypes.hxx"
#include "timestamp.hxx"
#include "options.hxx"
#include <osl/mutex.hxx>
#include <vos/timer.hxx>
#include <map>
-// #include <queue>
#include <list>
+namespace uno = ::com::sun::star::uno;
+namespace lang = ::com::sun::star::lang;
+
namespace configmgr
{
class TreeManager;
@@ -221,16 +231,13 @@ namespace configmgr
// TimeInterval m_aCleanupDelay;
TimeInterval m_aCleanupInterval;
- bool m_bSyncron; // if true, write syncron only, no timer thread
-
public:
//-------- Construction and destruction -----------------------------------
explicit
- OTreeCacheWriteScheduler(TreeManager& _rTreeManager, TimeInterval const& _aCleanupDelay, bool _bSyncron)
+ OTreeCacheWriteScheduler(TreeManager& _rTreeManager, TimeInterval const& _aCleanupDelay)
: m_xTimer(0)
, m_rTreeManager(_rTreeManager)
, m_aCleanupInterval(_aCleanupDelay)
- , m_bSyncron(_bSyncron)
{}
~OTreeCacheWriteScheduler();
@@ -251,9 +258,7 @@ namespace configmgr
return aBaseTime + aDelay;
}
//-------- Control of execution ------------------------------------------
- /// stop and discard pending activities for _xOptions
- // void writeCache(vos::ORef< OOptions > const& _xOptions);
- void scheduleWrite(vos::ORef< OOptions > const& _xOptions, bool _bSync = false);
+ void scheduleWrite(vos::ORef< OOptions > const& _xOptions, bool _bASync = false) throw ( lang::WrappedTargetException, uno::RuntimeException);
/// stop and discard pending activities
void stopAndWriteCache();
@@ -261,9 +266,9 @@ namespace configmgr
// vos::OTimer
void onTimerShot();
- void runDisposer();
+ void runWriter();
void implStartBefore(TimeStamp const& _aTime);
- sal_Int32 writeOneTreeFoundByOption(vos::ORef< OOptions > const& _xOption);
+ void writeOneTreeFoundByOption(vos::ORef< OOptions > const& _xOption) throw (lang::WrappedTargetException, uno::RuntimeException);
};
////////////////////////////////////////////////////////////////////////////////
} // namespace configmgr