diff --git a/.gitignore b/.gitignore index 0b05395d9..683fda389 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,7 @@ hs_err_pid* /.idea/ *.iml **/rebel.xml +.gitmodules # Bin /target/ diff --git a/@rbv b/@rbv new file mode 160000 index 000000000..cd5bd540b --- /dev/null +++ b/@rbv @@ -0,0 +1 @@ +Subproject commit cd5bd540b8170a446c5961f6d7cb78115ec0ffbd diff --git a/pom.xml b/pom.xml index 9b40e2ac4..29817f3d4 100644 --- a/pom.xml +++ b/pom.xml @@ -62,6 +62,54 @@ .deploy + + org.codehaus.mojo diff --git a/src/main/java/com/rebuild/core/Application.java b/src/main/java/com/rebuild/core/Application.java index 42d2e2c90..2a545f043 100644 --- a/src/main/java/com/rebuild/core/Application.java +++ b/src/main/java/com/rebuild/core/Application.java @@ -8,6 +8,7 @@ See LICENSE and COMMERCIAL in the project root for license information. package com.rebuild.core; import cn.devezhao.commons.ObjectUtils; +import cn.devezhao.commons.ReflectUtils; import cn.devezhao.commons.excel.Cell; import cn.devezhao.persist4j.PersistManagerFactory; import cn.devezhao.persist4j.Query; @@ -92,7 +93,9 @@ public class Application implements ApplicationListener // 服务启动状态 private static boolean _READY; // 等待系统组件装载 - private static boolean _WAIT_LOADS = true; + private static boolean _WAITLOADS = true; + // 增值模块 + private static boolean _RBV; // SPRING private static ApplicationContext _CONTEXT; @@ -148,7 +151,7 @@ public class Application implements ApplicationListener } } - _WAIT_LOADS = false; + _WAITLOADS = false; } } @@ -167,6 +170,13 @@ public class Application implements ApplicationListener return false; } + try { + Object RBV = ReflectUtils.classForName("com.rebuild.Rbv").newInstance(); + LOG.info("Loaded " + RBV); + _RBV = true; + } catch (Exception ignore) { + } + // 升级数据库 new UpgradeDatabase().upgradeQuietly(); @@ -215,6 +225,14 @@ public class Application implements ApplicationListener return BootApplication.devMode(); } + /** + * RBV 可用 + * @return + */ + public static boolean rbvLoaded() { + return License.getCommercialType() > 0 && _RBV; + } + /** * 已启动(不含组件装载) * @return @@ -228,7 +246,7 @@ public class Application implements ApplicationListener * @return */ public static boolean isWaitLoads() { - return _WAIT_LOADS && _CONTEXT != null; + return _WAITLOADS && _CONTEXT != null; } public static ApplicationContext getContext() {