Package org.auraframework.system

Examples of org.auraframework.system.Message


                actionList.add(instance);
            }
        }

        return new Message(actionList);
    }
View Full Code Here


        return new Message(actionList);
    }

    @Override
    public void write(Object value, Map<String, Object> attributes, Appendable out) throws IOException {
        Message message = (Message) value;
        AuraContext c = Aura.getContextService().getCurrentContext();
        Map<String, Object> m = new HashMap<String, Object>();
        if (attributes != null) {
            m.putAll(attributes);
        }

        m.put("actions", message.getActions());
        m.put("context", c);
        Json.serialize(m, out, c.getJsonSerializationContext());
    }
View Full Code Here

                        action.run();
                    } finally {
                        context.setCurrentAction(previous);
                    }

                    Message message = new Message(Lists.newArrayList(action));

                    init.append("var config = ");
                    Aura.getSerializationService().write(message, null, Message.class, init);
                    init.append(";\n");
View Full Code Here

        Action c = new EmptyAction(sw,"third action");
        Action d = new ShareCmpAction("d",a,sharedCmp,attributesA);
        Action e = new ShareCmpAction("e",b,sharedCmp,attributesB);
        Action f = new ShareCmpAction("f",c,sharedCmp,attributesC);
        List<Action> actions = Lists.newArrayList(d,e,f);
        Message message = new Message(actions);
        //run the list of actions.
        ss.run(message, Aura.getContextService().getCurrentContext(), sw, null);
       
        //sanity check, sharedCmp should have the latest attribute value.
        //this has nothing to do with the fix though
View Full Code Here

        ServerService ss = Aura.getServerService();
        Action a = new EmptyAction(sw,"first action");
        Action b = new EmptyAction(sw,"second action");
        Action c = new EmptyAction(sw,"third action");
        List<Action> actions = Lists.newArrayList(a,b,c);
        Message message = new Message(actions);
        //run the list of actions.
        ss.run(message, Aura.getContextService().getCurrentContext(), sw, null);
        String returnValuea = "{\"actions\":[";
        String returnValueb = returnValuea+"{\"action\":\"firstaction\"}";
        String returnValuec = returnValueb+",{\"action\":\"secondaction\"}";
View Full Code Here

      StringWriter sw = new StringWriter();
        ServerService ss = Aura.getServerService();
        Action a = new EmptyAction(sw,"first action");
        Action b = new EmptyAction(sw,"second action");
        List<Action> actions = Lists.newArrayList(a,b,a,b);
        Message message = new Message(actions);
        ss.run(message, Aura.getContextService().getCurrentContext(), sw, null);
        assertTrue(((EmptyAction)a).getCount()==2);
        assertTrue(((EmptyAction)b).getCount()==2);
        //in the old way since we output action info into response after all actions finish running, the previous run's info will get overwrited
        //but this is not the case now
View Full Code Here

        Aura.getContextService().startContext(Mode.UTEST, Format.JSON, Authentication.AUTHENTICATED);

        ServerService ss = Aura.getServerService();
        Action a = new EmptyAction();
        List<Action> actions = Lists.newArrayList(a);
        Message message = new Message(actions);
        StringWriter sw = new StringWriter();
        ss.run(message, Aura.getContextService().getCurrentContext(), sw, null);
        validateEmptyActionSerialization(sw.toString(), null, Arrays.asList("simpleaction"));
    }
View Full Code Here

     
        ServerService ss = Aura.getServerService();
        Action a = new EmptyAction();
        List<Action> actions = Lists.newArrayList(a);
        Map<String,String> extras = Maps.newHashMap();
        Message message = new Message(actions);
        StringWriter sw = new StringWriter();
        extras.put("this", "that");
        ss.run(message, Aura.getContextService().getCurrentContext(), sw, extras);

        Map<String, Object> json = validateEmptyActionSerialization(sw.toString(), Sets.newHashSet("this"),Arrays.asList("simpleaction"));
View Full Code Here

    private List<Map<String, Object>> runActionsAndReturnLogs(List<Action> actions) throws Exception {
        List<Map<String, Object>> logs;
        StringWriter sw = new StringWriter();
        TestLoggingAdapterController.beginCapture();
        try {
            Aura.getServerService().run(new Message(actions), Aura.getContextService().getCurrentContext(), sw, null);
        } finally {
            Aura.getLoggingService().flush();
            logs = TestLoggingAdapterController.endCapture();
            assertNotNull(logs);
        }
View Full Code Here

            if (!fwUID.equals(context.getFrameworkUID())) {
                throw new ClientOutOfSyncException("Framework has been updated");
            }
            context.setFrameworkUID(fwUID);

            Message message;

            loggingService.startTimer(LoggingService.TIMER_DESERIALIZATION);
            try {
                message = serializationService.read(new StringReader(msg), Message.class);
            } finally {
                loggingService.stopTimer(LoggingService.TIMER_DESERIALIZATION);
            }

            // The bootstrap action cannot not have a CSRF token so we let it
            // through
            boolean isBootstrapAction = false;
            if (message.getActions().size() == 1) {
                Action action = message.getActions().get(0);
                String name = action.getDescriptor().getQualifiedName();
                if (name.equals("aura://ComponentController/ACTION$getApplication")
                        || (name.equals("aura://ComponentController/ACTION$getComponent") && !isProductionMode(context
                                .getMode()))) {
                    isBootstrapAction = true;
View Full Code Here

TOP

Related Classes of org.auraframework.system.Message

Copyright © 2018 www.massapicom. 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.