org.jboss.profiler.model.JBPProcess spyProcess = beanFilter
.getJbpProcess();
Integer threadId = null;
JBPThread thread = null;
if (request.getParameter("threadId") != null) {
JBPThread threadKey = new JBPThread();
threadId = new Integer(request.getParameter("threadId"));
threadKey.setThreadId(threadId.intValue());
thread = (JBPThread) spyProcess.getSpyThreads().get(threadKey);
}
HashMap spyMethods = spyProcess.getSpyMethods();
JBPMethod spyMethodProcess = (JBPMethod) spyMethods.get(keyMethod);
JBPMethodCount consolidacao = (JBPMethodCount) request.getSession()
.getAttribute("consolidacaoMetodo");
if (thread == null
&& (consolidacao == null
|| consolidacao.getSpyMethod().equals(
spyMethodProcess) || session
.getAttribute("consolidacaoThread") != null)) {
consolidacao = spyProcess.consolidaCallings(spyMethodProcess);
session.setAttribute("consolidacaoMetodo", consolidacao);
session.removeAttribute("consolidacaoThread");
} else {
JBPThread consolidacaoThread = (JBPThread) session
.getAttribute("consolidacaoThread");
if (thread != null
&& (consolidacao == null
|| consolidacaoThread == null
|| consolidacaoThread.getThreadId() != threadId
.intValue() || !consolidacao
.getSpyMethod().equals(spyMethodProcess))) {
consolidacao = thread.consolidaCallings(spyMethodProcess);
session.setAttribute("consolidacaoMetodo", consolidacao);
session.setAttribute("consolidacaoThread", thread);