Ver código fonte

1.重构了程序。
2.添加了java控制台。

YangZhiJie 7 anos atrás
pai
commit
889499245d

+ 27 - 0
src/main/java/com/leanwo/management/service/ExecuteWatchdogEx.java

@@ -0,0 +1,27 @@
+package com.leanwo.management.service;
+
+import org.apache.commons.exec.ExecuteWatchdog;
+
+public class ExecuteWatchdogEx extends ExecuteWatchdog {
+
+	protected Process mProcess;
+	
+	public ExecuteWatchdogEx(long timeout) {
+		super(timeout);
+	}
+
+	@Override
+	public synchronized void start(Process processToMonitor) {
+		this.mProcess = processToMonitor;
+		super.start(processToMonitor);
+	}
+	
+	public synchronized boolean isAlive() {
+		if(mProcess == null) {
+			return false;
+		}else {
+			return mProcess.isAlive();
+		}
+	}
+
+}

+ 10 - 0
src/main/java/com/leanwo/management/util/Variable.java

@@ -0,0 +1,10 @@
+package com.leanwo.management.util;
+
+public class Variable {
+
+	public static final String RUNNING = "运行中";
+	
+	public static final String NOT_RUNNING = "未启动";
+	
+	public static final String LOADING = "加载中";
+}