mirror of
https://gitee.com/BDWare/cm
synced 2025-01-10 01:44:04 +00:00
optimize build.gradle
This commit is contained in:
parent
c3f1407b6f
commit
7d04d48f50
@ -1,5 +1,6 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'java-library'
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
@ -28,7 +29,9 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation project(":common")
|
||||
|
||||
api project(":common")
|
||||
api 'io.prometheus:simpleclient:0.12.0'
|
||||
api 'org.knowhowlab.osgi:sigar:1.6.5_01'
|
||||
api fileTree(dir: 'libs', include: '*.jar')
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ package org.bdware.sc;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonPrimitive;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.bdware.sc.ContractResult.Status;
|
||||
@ -267,7 +266,7 @@ public class ContractClient {
|
||||
(isDebug ? "-debug" : ""));
|
||||
File directory = new File("");
|
||||
LOGGER.debug("[CMD] path: " + directory.getAbsolutePath());
|
||||
LOGGER.debug(StringUtils.join(builder.command(), " "));
|
||||
LOGGER.debug(JsonUtil.toPrettyJson(builder.command()));
|
||||
|
||||
Map<String, String> map = builder.environment();
|
||||
map.put("java.library.path", jniPath.getAbsolutePath() + osJni);
|
||||
|
@ -1,6 +1,5 @@
|
||||
package org.bdware.sc;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.bdware.sc.ContractPort.PortVisitor;
|
||||
@ -113,11 +112,15 @@ public class ContractStatusRecorder extends StatusRecorder<ContractMeta> {
|
||||
|
||||
public void reSyncStatusAtStart() {
|
||||
List<String> toPrint = new ArrayList<>();
|
||||
Set<ContractMeta> toRemove = new HashSet<>();
|
||||
for (ContractMeta meta : getStatus().values()) {
|
||||
toPrint.add(meta.status + " " + meta.id + " " + meta.name + " ");
|
||||
if (meta.contract == null)
|
||||
toRemove.add(meta);
|
||||
}
|
||||
LOGGER.debug(JsonUtil.toPrettyJson(toPrint));
|
||||
|
||||
for (ContractMeta meta : toRemove)
|
||||
remove(meta);
|
||||
for (String id : id2ContractClient.keySet()) {
|
||||
ContractMeta meta = getStatus().get(id);
|
||||
if (null == meta) {
|
||||
@ -251,7 +254,7 @@ public class ContractStatusRecorder extends StatusRecorder<ContractMeta> {
|
||||
}
|
||||
|
||||
public ContractClient getContractClient(String idOrName) {
|
||||
if (StringUtils.isBlank(idOrName)) {
|
||||
if (idOrName == null || idOrName.length() == 0) {
|
||||
return null;
|
||||
}
|
||||
// TODO ensure load contract client
|
||||
|
14
src/main/java/org/bdware/sc/DoipServiceInfoConfigurer.java
Normal file
14
src/main/java/org/bdware/sc/DoipServiceInfoConfigurer.java
Normal file
@ -0,0 +1,14 @@
|
||||
package org.bdware.sc;
|
||||
|
||||
import org.bdware.doip.application.DoipServiceConfig;
|
||||
import org.bdware.doip.endpoint.doipServer.DoipServiceInfo;
|
||||
|
||||
public interface DoipServiceInfoConfigurer {
|
||||
String getServiceHandle();
|
||||
|
||||
String resetServiceConfig(String configJson);
|
||||
|
||||
DoipServiceConfig getDoipServiceConfig();
|
||||
|
||||
DoipServiceInfo getDoipServiceInfo();
|
||||
}
|
@ -154,7 +154,16 @@ public class MultiContractMeta implements IDSerializable {
|
||||
public String[] getMembers() {
|
||||
return members;
|
||||
}
|
||||
|
||||
public String joinMembers(String delimiter){
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (members.length > 0)
|
||||
sb.append(members[0]);
|
||||
else return "";
|
||||
for (int i = 1; i < members.length; i++) {
|
||||
sb.append(delimiter).append(members[i]);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
public void setMembers(String[] m) {
|
||||
members = m;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user