Examples of mediate()


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

                log.debug("Loading bean : " + beanName + " from Spring configuration named : " + configName);
                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 find the bean named : " + beanName +
                        " from the Spring configuration named : " + configName);
                }
View Full Code Here

Examples of org.apache.synapse.config.xml.SwitchCase.mediate()

                    if (swCase != null) {
                        if (swCase.matches(sourceText)) {
                            if (traceOrDebugOn) {
                                traceOrDebug(traceOn, "Matching case found : " + swCase.getRegex());
                            }
                            return swCase.mediate(synCtx);
                        }
                    }
                }

                if (defaultCase != null) {
View Full Code Here

Examples of org.apache.synapse.mediators.ValidateMediator.mediate()

        // set dummy mediator to be called on fail
        validate.addChild(testMediator);

        // test validate mediator, with static enveope
        validate.mediate(TestUtils.getTestContext(IN_VALID_ENVELOPE_NO_NS));

        assertTrue(onFailInvoked);
    }
}
View Full Code Here

Examples of org.apache.synapse.mediators.base.SequenceMediator.mediate()

                } else {
                    if (log.isDebugEnabled()) {
                        log.debug("Synchronously mediating using the sequence " +
                                "named : " + sequenceRef);
                    }
                    returnValue = refSequence.mediate(synCtx);
                }
            } else {
                handleException("Couldn't find the sequence named : " + sequenceRef);
            }
        } else if (endpoint != null) {
View Full Code Here

Examples of org.apache.synapse.mediators.bsf.InlineScriptMediator.mediate()

    public void testFromScript() throws Exception {
        InlineScriptMediator mediator = new InlineScriptMediator("xml.js", "mc.setPayloadXML(<a><b>petra</b></a>);");
        mediator.init();
        TestMessageContext mc = TestUtils.getTestContext("<foo/>");
        mediator.mediate(mc);
        Iterator iterator = mc.getEnvelope().getChildElements();
        iterator.next();
        assertEquals(XML, ((OMElement) iterator.next()).getFirstElement().toString());
    }
}
View Full Code Here

Examples of org.apache.synapse.mediators.bsf.ScriptMediator.mediate()

    public void testInlineMediator() throws Exception {
        ScriptMediator mediator = new ScriptMediator("js", "mc.getPayloadXML().b == 'petra';");

        MessageContext mc = TestUtils.getTestContext("<a><b>petra</b></a>", null);
        assertTrue(mediator.mediate(mc));

        mc = TestUtils.getTestContext("<a><b>sue</b></a>", null);
        assertFalse(mediator.mediate(mc));

        mc = TestUtils.getTestContext("<a><b>petra</b></a>", null);
View Full Code Here

Examples of org.apache.synapse.mediators.builtin.ValidateMediator.mediate()

        prop.setType(Entry.URL_SRC);
        prop.setSrc(new URL("file:./../../repository/conf/sample/resources/validate/validate.xsd"));
        props.put("xsd-key", prop);

        // test validate mediator, with static enveope
        validate.mediate(TestUtils.getTestContext(VALID_ENVELOPE, props));

        assertFalse(onFailInvoked);
    }

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

Examples of org.apache.synapse.mediators.eip.Target.mediate()

                MessageContext newContext = getClonedMessageContext(synCtx, i, targets.size());
                Object o = targets.get(i);

                if (o instanceof Target) {
                    Target target = (Target) o;
                    target.mediate(newContext);
                }
            }
        }

        // finalize tracing and debugging
View Full Code Here

Examples of org.apache.synapse.mediators.validate.ValidateMediator.mediate()

        prop.setType(Property.DYNAMIC_TYPE);
        prop.setKey("file:./../../repository/conf/sample/resources/validate/validate.xsd");
        props.put("xsd-key", prop);

        // test validate mediator, with static enveope
        validate.mediate(TestUtils.getTestContext(VALID_ENVELOPE, props));

        assertFalse(onFailInvoked);
    }

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

Examples of org.apache.tuscany.spi.databinding.Mediator.mediate()

        Mediator mediator = createMock(Mediator.class);
        Object[] source = new Object[] {"<foo>bar</foo>"};
        Foo foo = new Foo();
        foo.bar = "bar";
        Object[] target = new Object[] {foo};
        expect(mediator.mediate(EasyMock.same(source),
                                EasyMock.same(inputType1),
                                EasyMock.same(inputType2),
                                EasyMock.isA(Map.class))).andReturn(target);
        // expect(mediator.mediate(target[0], type2,
        // type1)).andReturn(source[0]);
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.