Search in sources :

Example 1 with CallInfo

use of org.eclipse.scout.rt.server.admin.inspector.info.CallInfo in project scout.rt by eclipse.

the class CallsView method renderCallDetail.

private void renderCallDetail(HtmlComponent p, CallInspector call) {
    SimpleDateFormat startFmt = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
    CallInfo info = call.getInfo();
    // 
    p.startTable(0);
    // 
    p.startTableRow();
    p.tableCell("Service");
    p.tableCell(info.getService());
    p.endTableRow();
    // 
    p.spacingRow(2);
    // 
    p.startTableRow();
    p.tableCell("Operation");
    p.tableCell(info.getOperation());
    p.endTableRow();
    // 
    p.spacingRow(2);
    // 
    p.startTableRow();
    p.tableCell("Start");
    p.tableCell(startFmt.format(new Date(info.getStartTime())));
    p.endTableRow();
    // 
    p.spacingRow(2);
    // 
    p.startTableRow();
    p.tableCell("End");
    if (info.isActive()) {
        p.tableCell("PENDING");
    } else {
        p.tableCell(startFmt.format(new Date(info.getEndTime())));
    }
    p.endTableRow();
    // 
    p.spacingRow(2);
    // 
    p.startTableRow();
    p.tableCell("Duration");
    p.tableCell(info.getDuration() + " ms");
    p.endTableRow();
    // 
    p.spacingRow(2);
    // 
    p.startTableRow();
    p.tableCell("XA resources");
    p.startTableCell();
    ITransactionMember[] xaresources = info.getXaResources();
    renderValueTable(p, xaresources);
    p.endTableCell();
    p.endTableRow();
    // 
    if (!info.isActive()) {
        // 
        p.spacingRow(2);
        // 
        p.startTableRow();
        p.tableCell("Arguments");
        p.startTableCell();
        renderValueTable(p, info.getArguments());
        p.endTableCell();
        p.endTableRow();
        if (info.getReturnException() == null) {
            // 
            p.spacingRow(2);
            // 
            p.startTableRow();
            p.tableCell("Out variables");
            p.startTableCell();
            renderValueTable(p, info.getOutVariables());
            p.endTableCell();
            p.endTableRow();
            // 
            p.spacingRow(2);
            // 
            p.startTableRow();
            p.tableCell("Return data");
            p.startTableCell();
            renderValueTable(p, new Object[] { info.getReturnData() });
            p.endTableCell();
            p.endTableRow();
        } else {
            StringWriter sw = new StringWriter();
            info.getReturnException().printStackTrace(new PrintWriter(sw, true));
            // 
            p.spacingRow(2);
            // 
            p.startTableRow();
            p.tableCell("Return exception");
            p.tableCell(sw.toString());
            p.endTableRow();
        }
    }
    p.endTable();
}
Also used : StringWriter(java.io.StringWriter) CallInfo(org.eclipse.scout.rt.server.admin.inspector.info.CallInfo) ITransactionMember(org.eclipse.scout.rt.platform.transaction.ITransactionMember) SimpleDateFormat(java.text.SimpleDateFormat) Date(java.util.Date) PrintWriter(java.io.PrintWriter)

Example 2 with CallInfo

use of org.eclipse.scout.rt.server.admin.inspector.info.CallInfo in project scout.rt by eclipse.

the class CallsView method renderCallRow.

private void renderCallRow(HtmlComponent p, int index, final CallInspector call) {
    boolean selected = m_selectedCall != null && (m_selectedCall == call);
    SimpleDateFormat startFmt = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
    String serviceShortName = call.getInfo().getService();
    int i = Math.max(serviceShortName.lastIndexOf('.'), serviceShortName.lastIndexOf('$'));
    if (i >= 0) {
        serviceShortName = serviceShortName.substring(i + 1);
    }
    CallInfo info = call.getInfo();
    // 
    p.startTableRow();
    p.tableCell("" + index);
    p.startTableCell();
    String callId = serviceShortName + "." + info.getOperation();
    String callKey = serviceShortName + "." + info.getOperation() + "." + info.getStartTime();
    if (selected) {
        p.focusAnchor();
    }
    p.startLinkAction(new AbstractHtmlAction("selectCall." + callKey) {

        @Override
        public void run() {
            m_selectedCall = call;
        }
    });
    if (selected) {
        p.bold(callId);
    } else {
        p.print(callId);
    }
    p.endLinkAction();
    p.endTableCell();
    p.startTableCell();
    p.printNoBreak(startFmt.format(new Date(info.getStartTime())));
    p.endTableCell();
    p.startTableCell();
    p.printNoBreak("" + info.getDuration() + " ms");
    p.endTableCell();
    p.startTableCell();
    if (info.isActive()) {
        p.printNoBreak("RUNNING");
    } else {
        if (info.getReturnException() == null) {
            p.raw("<font color='008800'>");
            p.printNoBreak("COMPLETED OK");
            p.raw("</font>");
        } else {
            p.raw("<font color='880000'>");
            p.printNoBreak("COMPLETED WITH ERROR");
            p.raw("</font>");
        }
    }
    p.endTableCell();
    p.endTableRow();
}
Also used : AbstractHtmlAction(org.eclipse.scout.rt.server.admin.html.AbstractHtmlAction) CallInfo(org.eclipse.scout.rt.server.admin.inspector.info.CallInfo) SimpleDateFormat(java.text.SimpleDateFormat) Date(java.util.Date)

Aggregations

SimpleDateFormat (java.text.SimpleDateFormat)2 Date (java.util.Date)2 CallInfo (org.eclipse.scout.rt.server.admin.inspector.info.CallInfo)2 PrintWriter (java.io.PrintWriter)1 StringWriter (java.io.StringWriter)1 ITransactionMember (org.eclipse.scout.rt.platform.transaction.ITransactionMember)1 AbstractHtmlAction (org.eclipse.scout.rt.server.admin.html.AbstractHtmlAction)1