Merge remote-tracking branch 'origin/dev_rc_jdk13_2.0.0' into dev_rc_jdk13_2.0.0

This commit is contained in:
jiangbuyun 2022-06-10 21:56:30 +08:00
commit ab9255130d
4 changed files with 6 additions and 6 deletions

View File

@ -51,7 +51,7 @@ class RepChainConfig {
val networkId = this.getChainNetworkId
val isUseGM = this.isUseGM
val prefix = if(isUseGM) "pfx" else "jks"
val base_path = prefix + File.separator + networkId + File.separator
val base_path = prefix + "/" + networkId + "/"
val key_store = base_path + this.systemName + "."+ prefix
val trust_store = base_path + "mytruststore"+"." + prefix
var myConfig =

View File

@ -25,7 +25,7 @@ class RepChainSystemContext(systemName:String) {
private val blockStorager : BlockStorager = new BlockStorager(this)
private val blockPreloads : ConcurrentHashMap[String,BlockPreload] = new ConcurrentHashMap[String,BlockPreload]()
private val systemCertList : SystemCertList = new SystemCertList(this)
private val httpLogger = new HttpLogger(config.getOuputAlertThreads,config.getOutputMaxThreads,config.getOutputAlertAliveTime,
private val httpLogger = new HttpLogger(config.getChainNetworkId, config.getOuputAlertThreads,config.getOutputMaxThreads,config.getOutputAlertAliveTime,
config.isOutputAlert,config.getOutputAlertPrismaUrl)
private val transactionBuilder:TransactionBuilder = new TransactionBuilder(this.signTool)
private val permissionCacheManager:PermissionCacheManager = PermissionCacheManager.getCacheInstance(this)

View File

@ -9,7 +9,7 @@ import java.util.concurrent.{ LinkedBlockingQueue, ThreadPoolExecutor, TimeUnit}
* @since 2021-07-09
* @category http日志器采用线程池写入prisma
* */
class HttpLogger(coreSize: Int, maxSize: Int, aliveTime: Int, isOutputAlert: Boolean, url: String) {
class HttpLogger(netWorkId: String, coreSize: Int, maxSize: Int, aliveTime: Int, isOutputAlert: Boolean, url: String) {
private var threadpool: ThreadPoolExecutor = null
@ -29,7 +29,7 @@ class HttpLogger(coreSize: Int, maxSize: Int, aliveTime: Int, isOutputAlert: Boo
def SendAlert(info: AlertInfo): Unit = {
if (this.isOutputAlert) {
val task = new HttpThread(url, info)
val task = new HttpThread(url, netWorkId, info)
this.threadpool.execute(task)
}
}

View File

@ -44,7 +44,7 @@ Cleared 清除
*/
case class AlertInfo(category: String, level: Int, desc: String)
class HttpThread(url: String, info: AlertInfo) extends Runnable {
class HttpThread(url: String, netWorkId: String, info: AlertInfo) extends Runnable {
private val paramOfJSon = this.ConvertAlertInfoToJSon(info)
override def run(): Unit = {
@ -108,7 +108,7 @@ class HttpThread(url: String, info: AlertInfo) extends Runnable {
.append("CATEGORY: ").append(info.category).append(",")
.append("LEVEL: ").append(info.level).append(",")
.append("ALERT_DESC: \\\"").append(info.desc).append("\\\",")
.append("BLOCKCHAIN: { connect: {id: \\\"identity-net\\\"}}").append(",")
.append("BLOCKCHAIN: { connect: {id: \\\"" + netWorkId + "\\\"}}").append(",")
.append("ALERT_TIME: \\\"").append(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'+08:00'").format(new Date())).append("\\\"")
.append("})")
.append("{\\n id\\n }\\n}\\n\"}")