You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by Deepal Jayasinghe <de...@opensource.lk> on 2005/11/01 05:34:51 UTC

Description abut synaspse.xml

Hi all ,

I will explain what I have in mind about the current synapse.xml (which is in propotye1) and why did I come with that kind of syntax .

As we discussed in the last chat , there are two paths in Synapse incoming  and outgoing.

<synapse>
    <direction name="incoming">
        <ruleSet class="org.apache.synapse.engine.RuleSelectorImpl" stage="IN">
            <rule name="Rule1">
                <xpath>*</xpath>
                <mediator name="Log"/>
                <!--<mediator>Log</mediator>-->
                <qos>Addressing</qos>
            </rule>
        </ruleSet>
        <ruleSet class="org.apache.synapse.engine.RuleSelectorImpl" stage="PROCESS"/>
        <ruleSet class="org.apache.synapse.engine.RuleSelectorImpl" stage="OUT"/>
    </direction>
    <direction name="outgoing">
        <ruleSet class="org.apache.synapse.engine.RuleSelectorImpl" stage="IN"/>
        <ruleSet class="org.apache.synapse.engine.RuleSelectorImpl" stage="PROCESS"/>
        <ruleSet class="org.apache.synapse.engine.RuleSelectorImpl" stage="OUT"/>
    </direction>
</synapse>

Here the <direction> element corresponds to those two paths name attribute tell that is incoming or outgoing, and inside each path there can be three stages.

For each stage there can be multiple rules and that will make a rule set , therefore <rulSet> element is to described one stage in a particular path. Each rule sat have two attribute (there can be many)called "class" and "stage". 

Class = The RuleSelector class that should used to process this particular ruleset , and that class is implementation class of RuleSelector interface. And what that class does is when we give him the OMElement corresponds to the ruleSet , it will read that crate a Rule[].

State =  to specify the stage these rules should run.

<rule> : In side <ruleSet> there can be one or more rules and each rule has a compulsory name attribute (There is one to one map rule into a service ) .  For each and every rule there would be AxisService with the name of rule.

As you can see in above rule element can have child element too.

 <xpath>*</xpath> : Which will described the condition on which mediation has to be taken place.

<mediator name="Log"/> : There can be one or more mediators  for a given rule , and if there are many MediatorMessageReceiver will mediate all of them (pls see the code if you have any doubt).

<qos>Addressing</qos> : This can be used to specify  what are the type of QOS this particular rule required  , there can be none or more of these elements. So depending on them the corresponding service will be engaged those modules. 

Although the current synapse.xml does not have a way to specify parameters , we can use the same way as Axis2, and my idea is to give a way to specify parameters at each level
1.Inside ruleSet
2.Inside rule
3.Inside mediators 


Thanks,
 Deepal
................................................................
~Future is Open~