Kaydet (Commit) e1040e73 authored tarafından Oliver Bolte's avatar Oliver Bolte

INTEGRATION: CWS qadev25 (1.5.6); FILE MERGED

2005/11/22 12:00:20 lla 1.5.6.1: #127811# AppKillCommand could hold more then one kill command, separator is ';'
üst 812d0751
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: OfficeWatcher.java,v $ * $RCSfile: OfficeWatcher.java,v $
* *
* $Revision: 1.5 $ * $Revision: 1.6 $
* *
* last change: $Author: rt $ $Date: 2005-09-08 17:19:49 $ * last change: $Author: obo $ $Date: 2006-01-19 14:23:56 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -43,6 +43,7 @@ import com.sun.star.frame.XComponentLoader; ...@@ -43,6 +43,7 @@ import com.sun.star.frame.XComponentLoader;
import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.UnoRuntime;
import com.sun.star.lang.XComponent; import com.sun.star.lang.XComponent;
import com.sun.star.beans.PropertyValue; import com.sun.star.beans.PropertyValue;
import java.util.StringTokenizer;
public class OfficeWatcher extends Thread implements share.Watcher { public class OfficeWatcher extends Thread implements share.Watcher {
...@@ -99,13 +100,24 @@ public class OfficeWatcher extends Thread implements share.Watcher { ...@@ -99,13 +100,24 @@ public class OfficeWatcher extends Thread implements share.Watcher {
System.out.println("OfficeWatcher: the Office is idle for " + timeOut/1000 System.out.println("OfficeWatcher: the Office is idle for " + timeOut/1000
+ " seconds, it probably hangs and is killed NOW."); + " seconds, it probably hangs and is killed NOW.");
String AppKillCommand = (String) params.get ("AppKillCommand"); String AppKillCommand = (String) params.get ("AppKillCommand");
if (AppKillCommand != null) { if (AppKillCommand != null)
System.out.println("User defined an application to destroy the started process."); {
System.out.println("Trying to execute: "+AppKillCommand); StringTokenizer aKillCommandToken = new StringTokenizer( AppKillCommand,";" );
try { while (aKillCommandToken.hasMoreTokens())
Runtime.getRuntime ().exec (AppKillCommand); {
} catch (java.io.IOException e) { String sKillCommand = aKillCommandToken.nextToken();
e.printStackTrace ();
System.out.println("User defined an application to destroy the started process.");
System.out.println("Trying to execute: "+sKillCommand);
try
{
Runtime.getRuntime().exec(sKillCommand);
shortWait(2000);
}
catch (java.io.IOException e)
{
e.printStackTrace ();
}
} }
} }
ph.kill(); ph.kill();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment