Author: saminda
Date: Wed May 31 22:59:00 2006
New Revision: 410771
URL: http://svn.apache.org/viewvc?rev=410771&view=rev
Log:
change the logic of config finding to get the location of the synapse.xml from
axis2.xml if available. But the
priority is given to the System property.
Modified:
incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/Axis2MessageContextFinder.java
incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/SynapseModule.java
Modified:
incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/Axis2MessageContextFinder.java
URL:
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/Axis2MessageContextFinder.java?rev=410771&r1=410770&r2=410771&view=diff
==============================================================================
---
incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/Axis2MessageContextFinder.java
(original)
+++
incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/Axis2MessageContextFinder.java
Wed May 31 22:59:00 2006
@@ -69,17 +69,33 @@
}
log.info("Initializing Synapse...");
- SynapseConfiguration synCfg = null;
+ SynapseConfiguration synCfg;
AxisConfiguration axisCfg =
mc.getConfigurationContext().getAxisConfiguration();
- // if the system property synapse.xml is specified, use it.. else
default config
+ /*
+ First Check, if synapse.xml is provided as an system property, use it..
+ else
+ check if the synapse.xml is available via Axis2.xml
SynapseConfiguration
+ else
+ default config [which is only the passthrow case]
+
+ Priorty will be given to the System property.
+ */
+
+ Parameter configParam = axisCfg.getParameter(SYNAPSE_CONFIGURATION);
+
String config = System.getProperty(Constants.SYNAPSE_XML);
+
if (config != null) {
log.info("System property '" + Constants.SYNAPSE_XML +
"' specifies synapse configuration as " + config);
synCfg = SynapseConfigurationBuilder.getConfiguration(config);
- } else {
- log.warn("System property '" + Constants.SYNAPSE_XML + "' is not
specified. Using default configuration");
+ }else if (configParam != null) {
+ log.info("Synapse.xml is available via SynapseConfiguration in
Axis2.xml");
+ synCfg =
SynapseConfigurationBuilder.getConfiguration(configParam.getValue().toString().trim());
+ }else {
+ log.warn("System property '" + Constants.SYNAPSE_XML + "' is not
specified or SynapseConfiguration" +
+ "is not available via Axis2.xml.Thus, Using default
configuration");
synCfg = SynapseConfigurationBuilder.getDefaultConfiguration();
}
Modified:
incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/SynapseModule.java
URL:
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/SynapseModule.java?rev=410771&r1=410770&r2=410771&view=diff
==============================================================================
---
incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/SynapseModule.java
(original)
+++
incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/SynapseModule.java
Wed May 31 22:59:00 2006
@@ -53,18 +53,32 @@
log.info("Initializing Synapse Environment ...");
- SynapseConfiguration synCfg = null;
+ SynapseConfiguration synCfg;
+
+ /*
+ First Check, if synapse.xml is provided as an system property, use it..
+ else
+ check if the synapse.xml is available via Axis2.xml
SynapseConfiguration
+ else
+ default config [which is only the passthrow case]
+
+ Priorty will be given to the System property.
+ */
+
+ Parameter configParam = axisCfg.getParameter(SYNAPSE_CONFIGURATION);
- // if the system property synapse.xml is specified, use it.. else
default config
String config = System.getProperty(Constants.SYNAPSE_XML);
if (config != null) {
log.info("System property '" + Constants.SYNAPSE_XML +
- "' specifies synapse configuration as " + config);
+ "' specifies synapse configuration as " + config);
synCfg = SynapseConfigurationBuilder.getConfiguration(config);
- } else {
- log.info("System property '" + Constants.SYNAPSE_XML +
- "' is not specified. Using default configuration");
+ }else if (configParam != null) {
+ log.info("Synapse.xml is available via SynapseConfiguration in
Axis2.xml");
+ synCfg =
SynapseConfigurationBuilder.getConfiguration(configParam.getValue().toString().trim());
+ }else {
+ log.warn("System property '" + Constants.SYNAPSE_XML + "' is not
specified or SynapseConfiguration" +
+ "is not available via Axis2.xml.Thus, Using default
configuration");
synCfg = SynapseConfigurationBuilder.getDefaultConfiguration();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]