Browse Source

REPORT-28368 死锁问题 常量不需要每次读取

feature/big-screen
hades 5 years ago
parent
commit
fc9c029ec7
  1. 14
      designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java
  2. BIN
      designer-base/src/main/resources/com/fr/design/icon/logo.png
  3. 4
      designer-realize/src/main/java/com/fr/start/Designer.java
  4. 26
      designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java

14
designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java

@ -83,6 +83,20 @@ public enum SupportOSImpl implements SupportOS {
public boolean support() {
return OperatingSystem.isMacos();
}
},
NON_GUARDIAN_START {
@Override
public boolean support() {
return OperatingSystem.isLinux() || Arch.getArch() == Arch.ARM;
}
},
DOCK_ICON {
@Override
public boolean support() {
return OperatingSystem.isMacos();
}
}
}

BIN
designer-base/src/main/resources/com/fr/design/icon/logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

4
designer-realize/src/main/java/com/fr/start/Designer.java

@ -1,5 +1,6 @@
package com.fr.start;
import com.fr.design.os.impl.SupportOSImpl;
import com.fr.log.FineLoggerFactory;
/**
@ -14,7 +15,8 @@ public class Designer {
public static void main(String[] args) {
try {
if (DesignerJavaRuntime.getInstance().isInValidVmOptions()) {
if (DesignerJavaRuntime.getInstance().isInValidVmOptions()
|| SupportOSImpl.NON_GUARDIAN_START.support()) {
runNonGuardianDesigner(args);
} else {
// 创建进程

26
designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java

@ -1,12 +1,18 @@
package com.fr.start;
import com.fr.design.os.impl.SupportOSImpl;
import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils;
import com.fr.process.engine.core.AbstractJavaRuntime;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.os.OperatingSystem;
import java.util.Set;
import javax.imageio.ImageIO;
import java.io.File;
import java.io.IOException;
/**
* 设计器Java运行环境
@ -23,8 +29,20 @@ public class DesignerJavaRuntime extends AbstractJavaRuntime {
private static final String JAVA_EXEC = "java";
private static final String WIN_JRE_BIN = StableUtils.pathJoin("jre", "bin");
private static final String MAC_JRE_BIN = StableUtils.pathJoin("jre.bundle", "Contents", "Home", "jre", "bin");
private static final String BIN_HOME = StableUtils.pathJoin(StableUtils.getInstallHome(), "bin");
private static final String LOGO_PATH = StableUtils.pathJoin(BIN_HOME, "logo.png");
private static final String DOCK_OPTIONS = "-Xdock:icon=" + StableUtils.pathJoin(StableUtils.getInstallHome(), "bin", "logo.png");
private static final String[] DEBUG_OPTIONS = new String[]{"-Dfile.encoding=UTF-8", "-Xmx2048m"};
static {
if (SupportOSImpl.DOCK_ICON.support()) {
try {
ImageIO.write(IOUtils.readImage("com/fr/design/icon/logo.png"), "png", new File(LOGO_PATH));
} catch (IOException ignore) {
}
}
}
private static final DesignerJavaRuntime INSTANCE = new DesignerJavaRuntime();
public static DesignerJavaRuntime getInstance() {
@ -79,7 +97,11 @@ public class DesignerJavaRuntime extends AbstractJavaRuntime {
@Override
public String[] getJvmOptions() {
if (isInstallVersion()) {
return super.getJvmOptions();
String[] options = super.getJvmOptions();
if (SupportOSImpl.DOCK_ICON.support()) {
options = ArrayUtils.add(options, DOCK_OPTIONS);
}
return options;
} else {
return DEBUG_OPTIONS;
}

Loading…
Cancel
Save