Examples of PipelineInvocationHandle


Examples of com.alibaba.citrus.service.pipeline.PipelineInvocationHandle

                  /* otherwise */"2-1", "2-2" /* break */, //
                  "1-3");

        // pipeline reference
        pipeline = getPipelineImplFromFactory("choose-ref");
        PipelineInvocationHandle handle = pipeline.newInvocation();

        handle.setAttribute("value", 1);
        handle.invoke();
        assertLog("1-1", /* choose *///
                  /* when value==1 */"2-1", //
                  /* when value==2 *///
                  /* otherwise *///
                  "1-3");

        handle.setAttribute("value", 2);
        handle.invoke();
        assertLog("1-1", /* choose *///
                  /* when value==1 *///
                  /* when value==2 */"2-1", "2-2", //
                  /* otherwise *///
                  "1-3");

        handle.setAttribute("value", 3);
        handle.invoke();
        assertLog("1-1", /* choose *///
                  /* when value==1 *///
                  /* when value==2 *///
                  /* otherwise */"2-1", "2-2", "2-3", //
                  "1-3");
View Full Code Here

Examples of com.alibaba.citrus.service.pipeline.PipelineInvocationHandle

                  /* 4-1 break to if-block1 *///
                  "1-3");

        // pipeline reference
        pipeline = getPipelineImplFromFactory("if-ref");
        PipelineInvocationHandle handle = pipeline.newInvocation();
        handle.setAttribute("value", 1);
        handle.invoke();
        assertLog("1-1", //
                  /* if value==1 */"2-1", //
                  "1-3");
    }
View Full Code Here

Examples of com.alibaba.citrus.service.pipeline.PipelineInvocationHandle

    @Test
    public void result() throws Exception {
        getInvocationContext("http://localhost/app1/ddd/eee/myEventScreen/returnValue.jsp");
        initRequestContext();

        PipelineInvocationHandle invocation = pipeline.newInvocation();
        invocation.invoke();

        assertEquals("returnValue", rundata.getRequest().getAttribute("module.screen.ddd.eee.MyEventScreen"));
        assertEquals("myresult", invocation.getAttribute("result"));
    }
View Full Code Here

Examples of com.alibaba.citrus.service.pipeline.PipelineInvocationHandle

        assertNotNull(pipeline);

        getInvocationContext("http://localhost/app1/ddd/eee/myEventScreen/returnValue.jsp");
        initRequestContext();

        PipelineInvocationHandle invocation = pipeline.newInvocation();
        invocation.invoke();

        assertEquals("returnValue", rundata.getRequest().getAttribute("module.screen.ddd.eee.MyEventScreen"));
        assertEquals("myresult", invocation.getAttribute("myresult"));
        assertEquals("myresult", rundata.getRequest().getAttribute("screenResult"));
    }
View Full Code Here

Examples of com.alibaba.citrus.service.pipeline.PipelineInvocationHandle

    @Test
    public void result() throws Exception {
        getInvocationContext("http://localhost/app1/ddd/eee/myEventScreen/returnValue.jsp");
        initRequestContext();

        PipelineInvocationHandle invocation = pipeline.newInvocation();
        invocation.invoke();

        assertEquals("returnValue", rundata.getRequest().getAttribute("module.screen.ddd.eee.MyEventScreen"));
        assertEquals("myresult", invocation.getAttribute("screenResult"));
    }
View Full Code Here

Examples of com.alibaba.citrus.service.pipeline.PipelineInvocationHandle

        assertNotNull(pipeline);

        getInvocationContext("http://localhost/app1/ddd/eee/myEventScreen/returnValue.jsp");
        initRequestContext();

        PipelineInvocationHandle invocation = pipeline.newInvocation();
        invocation.invoke();

        assertEquals("returnValue", rundata.getRequest().getAttribute("module.screen.ddd.eee.MyEventScreen"));
        assertEquals("myresult", invocation.getAttribute("myresult"));
        assertEquals("myresult", rundata.getRequest().getAttribute("screenResult"));
    }
View Full Code Here

Examples of com.alibaba.citrus.service.pipeline.PipelineInvocationHandle

    }

    public void invoke(PipelineContext pipelineContext) throws Exception {
        assertInitialized();

        PipelineInvocationHandle handle = initLoop(pipelineContext);

        do {
            invokeBody(handle);
        } while (!handle.isBroken());

        pipelineContext.invokeNext();
    }
View Full Code Here

Examples of com.alibaba.citrus.service.pipeline.PipelineInvocationHandle

        pipelineContext.invokeNext();
    }

    protected PipelineInvocationHandle initLoop(PipelineContext pipelineContext) {
        PipelineInvocationHandle handle = getLoopBody().newInvocation(pipelineContext);
        handle.setAttribute(getLoopCounterName(), 0);
        return handle;
    }
View Full Code Here

Examples of com.alibaba.citrus.service.pipeline.PipelineInvocationHandle

            if (tryPipeline != null) {
                tryPipeline.newInvocation(pipelineContext).invoke();
            }
        } catch (Exception e) {
            if (catchPipeline != null) {
                PipelineInvocationHandle handle = catchPipeline.newInvocation(pipelineContext);
                handle.setAttribute(getExceptionName(), e);
                handle.invoke();
            } else {
                throw e;
            }
        } finally {
            if (finallyPipeline != null) {
View Full Code Here

Examples of com.alibaba.citrus.service.pipeline.PipelineInvocationHandle

    @Override
    public void invoke(PipelineContext pipelineContext) throws Exception {
        assertInitialized();

        PipelineInvocationHandle handle = initLoop(pipelineContext);

        while (condition.isSatisfied(handle)) { // 注意:condition的上下文为handle而非当前pipelineContext
            invokeBody(handle);

            if (handle.isBroken()) {
                break;
            }
        }

        pipelineContext.invokeNext();
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.