The current deployment model of Apache Synapse has a tight coupling to Apache Axis2 and its semantics. The core part of Synapse can be deployed into Apache Axis2 as a Module Archive (MAR file named "synapse.mar").
Mediators of Apache Synapse/Java can be divided into two categories, Core Mediators, which are distributed in synapse-core-xx.jar and Extension Mediators, which are distributed in synapse-extensions-xx.jar. Only the synapse-core-xx.jar is present in the synapse.mar. If you need to use Extension mediators, then you need to add the synapse-extension-xx.jar in the server's classpath. So, just by adding synapse.mar to an existing Axis2 repository, one can transform any Axis2 instance to behave as a Gateway, HTTP Proxy, or a Transparent Proxy. Synapse has its own rule configuration language to process messages that are flowing through Synapse Environment.
This rule configuration is commonly available in the synapse.xml. There are two ways in which the user can set the rule configuration into Synapse Environment.
1. User can set the location of the synapse.xml in a System property named "synapse.xml".
2. User can set it as a parameter in the associated Axis2.xml using "SynapseConfiguration" as the key.
<parameter name="SynapseConfiguration" locked="true">/tmp/synapse/synapse.xml</parameter>If both parameters are absent, then Synapse will create the default configuration, which will allow Synapse to pass through all the messages flowing through it. After the location has been specified (absolute or relative) user has to engage the synapse.mar by adding the following code line in the associated Axis2.xml. This will ensure that the module gets engaged and the dispatchers are added to the Axis2 handler chains at the right location for Synapse to work properly.
<moduler ref="synapse"/>