Package com.alibaba.citrus.turbine.support

Examples of com.alibaba.citrus.turbine.support.MappedContext


    @Test
    public void controlContext() throws Exception {
        request("action", "context.myAction", "doGetString");

        Context context = new MappedContext();
        context.put("aaa", "sss");
        rundata.pushContext(context);

        module.execute();
        assertLog("actionLog", String.class, "sss");
View Full Code Here


    @Test
    public void context_control() throws Exception {
        getInvocationContext("/app1");
        initRequestContext();

        Context controlContext = new MappedContext();
        getRunData().pushContext(controlContext);

        moduleLoaderService.getModule("control", "rundata.myControl").execute();

        Context context = assertLog("controlLog", Context.class);
View Full Code Here

        Context screenContext = rundata.getContext(componentName);
        final Context callerContext = rundata.getCurrentContext();
        final Set<String> exportVars = params.exportVars == null ? Collections.<String>emptySet() : params.exportVars;

        // create control context
        MappedContext context = new MappedContext(screenContext) {
            @Override
            protected void internalPut(String key, Object value) {
                if (isExport(key)) {
                    callerContext.put(key, value);
                }

                super.internalPut(key, value);
            }

            @Override
            protected void internalRemove(String key) {
                if (isExport(key)) {
                    callerContext.remove(key);
                }

                super.internalRemove(key);
            }

            private boolean isExport(String key) {
                return callerContext != null && (exportAll || exportVars.contains(key));
            }
        };

        // add all params
        context.getMap().putAll(params);

        return context;
    }
View Full Code Here

        Context screenContext = rundata.getContext(componentName);
        final Context callerContext = rundata.getCurrentContext();
        final Set<String> exportVars = params.exportVars == null ? Collections.<String> emptySet() : params.exportVars;

        // create control context
        MappedContext context = new MappedContext(screenContext) {
            @Override
            protected void internalPut(String key, Object value) {
                if (isExport(key)) {
                    callerContext.put(key, value);
                }

                super.internalPut(key, value);
            }

            @Override
            protected void internalRemove(String key) {
                if (isExport(key)) {
                    callerContext.remove(key);
                }

                super.internalRemove(key);
            }

            private boolean isExport(String key) {
                return callerContext != null && (exportAll || exportVars.contains(key));
            }
        };

        // add all params
        context.getMap().putAll(params);

        return context;
    }
View Full Code Here

TOP

Related Classes of com.alibaba.citrus.turbine.support.MappedContext

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.