Skip to Content.
Sympa Menu

idok-commit - [idok-commit] idok commit r342 - 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 r342 - 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 r342 - trunk/java/ch/idok/dmsd/impl/extractor/microsoft
  • Date: Thu, 12 Mar 2009 17:41:42 +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:41:41 2009
New Revision: 342

Log:
Adding some delays to give Open Office a break

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:41:41 2009
@@ -111,7 +111,7 @@
*
* After that many extractions, OpenOffice will be restarted.
*/
- private static final int ooRestartThreshold = 10;
+ private static final int ooRestartThreshold = 40;

/**
* @brief Maximum time for finishing text extraction in milliseconds
@@ -131,6 +131,16 @@
static long reconnectDelay = 500;

/**
+ * @brief Delay for letting Open Office start properly
+ */
+ static long startupDelay = 1000;
+
+ /**
+ * @brief Delay for letting Open Office shutdown properly
+ */
+ static long destroyDelay = 1000;
+
+ /**
* @brief Timer task for shooting down the Extractor due to lack of
progress
*/
final class InterruptTimerTask extends TimerTask {
@@ -415,11 +425,19 @@
try {
soffice.getInputStream().close();
soffice.getOutputStream().close();
+ Timer timer = new Timer("OpenOffice Shutdown Watchdog");
+ timer.schedule(new
TimeoutTimerTask(Thread.currentThread()), reconnectDelay);
+ desktop.terminate();
+ timer.cancel();
+ Thread.sleep(destroyDelay);
} catch (Throwable th) {}
soffice.destroy();
}
} catch (Throwable th) {
logger.finer("Can't destroy OO process\n"+th);
+ } finally {
+ desktop = null;
+ soffice = null;
}
}

@@ -481,6 +499,7 @@
Throwable connectEx = null;
logger.finest("Starting OO process");
soffice = procBuilder.start();
+ Thread.sleep(startupDelay);
Timer timer = new Timer("OpenOffice Connection Timeout
Watchdog");
TimeoutTimerTask watchdog = new
TimeoutTimerTask(Thread.currentThread());
for (int retry = 30; (unoObj == null) && (retry > 0); --retry) {



  • [idok-commit] idok commit r342 - 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