diff --git a/org.ntlab.traceCollector/src/org/ntlab/traceCollector/tracer/OnlineTraceOutput.java b/org.ntlab.traceCollector/src/org/ntlab/traceCollector/tracer/OnlineTraceOutput.java index ddc90a2..41ce0bc 100644 --- a/org.ntlab.traceCollector/src/org/ntlab/traceCollector/tracer/OnlineTraceOutput.java +++ b/org.ntlab.traceCollector/src/org/ntlab/traceCollector/tracer/OnlineTraceOutput.java @@ -1,6 +1,7 @@ package org.ntlab.traceCollector.tracer; import java.util.ArrayList; +import java.util.HashMap; import java.util.Stack; import org.ntlab.traceCollector.tracer.trace.ObjectReference; @@ -9,10 +10,11 @@ public class OnlineTraceOutput { private static ThreadInstance thread = null; + private static HashMap> stacks = new HashMap>(); public static synchronized void onlineTraceClassDefinition(String className, String classPath, String loaderPath) { // classPath��loaderPath�ɂ‚��Ă͐擪�� / ����菜���ċL�^���� - TraceJSON.initializeClass(className, classPath.substring(1), loaderPath.substring(1)); + TraceJSON.getInstance().initializeClass(className, classPath.substring(1), loaderPath.substring(1)); } public static synchronized void onlineTracePreCallMethod(String signature, String threadId, String lineNum) { @@ -30,11 +32,11 @@ Stack stack; if (thread == null) { thread = new ThreadInstance(threadId); - TraceJSON.getThreads().put(threadId, thread); + TraceJSON.getInstance().getAllThreads().put(threadId, thread); stack = new Stack(); - TraceJSON.getStacks().put(threadId, stack); + stacks.put(threadId, stack); } else { - stack = TraceJSON.getStacks().get(threadId); + stack = stacks.get(threadId); } stack.push(signature); // ���\�b�h�Ăяo���̐ݒ� @@ -56,11 +58,11 @@ Stack stack; if (thread == null) { thread = new ThreadInstance(threadId); - TraceJSON.getThreads().put(threadId, thread); + TraceJSON.getInstance().getAllThreads().put(threadId, thread); stack = new Stack(); - TraceJSON.getStacks().put(threadId, stack); + stacks.put(threadId, stack); } else { - stack = TraceJSON.getStacks().get(threadId); + stack = stacks.get(threadId); } stack.push(signature); // ���\�b�h�Ăяo���̐ݒ� @@ -76,7 +78,7 @@ public static synchronized void onlineTraceMethodExit(String shortSignature, String thisClassName, String thisObjectId, String returnClassName, String returnObjectId, String threadId, long timeStamp) { - Stack stack = TraceJSON.getStacks().get(threadId); + Stack stack = stacks.get(threadId); if (!stack.isEmpty()) { String line2 = stack.peek(); if (line2.endsWith(shortSignature)) { @@ -110,7 +112,7 @@ String threadId, long timeStamp) { String thisClassName = returnClassName; String thisObjectId = returnObjectId; - Stack stack = TraceJSON.getStacks().get(threadId); + Stack stack = stacks.get(threadId); if (!stack.isEmpty()) { String line2 = stack.peek(); if (line2.endsWith(shortSignature)) {