Search in sources :

Example 1 with CallInspector

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

the class CallsView method renderCallTable.

private void renderCallTable(HtmlComponent p, SessionInspector session) {
    TreeMap<CompositeObject, CallInspector> timeToCalls = new TreeMap<CompositeObject, CallInspector>();
    CallInspector[] callInspectors = session.getCallInspectors();
    for (int i = 0; i < callInspectors.length; i++) {
        long startTime = callInspectors[i].getInfo().getStartTime();
        timeToCalls.put(new CompositeObject(startTime, i), callInspectors[i]);
    }
    CallInspector[] sorted = timeToCalls.values().toArray(new CallInspector[timeToCalls.size()]);
    p.bold("Calls");
    p.startTable(1, 0, 3);
    p.startTableRow();
    p.tableHeaderCell("#");
    p.tableHeaderCell("Operation");
    p.tableHeaderCell("Started");
    p.tableHeaderCell("Duration");
    p.tableHeaderCell("Status");
    p.endTableRow();
    CallInspector validSelection = null;
    for (int i = sorted.length - 1; i >= 0; i--) {
        if (sorted[i] == m_selectedCall) {
            validSelection = m_selectedCall;
        }
        renderCallRow(p, i + 1, sorted[i]);
    }
    m_selectedCall = validSelection;
    p.endTable();
}
Also used : CompositeObject(org.eclipse.scout.rt.platform.util.CompositeObject) CallInspector(org.eclipse.scout.rt.server.admin.inspector.CallInspector) TreeMap(java.util.TreeMap)

Example 2 with CallInspector

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

the class ServiceOperationInvoker method invokeInternal.

protected ServiceTunnelResponse invokeInternal(ServiceTunnelRequest serviceReq) throws ClassNotFoundException {
    IServerSession serverSession = ServerSessionProvider.currentSession();
    if (LOG.isDebugEnabled()) {
        String userId = serverSession != null ? serverSession.getUserId() : "";
        LOG.debug("started {}.{} by {} at {}", serviceReq.getServiceInterfaceClassName(), serviceReq.getOperation(), userId, new Date());
    }
    CallInspector callInspector = getCallInspector(serviceReq, serverSession);
    ServiceTunnelResponse serviceRes = null;
    try {
        ServiceUtility serviceUtility = BEANS.get(ServiceUtility.class);
        Class<?> serviceInterfaceClass = SerializationUtility.getClassLoader().loadClass(serviceReq.getServiceInterfaceClassName());
        Method serviceOp = serviceUtility.getServiceOperation(serviceInterfaceClass, serviceReq.getOperation(), serviceReq.getParameterTypes());
        Object[] args = serviceReq.getArgs();
        Object service = getValidatedServiceAccess(serviceInterfaceClass, serviceOp, args);
        Object data = serviceUtility.invoke(service, serviceOp, args);
        Object[] outParameters = serviceUtility.extractHolderArguments(args);
        serviceRes = new ServiceTunnelResponse(data, outParameters);
        return serviceRes;
    } finally {
        updateInspector(callInspector, serviceRes);
    }
}
Also used : CallInspector(org.eclipse.scout.rt.server.admin.inspector.CallInspector) Method(java.lang.reflect.Method) ServiceUtility(org.eclipse.scout.rt.shared.servicetunnel.ServiceUtility) Date(java.util.Date) ServiceTunnelResponse(org.eclipse.scout.rt.shared.servicetunnel.ServiceTunnelResponse)

Aggregations

CallInspector (org.eclipse.scout.rt.server.admin.inspector.CallInspector)2 Method (java.lang.reflect.Method)1 Date (java.util.Date)1 TreeMap (java.util.TreeMap)1 CompositeObject (org.eclipse.scout.rt.platform.util.CompositeObject)1 ServiceTunnelResponse (org.eclipse.scout.rt.shared.servicetunnel.ServiceTunnelResponse)1 ServiceUtility (org.eclipse.scout.rt.shared.servicetunnel.ServiceUtility)1