1. 0.3.3 bug fix
This commit is contained in:
parent
b0701543b1
commit
23063b0d9c
2
pom.xml
2
pom.xml
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
<groupId>org.aohe</groupId>
|
<groupId>org.aohe</groupId>
|
||||||
<artifactId>sane-service</artifactId>
|
<artifactId>sane-service</artifactId>
|
||||||
<version>0.3.2</version>
|
<version>0.3.3</version>
|
||||||
|
|
||||||
<name>aohe-sane-service</name>
|
<name>aohe-sane-service</name>
|
||||||
|
|
||||||
|
|
|
@ -10,14 +10,17 @@ import org.aohe.core.utils.SystemUtils;
|
||||||
import org.aohe.core.web.SocketFactory;
|
import org.aohe.core.web.SocketFactory;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class Main {
|
public class Main {
|
||||||
|
|
||||||
|
private static final String JAVA_IO_TMPDIR = System.getProperty("java.io.tmpdir");
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
||||||
log.info(" 当前系统类型: {}", SystemUtils.getOsName());
|
log.info(" 当前系统类型: {}", SystemUtils.getOsName());
|
||||||
AppLocker locker = AppLocker.create("aoheSaneServiceLock").build();
|
AppLocker locker = AppLocker.create("aoheSaneServiceLock").setPath( Path.of(JAVA_IO_TMPDIR) ).build();
|
||||||
try {
|
try {
|
||||||
//启动锁,只允许启动一个
|
//启动锁,只允许启动一个
|
||||||
locker.lock();
|
locker.lock();
|
||||||
|
@ -28,7 +31,7 @@ public class Main {
|
||||||
} catch (UnsupportedLookAndFeelException e) {
|
} catch (UnsupportedLookAndFeelException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
log.info("应用已经启动,当前进程退出。");
|
log.error("应用已经启动,当前进程退出。",ex);
|
||||||
|
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue