if (demo == null) demo = false;
Map infoMap = new HashMap();
List stackList = new ArrayList();
CallFlowMonitor cfm = getCallFlowMonitor(instanceName);
if (!demo && (cfm == null || requestId==null)){
handlerCtx.setOutputValue("detailInfo", infoMap);
handlerCtx.setOutputValue("callFlowStackMap", stackList);
handlerCtx.setOutputValue("hasCallFlowChart", false);
return;
}
try {
List listOfMap = null;
/*
System.out.println("List returned by queryCallStackForRequest()");
System.out.println(listOfMap);
for(int i=0; i<listOfMap.size(); i++){
System.out.println(" Map # " + i);
System.out.println(listOfMap.get(i));
}
*/
if (demo != null && demo){
listOfMap = getDemoCallFlowStack(requestId);
}else{
listOfMap = cfm.queryCallStackForRequest (requestId);
}
infoMap.put("user", handlerCtx.getInputValue("user"));
infoMap.put("responseTime", handlerCtx.getInputValue("responseTime"));
Map oneRow = getRow( CallFlowMonitor.CALL_STACK_REQUEST_START, listOfMap);
if(oneRow == null) return; //shouldn't happen
String ms =(String) oneRow.get(CallFlowMonitor.TIME_STAMP_MILLIS_KEY);
DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM, GuiUtil.getLocale());
Date date = new Date (Long.parseLong(ms));
String formattedTime = dateFormat.format(date);
infoMap.put("timeStamp", formattedTime);
infoMap.put("startContainer", oneRow.get(CallFlowMonitor.REQUEST_TYPE_KEY));
//extract info from METHOD_START
oneRow = getRow( CallFlowMonitor.CALL_STACK_METHOD_START, listOfMap);
if (oneRow == null) return; //shouldn't happen
infoMap.put("application", oneRow.get(CallFlowMonitor.APPLICATION_NAME_KEY));
//handlerCtx.setOutputValue("user", oneRow.get(CallFlowMonitor.USER_KEY));
oneRow = getLastRow( CallFlowMonitor.CALL_STACK_METHOD_END, listOfMap);
if(oneRow == null) return;
String except = (String) oneRow.get(CallFlowMonitor.EXCEPTION_KEY);
infoMap.put("exception", except);
if (GuiUtil.isEmpty(except)){
infoMap.put("response", GuiUtil.getMessage("common.Success") );
infoMap.put("hasException", false );
}else{
infoMap.put("response", GuiUtil.getMessage("common.Failed"));
infoMap.put("hasException", true );
}
Map timeSpendMap = null;
if (demo != null && demo ){
timeSpendMap = getDemoTimeSpendMap(requestId);
}else{
timeSpendMap = (Map<String,String>) cfm.queryPieInformation(requestId);
}
//By default, charting info will be generated.
Boolean doCharting = (Boolean )handlerCtx.getInputValue("doCharting");
boolean hasChartData = getTimeSpendInfo(infoMap, timeSpendMap, doCharting);