Package org.apache.synapse

Examples of org.apache.synapse.Mediator.mediate()


            }
        } finally {
            Iterator it = finallyMediators.iterator();
            while (it.hasNext()) {
                Mediator m = (Mediator) it.next();
                if (!m.mediate(synCtx)) {
                    return false;
                }
            }
        }
        return true;
View Full Code Here


        log.debug("Implicit Sequence <" + getType() + "> :: mediate()");

        Iterator it = mediators.iterator();
        while (it.hasNext()) {
            Mediator m = (Mediator) it.next();
            if (!m.mediate(synCtx)) {
                return false;
            }
        }
        return true;
    }
View Full Code Here

        if (appContext != null) {

            Object o = appContext.getBean(beanName);   
            if (o != null && Mediator.class.isAssignableFrom(o.getClass())) {
                Mediator m = (Mediator) o;
                return m.mediate(synCtx);

            } else {
                handleException("Could not load bean named : " + beanName +
                    " from the Spring configuration with key : " + configKey);
            }
View Full Code Here

            } else {
                if (traceOrDebugOn) {
                    traceOrDebug(traceOn, "Executing sequence named " + key);
                }

                boolean result = m.mediate(synCtx);

                if (traceOrDebugOn) {
                    traceOrDebug(traceOn, "End : Sequence <" + key + ">");
                }
                return result;
View Full Code Here

        if (isAllowed) {
            if (onAcceptSeqKey != null) {
                Mediator mediator = synContext.getSequence(onAcceptSeqKey);
                if (mediator != null) {
                    return mediator.mediate(synContext);
                } else {
                    handleException("Unable to find onAccept sequence with key : "
                        + onAcceptSeqKey, synContext);
                }
            } else if (onAcceptMediator != null) {
View Full Code Here

        } else {
            if (onRejectSeqKey != null) {
                Mediator mediator = synContext.getSequence(onRejectSeqKey);
                if (mediator != null) {
                    return mediator.mediate(synContext);
                } else {
                    handleException("Unable to find onReject sequence with key : "
                        + onRejectSeqKey, synContext);
                }
            } else if (onRejectMediator != null) {
View Full Code Here

    public void testPojoWithoutPropertiesNotCommandImpl() throws Exception {
        Mediator pcm = MediatorFactoryFinder.getInstance().getMediator(createOMElement(
                "<pojoCommand name='org.apache.synapse.mediators.ext.POJOCommandTestMediator' " +
                        "xmlns='http://ws.apache.org/ns/synapse'/>"));
        POJOCommandTestHelper.reset();
        pcm.mediate(new TestMessageContext());
        assertTrue(POJOCommandTestHelper.getInstance().isExecuted());
    }

    public void testPojoWithPropertiesNotCommandImpl() throws Exception {
        Mediator pcm = MediatorFactoryFinder.getInstance().getMediator(createOMElement(
View Full Code Here

        Mediator pcm = MediatorFactoryFinder.getInstance().getMediator(createOMElement(
                "<pojoCommand name='org.apache.synapse.mediators.ext.POJOCommandTestMediator' " +
                        "xmlns='http://ws.apache.org/ns/synapse'><property name=\"testProp\" " +
                        "expression=\"fn:concat('XPATH ', 'FUNC')\"/></pojoCommand>"));
        POJOCommandTestHelper.reset();
        pcm.mediate(new TestMessageContext());
        assertEquals("XPATH FUNC", POJOCommandTestHelper.getInstance().getChangedProperty());
        assertTrue(POJOCommandTestHelper.getInstance().isExecuted());
    }

    public void testPojoWithoutPropertiesCommandImpl() throws Exception {
View Full Code Here

    public void testPojoWithoutPropertiesCommandImpl() throws Exception {
        Mediator pcm = MediatorFactoryFinder.getInstance().getMediator(createOMElement(
                "<pojoCommand name='org.apache.synapse.mediators.ext.POJOCommandTestImplementedMediator' " +
                        "xmlns='http://ws.apache.org/ns/synapse'/>"));
        POJOCommandTestHelper.reset();
        pcm.mediate(new TestMessageContext());
        assertTrue(POJOCommandTestHelper.getInstance().isExecuted());
    }

    public void testPojoWithPropertiesCommandImpl() throws Exception {
        Mediator pcm = MediatorFactoryFinder.getInstance().getMediator(createOMElement(
View Full Code Here

        Mediator pcm = MediatorFactoryFinder.getInstance().getMediator(createOMElement(
                "<pojoCommand name='org.apache.synapse.mediators.ext.POJOCommandTestImplementedMediator' " +
                        "xmlns='http://ws.apache.org/ns/synapse'><property name=\"testProp\" " +
                        "expression=\"fn:concat('XPATH ', 'FUNC')\"/></pojoCommand>"));
        POJOCommandTestHelper.reset();
        pcm.mediate(new TestMessageContext());
        assertEquals("XPATH FUNC", POJOCommandTestHelper.getInstance().getChangedProperty());
        assertTrue(POJOCommandTestHelper.getInstance().isExecuted());
    }

    public void testPojoWithStaticPropertiesCommandImpl() throws Exception {
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.