Examples of Calls


Examples of org.directwebremoting.extend.Calls

        String callback = getCallback(request);
        PrintWriter out = response.getWriter();

        try
        {
            Calls calls = convertToCalls(request);
            Replies replies = remoter.execute(calls);

            // There will only be one of these while JSON mode does not do batching
            for (int i = 0; i < replies.getReplyCount(); i++)
            {
View Full Code Here

Examples of org.directwebremoting.extend.Calls

        }

        Call call = new Call(null, pathParts[2], pathParts[3]);

        // JSON does not support batching
        Calls calls = new Calls();
        calls.addCall(call);

        // Which method are we using?
        call.findMethod(moduleManager, converterManager, inboundContext, 0);
        MethodDeclaration method = call.getMethodDeclaration();
View Full Code Here

Examples of org.directwebremoting.extend.Calls

            webContext.checkPageInformation(normalizedPage, batch.getScriptSessionId(), batch.getWindowName());

            // Various bits of the CallBatch need to be stashed away places
            storeParsedRequest(request, webContext, batch);

            Calls calls = marshallInbound(batch);

            Replies replies = remoter.execute(calls);
            marshallOutbound(replies, response);
        }
        catch (Exception ex)
View Full Code Here

Examples of org.directwebremoting.extend.Calls

     * @return The function calls to make
     */
    @SuppressWarnings({"ThrowableInstanceNeverThrown"})
    public Calls marshallInbound(CallBatch batch)
    {
        Calls calls = batch.getCalls();

        // Debug the environment
        /*
        if (log.isDebugEnabled() && calls.getCallCount() > 0)
        {
            // We can just use 0 because they are all shared
            InboundContext inctx = batch.getInboundContexts().get(0);
            StringBuffer buffer = new StringBuffer();

            for (Iterator<String> it = inctx.getInboundVariableNames(); it.hasNext();)
            {
                String key = it.next();
                InboundVariable value = inctx.getInboundVariable(key);
                if (key.startsWith(ProtocolConstants.INBOUND_CALLNUM_PREFIX) &&
                    key.contains(ProtocolConstants.INBOUND_CALLNUM_SUFFIX + ProtocolConstants.INBOUND_KEY_ENV))
                {
                    buffer.append(key);
                    buffer.append('=');
                    buffer.append(value.toString());
                    buffer.append(", ");
                }
            }

            if (buffer.length() > 0)
            {
                log.debug("Environment: " + buffer.toString());
            }
        }
        //*/

        callLoop:
        for (int callNum = 0; callNum < calls.getCallCount(); callNum++)
        {
            Call call = calls.getCall(callNum);

            try
            {
                InboundContext inctx = batch.getInboundContexts().get(callNum);

View Full Code Here

Examples of org.directwebremoting.extend.Calls

                FormField formField = new FormField(param);
                fileParams.put(entry.getKey(), formField);
            }

            CallBatch batch = new CallBatch(fileParams, false);
            Calls calls = plainCallHandler.marshallInbound(batch);

            log.debug("Calls="+calls);

            for (int i = 0; i < calls.getCallCount(); i++)
            {
                Call call = calls.getCall(i);
                Object[] params = call.getParameters();
                log.debug("Call[" + i + "]=" + call.getScriptName() + "." + call.getMethodName() + (params == null ? "[]" : Arrays.asList(params)));
            }

            Replies replies = remoter.execute(calls);

            ScriptConduit conduit = new BayeuxScriptConduit(converterManager, JSON_OUTPUT);
            for (Reply reply : replies)
            {
                String batchId = calls.getBatchId();
                log.debug("Reply="+reply+" BatchId="+batchId);

                if (reply.getThrowable() != null)
                {
                    Throwable ex = reply.getThrowable();
                    ScriptBuffer script = EnginePrivate.getRemoteHandleExceptionScript(batchId, reply.getCallId(), ex);
                    conduit.addScript(script);

                    log.warn("--Erroring: batchId[" + batchId + "] message[" + ex.toString() + ']');
                }
                else
                {
                    Object data = reply.getReply();
                    log.debug("data="+data);
                    ScriptBuffer script = EnginePrivate.getRemoteHandleCallbackScript(batchId, reply.getCallId(), data);
                    conduit.addScript(script);
                }
            }

            String output = conduit.toString();
            log.debug("<< "+output);
            Channel channel = bayeux.getChannel("/dwr" + fromClient.getId(), true);
            channel.publish(client, output, calls.getBatchId());
        }
        catch (Exception ex)
        {
            log.warn("Protocol Error", ex);
        }
View Full Code Here

Examples of org.netbeans.server.uihandler.statistics.Actions.Calls

       
        Object attr = pg.getAttribute("globalActions");
        assertNotNull("Value provided", attr);
        assertEquals(true, attr instanceof Calls);
       
        Calls calls = (Calls)attr;
        Map<String,Integer> all = calls.getTopTen(10, null, null, Actions.Invocations.ALL);
       
        assertEquals("three elements:\n" + all, 3, all.size());
        assertEquals("two OpenFile", 2, all.get("org.netbeans.modules.openfile.OpenFileAction").intValue());
        assertEquals("two OpenProject", 2, all.get("org.netbeans.modules.project.ui.actions.OpenProject").intValue());
        assertEquals("one goto type", 1, all.get("org.netbeans.modules.java.actions.GoToTypeAction").intValue());
       
        {
            // order is from most used to less used
            Iterator<String> it;
            it = all.keySet().iterator();
            assertEquals("org.netbeans.modules.openfile.OpenFileAction", it.next());
            assertEquals("org.netbeans.modules.project.ui.actions.OpenProject", it.next());
            assertEquals("org.netbeans.modules.java.actions.GoToTypeAction", it.next());
        }
       
        {
            // check includes
            Map<String,Integer> type = calls.getTopTen(10, ".*GoTo.*", null, Actions.Invocations.ALL);
            assertEquals("just one element:\n" + type, 1, type.size());
            assertEquals("only goto type", 1, type.get("org.netbeans.modules.java.actions.GoToTypeAction").intValue());
        }
       
        {
            // check excludes
            Map<String,Integer> type = calls.getTopTen(10, null, ".*Open.*", Actions.Invocations.ALL);
            assertEquals("just one element:\n" + type, 1, type.size());
            assertEquals("only goto type", 1, type.get("org.netbeans.modules.java.actions.GoToTypeAction").intValue());
        }

        //verify invokations
        Map<String,Integer> menu = calls.getTopTen(10, null, null, Actions.Invocations.MENU);
        assertEquals("three elements:\n" + menu, 3, menu.size());
        assertEquals("two OpenFile", 2, menu.get("org.netbeans.modules.openfile.OpenFileAction").intValue());
        assertEquals("one OpenProject", 1, menu.get("org.netbeans.modules.project.ui.actions.OpenProject").intValue());
        assertEquals("one goto type", 1, menu.get("org.netbeans.modules.java.actions.GoToTypeAction").intValue());

        Map<String,Integer> toolbar = calls.getTopTen(10, null, null, Actions.Invocations.TOOLBAR);
        assertEquals("one element:\n" + toolbar, 1, toolbar.size());
        assertEquals("one OpenProject", 1, toolbar.get("org.netbeans.modules.project.ui.actions.OpenProject").intValue());

        Map<String,Integer> shortCut = calls.getTopTen(10, null, null, Actions.Invocations.SHORTCUT);
        assertEquals("no elements:\n" + shortCut, 0, shortCut.size());
    }
View Full Code Here

Examples of org.netbeans.server.uihandler.statistics.Actions.Calls

       
        Object attr = pg.getAttribute("userActions");
        assertNotNull("Value provided", attr);
        assertEquals(true, attr instanceof Calls);
       
        Calls calls = (Calls)attr;
        Map<String,Integer> all = calls.getTopTen(10, null, null, Actions.Invocations.ALL);

        String dumpAll = all.toString();
        if (dumpAll.indexOf("Delegate") >= 0) {
            fail("Some Delegate:\n" + dumpAll);
        }
View Full Code Here

Examples of org.netbeans.server.uihandler.statistics.Actions.Calls

       
        Object attr = pg.getAttribute("userActions");
        assertNotNull("Value provided", attr);
        assertEquals(true, attr instanceof Calls);
       
        Calls calls = (Calls)attr;
        Map<String,Integer> all = calls.getTopTen(10, null, null, Actions.Invocations.ALL);

        String dumpAll = all.toString();
        if (dumpAll.indexOf("Delegate") >= 0) {
            fail("Some Delegate:\n" + dumpAll);
        }
View Full Code Here

Examples of org.netbeans.server.uihandler.statistics.Actions.Calls

       
        Object attr = pg.getAttribute("userActions");
        assertNotNull("Value provided", attr);
        assertEquals(true, attr instanceof Calls);
       
        Calls calls = (Calls)attr;
        Map<String,Integer> all = calls.getTopTen(10, null, null, Actions.Invocations.ALL);

        String dumpAll = all.toString();
        if (dumpAll.indexOf("Delegate") >= 0) {
            fail("Some Delegate:\n" + dumpAll);
        }
View Full Code Here

Examples of org.netbeans.server.uihandler.statistics.Actions.Calls

       
        Object attr = pg.getAttribute("userActions");
        assertNotNull("Value provided", attr);
        assertEquals(true, attr instanceof Calls);
       
        Calls calls = (Calls)attr;
        Map<String,Integer> all = calls.getTopTen(10, null, null, Actions.Invocations.ALL);

        String dumpAll = all.toString();
        if (dumpAll.indexOf("Delegate") >= 0) {
            fail("Some Delegate:\n" + dumpAll);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.