Skip to Content.
Sympa Menu

idok-commit - [idok-commit] idok commit r341 - trunk/java/ch/idok/dmsd/impl/extractor/microsoft

idok-commit AT lists.psi.ch

Subject: Commit emails of the iDok project

List archive

[idok-commit] idok commit r341 - trunk/java/ch/idok/dmsd/impl/extractor/microsoft


Chronological Thread 
  • From: "AFS account Stadler Hans Christian" <stadler_h AT savannah.psi.ch>
  • To: idok-commit AT lists.psi.ch
  • Subject: [idok-commit] idok commit r341 - trunk/java/ch/idok/dmsd/impl/extractor/microsoft
  • Date: Thu, 12 Mar 2009 17:16:28 +0100
  • List-archive: <https://lists.web.psi.ch/pipermail/idok-commit/>
  • List-id: Commit emails of the iDok project <idok-commit.lists.psi.ch>

Author: stadler_h
Date: Thu Mar 12 17:16:28 2009
New Revision: 341

Log:
Adding Open Office retry loop

Modified:

trunk/java/ch/idok/dmsd/impl/extractor/microsoft/MSOfficeExtractorFactory.java

Modified:
trunk/java/ch/idok/dmsd/impl/extractor/microsoft/MSOfficeExtractorFactory.java
==============================================================================
---
trunk/java/ch/idok/dmsd/impl/extractor/microsoft/MSOfficeExtractorFactory.java
(original)
+++
trunk/java/ch/idok/dmsd/impl/extractor/microsoft/MSOfficeExtractorFactory.java
Thu Mar 12 17:16:28 2009
@@ -114,14 +114,21 @@
private static final int ooRestartThreshold = 10;

/**
- * @brief Maximum time for finishing text extraction
+ * @brief Maximum time for finishing text extraction in milliseconds
*
* Default is 10s, can be changed using the
* ch.idok.dmsd.impl.extractor.microsoft.interruptdelay
* property.
*/
static long interruptDelay = 10000;
-
+
+ /**
+ * @brief Delay for reconnection retries to Open Office in milliseconds
+ *
+ * This time span is also used for the Open Office connection timeout
+ * watchdog timer.
+ */
+ static long reconnectDelay = 500;

/**
* @brief Timer task for shooting down the Extractor due to lack of
progress
@@ -478,13 +485,13 @@
TimeoutTimerTask watchdog = new
TimeoutTimerTask(Thread.currentThread());
for (int retry = 30; (unoObj == null) && (retry > 0); --retry) {
try {
- timer.schedule(watchdog , 200);
+ timer.schedule(watchdog , reconnectDelay);
unoObj = urlResolver.resolve("uno:" +
connectString(unoPort) +
"StarOffice.ServiceManager");
} catch (Throwable ex) {
logger.finest("Can't connect to OO, "+retry+" retries
remaining\n"+ex);
connectEx = ex;
- Thread.sleep(200);
+ Thread.sleep(reconnectDelay);
} finally {
watchdog.cancel();
}
@@ -555,7 +562,20 @@
logger.finest("Initializing extractor factory for MS Office
Documents.");
interruptDelay
=Long.parseLong(System.getProperty("ch.idok.dmsd.impl.extractor.microsoft.interruptdelay",
Long.toString(interruptDelay)));
- initOpenOffice();
+ int loop=5;
+ do {
+ try {
+ initOpenOffice();
+ break;
+ } catch (Throwable th) {
+ if (loop == 1)
+ throw th;
+ loop--;
+ logger.warning("Couldn't initialize Open Office, " + loop
+ + "retries remaining");
+ Thread.sleep(1000);
+ }
+ } while(true);
Runtime.getRuntime().addShutdownHook(new Thread (new Runnable() {
@Override
public void run() {



  • [idok-commit] idok commit r341 - trunk/java/ch/idok/dmsd/impl/extractor/microsoft, AFS account Stadler Hans Christian, 03/12/2009

Archive powered by MHonArc 2.6.19.

Top of Page