浏览代码

重载一个设置poemsContext上下文的方法

lixing 2 年之前
父节点
当前提交
cdbd10b551
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      apm-common/src/main/java/com/persagy/apm/common/context/poems/PoemsContext.java

+ 7 - 0
apm-common/src/main/java/com/persagy/apm/common/context/poems/PoemsContext.java

@@ -26,6 +26,13 @@ public class PoemsContext {
         poemsContextContent.setProjectId(projectId);
     }
 
+    public static void setContext(PoemsContextContent poemsContextContent) {
+        if (poemsContextContent == null) {
+            poemsContextContent = new PoemsContextContent();
+        }
+        context.set(poemsContextContent);
+    }
+
     public static PoemsContextContent getContext() {
         PoemsContextContent poemsContextContent = context.get();
         if (poemsContextContent == null) {