mirror of
https://github.com/getrebuild/rebuild.git
synced 2024-11-10 08:55:31 +08:00
@rbv
This commit is contained in:
parent
f55a5263a2
commit
e5229cf331
4 changed files with 71 additions and 3 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -28,6 +28,7 @@ hs_err_pid*
|
|||
/.idea/
|
||||
*.iml
|
||||
**/rebel.xml
|
||||
.gitmodules
|
||||
|
||||
# Bin
|
||||
/target/
|
||||
|
|
1
@rbv
Submodule
1
@rbv
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit cd5bd540b8170a446c5961f6d7cb78115ec0ffbd
|
48
pom.xml
48
pom.xml
|
@ -62,6 +62,54 @@
|
|||
<workingDirectory>.deploy</workingDirectory>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- USE RB COMMERCIAL MODULES -->
|
||||
<!--
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>rbv-source</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>add-source</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>${basedir}/@rbv/main/java</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>rbv-resource</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>add-resource</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${basedir}/@rbv/main/resources</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>rbv-test-source</id>
|
||||
<phase>generate-test-sources</phase>
|
||||
<goals>
|
||||
<goal>add-test-source</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>${basedir}/@rbv/test/java</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
-->
|
||||
<!-- Codecov : `mvn cobertura:cobertura -DskipTests=false -Drbpass=PASSKEY` & `bash <(curl -s https://codecov.io/bash) -t TOKEN` -->
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
|
|
|
@ -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<ApplicationStartedEvent>
|
|||
// 服务启动状态
|
||||
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<ApplicationStartedEvent>
|
|||
}
|
||||
}
|
||||
|
||||
_WAIT_LOADS = false;
|
||||
_WAITLOADS = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -167,6 +170,13 @@ public class Application implements ApplicationListener<ApplicationStartedEvent>
|
|||
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<ApplicationStartedEvent>
|
|||
return BootApplication.devMode();
|
||||
}
|
||||
|
||||
/**
|
||||
* RBV 可用
|
||||
* @return
|
||||
*/
|
||||
public static boolean rbvLoaded() {
|
||||
return License.getCommercialType() > 0 && _RBV;
|
||||
}
|
||||
|
||||
/**
|
||||
* 已启动(不含组件装载)
|
||||
* @return
|
||||
|
@ -228,7 +246,7 @@ public class Application implements ApplicationListener<ApplicationStartedEvent>
|
|||
* @return
|
||||
*/
|
||||
public static boolean isWaitLoads() {
|
||||
return _WAIT_LOADS && _CONTEXT != null;
|
||||
return _WAITLOADS && _CONTEXT != null;
|
||||
}
|
||||
|
||||
public static ApplicationContext getContext() {
|
||||
|
|
Loading…
Reference in a new issue