소스 검색

重载一个设置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) {