1. 0.3.2 启动锁
This commit is contained in:
parent
8f0175641f
commit
bd95bbb11b
8
pom.xml
8
pom.xml
|
@ -6,7 +6,7 @@
|
|||
|
||||
<groupId>org.aohe</groupId>
|
||||
<artifactId>sane-service</artifactId>
|
||||
<version>0.3.1</version>
|
||||
<version>0.3.2</version>
|
||||
|
||||
<name>aohe-sane-service</name>
|
||||
|
||||
|
@ -71,6 +71,12 @@
|
|||
<version>3.4.1</version>
|
||||
<classifier>no-natives</classifier>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.github.sanyarnd</groupId>
|
||||
<artifactId>app-locker</artifactId>
|
||||
<version>1.2.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.formdev</groupId>-->
|
||||
<!-- <artifactId>flatlaf</artifactId>-->
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.aohe;
|
||||
|
||||
import com.formdev.flatlaf.FlatDarculaLaf;
|
||||
import io.github.sanyarnd.applocker.AppLocker;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aohe.core.sane.utils.SaneSessionUtils;
|
||||
import org.aohe.core.swing.NewWindow;
|
||||
|
@ -14,13 +15,21 @@ import javax.swing.*;
|
|||
public class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
log.info(" 当前系统类型: {}", SystemUtils.getOsName());
|
||||
try {
|
||||
try (AppLocker locker = AppLocker.create("aoheSaneServiceLock").build()){
|
||||
//启动锁,只允许启动一个
|
||||
locker.lock();
|
||||
|
||||
//设置窗口主题
|
||||
//FlatLightLaf.setup();
|
||||
UIManager.setLookAndFeel(new FlatDarculaLaf());
|
||||
} catch (UnsupportedLookAndFeelException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (Exception ex) {
|
||||
log.info("应用已经启动,当前进程退出。");
|
||||
|
||||
System.exit(0);
|
||||
}
|
||||
//初始化其他资源
|
||||
init();
|
||||
|
|
Loading…
Reference in New Issue