Commit 78f3d1cd authored by yanzg's avatar yanzg

将源码打包进jar包

parent 35ebe843
......@@ -2,11 +2,9 @@ package com.yanzuoguang.redis.level;
import com.yanzuoguang.redis.PlanLevelNamespaceDefault;
import com.yanzuoguang.redis.vo.PlanLevelType;
import com.yanzuoguang.util.helper.StringHelper;
import org.springframework.stereotype.Component;
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
/**
* 程序级别
*
......@@ -14,10 +12,21 @@ import java.lang.management.RuntimeMXBean;
*/
@Component
public class PlanLevelNamespaceProgram implements PlanLevelNamespaceDefault {
private final PlanLevelNamespaceServerIp planLevelNamespaceServerIp;
private final PlanLevelNamespaceApplication planLevelNamespaceApplication;
public PlanLevelNamespaceProgram(PlanLevelNamespaceServerIp planLevelNamespaceServerIp, PlanLevelNamespaceApplication planLevelNamespaceApplication) {
this.planLevelNamespaceServerIp = planLevelNamespaceServerIp;
this.planLevelNamespaceApplication = planLevelNamespaceApplication;
}
@Override
public String getLevelNamespace() {
RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean();
return runtimeMxBean.getName();
return StringHelper.getId(
planLevelNamespaceServerIp.getLevelNamespace(),
planLevelNamespaceApplication.getLevelNamespace()
);
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment