Search in sources :

Example 6 with InvokeMediator

use of org.apache.synapse.mediators.template.InvokeMediator in project wso2-synapse by wso2.

the class TemplateMessageExecutor method init.

public void init(SynapseEnvironment se) {
    // Initialize the template and populate the parameters
    synapseEnvironment = se;
    invoker = new InvokeMediator();
    invoker.setTargetTemplate(templateKey);
    buildParameters(templateParams);
    // Remove if there's a sequence already exists
    if (se.getSynapseConfiguration().getSequence(SynapseConstants.PREFIX_HIDDEN_SEQUENCE_KEY + templateKey.hashCode()) != null) {
        se.getSynapseConfiguration().removeSequence(SynapseConstants.PREFIX_HIDDEN_SEQUENCE_KEY + templateKey.hashCode());
    }
    seqMed = new SequenceMediator();
    seqMed.setName(SynapseConstants.PREFIX_HIDDEN_SEQUENCE_KEY + templateKey.hashCode());
    seqMed.addChild(invoker);
    se.getSynapseConfiguration().addSequence(seqMed.getName(), seqMed);
}
Also used : InvokeMediator(org.apache.synapse.mediators.template.InvokeMediator) SequenceMediator(org.apache.synapse.mediators.base.SequenceMediator)

Aggregations

InvokeMediator (org.apache.synapse.mediators.template.InvokeMediator)6 OMAttribute (org.apache.axiom.om.OMAttribute)2 OMElement (org.apache.axiom.om.OMElement)2 QName (javax.xml.namespace.QName)1 Mediator (org.apache.synapse.Mediator)1 SynapseException (org.apache.synapse.SynapseException)1 SwitchCase (org.apache.synapse.config.xml.SwitchCase)1 EnclosedInlinedSequence (org.apache.synapse.debug.constructs.EnclosedInlinedSequence)1 AbstractListMediator (org.apache.synapse.mediators.AbstractListMediator)1 Value (org.apache.synapse.mediators.Value)1 SequenceMediator (org.apache.synapse.mediators.base.SequenceMediator)1 CommentMediator (org.apache.synapse.mediators.builtin.CommentMediator)1 ForEachMediator (org.apache.synapse.mediators.builtin.ForEachMediator)1 AggregateMediator (org.apache.synapse.mediators.eip.aggregator.AggregateMediator)1 CloneMediator (org.apache.synapse.mediators.eip.splitter.CloneMediator)1 IterateMediator (org.apache.synapse.mediators.eip.splitter.IterateMediator)1 FilterMediator (org.apache.synapse.mediators.filters.FilterMediator)1 SwitchMediator (org.apache.synapse.mediators.filters.SwitchMediator)1