synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asan...@apache.org
Subject svn commit: r615763 [1/5] - in /webservices/synapse/trunk/java: ./ modules/core/ modules/core/src/main/java/org/apache/synapse/ modules/core/src/main/java/org/apache/synapse/config/ modules/core/src/main/java/org/apache/synapse/config/xml/ modules/core...
Date Mon, 28 Jan 2008 08:44:05 GMT
Author: asankha
Date: Mon Jan 28 00:43:56 2008
New Revision: 615763

URL: http://svn.apache.org/viewvc?rev=615763&view=rev
Log:
merge back changes from 1.1.1 branch to trunk

Added:
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/CustomURIResolver.java
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/modules/core/src/main/java/org/apache/synapse/core/axis2/CustomURIResolver.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/CustomWSDLLocator.java
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/modules/core/src/main/java/org/apache/synapse/core/axis2/CustomWSDLLocator.java
    webservices/synapse/trunk/java/modules/transports/src/main/java/org/apache/synapse/transport/mail/
      - copied from r615754, webservices/synapse/branches/1.1.1/modules/transports/src/main/java/org/apache/synapse/transport/mail/
    webservices/synapse/trunk/java/modules/transports/src/main/java/org/apache/synapse/transport/mail/MailConstants.java
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/modules/transports/src/main/java/org/apache/synapse/transport/mail/MailConstants.java
    webservices/synapse/trunk/java/modules/transports/src/main/java/org/apache/synapse/transport/mail/MailOutTransportInfo.java
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/modules/transports/src/main/java/org/apache/synapse/transport/mail/MailOutTransportInfo.java
    webservices/synapse/trunk/java/modules/transports/src/main/java/org/apache/synapse/transport/mail/MailTransportListener.java
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/modules/transports/src/main/java/org/apache/synapse/transport/mail/MailTransportListener.java
    webservices/synapse/trunk/java/modules/transports/src/main/java/org/apache/synapse/transport/mail/MailTransportSender.java
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/modules/transports/src/main/java/org/apache/synapse/transport/mail/MailTransportSender.java
    webservices/synapse/trunk/java/modules/transports/src/main/java/org/apache/synapse/transport/mail/MailUtils.java
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/modules/transports/src/main/java/org/apache/synapse/transport/mail/MailUtils.java
    webservices/synapse/trunk/java/modules/transports/src/main/java/org/apache/synapse/transport/mail/PollTableEntry.java
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/modules/transports/src/main/java/org/apache/synapse/transport/mail/PollTableEntry.java
    webservices/synapse/trunk/java/modules/transports/src/main/java/org/apache/synapse/transport/mail/WSMimeMessage.java
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/modules/transports/src/main/java/org/apache/synapse/transport/mail/WSMimeMessage.java
    webservices/synapse/trunk/java/modules/transports/src/test/java/org/apache/synapse/transport/mail/
      - copied from r615754, webservices/synapse/branches/1.1.1/modules/transports/src/test/java/org/apache/synapse/transport/mail/
    webservices/synapse/trunk/java/modules/transports/src/test/java/org/apache/synapse/transport/mail/MailEchoRawXMLTest.java
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/modules/transports/src/test/java/org/apache/synapse/transport/mail/MailEchoRawXMLTest.java
    webservices/synapse/trunk/java/modules/transports/src/test/java/org/apache/synapse/transport/mail/UtilsMailServer.java
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/modules/transports/src/test/java/org/apache/synapse/transport/mail/UtilsMailServer.java
    webservices/synapse/trunk/java/patches/
      - copied from r615754, webservices/synapse/branches/1.1.1/patches/
    webservices/synapse/trunk/java/patches/AxisService-patch.jar
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/patches/AxisService-patch.jar
    webservices/synapse/trunk/java/patches/patches.txt
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/patches/patches.txt
    webservices/synapse/trunk/java/repository/conf/sample-server-wrapper.conf
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/repository/conf/sample-server-wrapper.conf
    webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_256.xml
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/repository/conf/sample/synapse_sample_256.xml
    webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_430.xml
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/repository/conf/sample/synapse_sample_430.xml
    webservices/synapse/trunk/java/src/main/bin/synapse.bat
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/src/main/bin/synapse.bat
    webservices/synapse/trunk/java/src/site/resources/css/
      - copied from r615754, webservices/synapse/branches/1.1.1/src/site/resources/css/
    webservices/synapse/trunk/java/src/site/resources/css/maven-base.css
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/src/site/resources/css/maven-base.css
    webservices/synapse/trunk/java/src/site/resources/css/maven-theme.css
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/src/site/resources/css/maven-theme.css
    webservices/synapse/trunk/java/src/site/resources/css/print.css
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/src/site/resources/css/print.css
    webservices/synapse/trunk/java/src/site/resources/css/site.css
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/src/site/resources/css/site.css
    webservices/synapse/trunk/java/src/site/resources/css/style.css
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/src/site/resources/css/style.css
    webservices/synapse/trunk/java/src/site/resources/images/
      - copied from r615754, webservices/synapse/branches/1.1.1/src/site/resources/images/
    webservices/synapse/trunk/java/src/site/resources/images/apache-synapse-banner-background.jpg
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/src/site/resources/images/apache-synapse-banner-background.jpg
    webservices/synapse/trunk/java/src/site/resources/images/apache-synapse-banner.jpg
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/src/site/resources/images/apache-synapse-banner.jpg
    webservices/synapse/trunk/java/src/site/resources/images/apache-synapse-content-back.jpg
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/src/site/resources/images/apache-synapse-content-back.jpg
    webservices/synapse/trunk/java/src/site/resources/images/apache-synapse-logo.jpg
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/src/site/resources/images/apache-synapse-logo.jpg
    webservices/synapse/trunk/java/src/site/resources/images/apache-synapse-menu-bottom.jpg
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/src/site/resources/images/apache-synapse-menu-bottom.jpg
    webservices/synapse/trunk/java/src/site/resources/images/apache-synapse-menu-button.gif
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/src/site/resources/images/apache-synapse-menu-button.gif
    webservices/synapse/trunk/java/src/site/resources/images/apache-synapse-menu-top.jpg
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/src/site/resources/images/apache-synapse-menu-top.jpg
    webservices/synapse/trunk/java/src/site/resources/images/apache-synapse-menu.jpg
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/src/site/resources/images/apache-synapse-menu.jpg
    webservices/synapse/trunk/java/src/site/resources/images/apache-synapse-spliter.jpg
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/src/site/resources/images/apache-synapse-spliter.jpg
    webservices/synapse/trunk/java/src/site/resources/images/external.png
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/src/site/resources/images/external.png
    webservices/synapse/trunk/java/src/site/resources/images/logos/
      - copied from r615754, webservices/synapse/branches/1.1.1/src/site/resources/images/logos/
    webservices/synapse/trunk/java/src/site/resources/images/logos/asf_logo_wide.png
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/src/site/resources/images/logos/asf_logo_wide.png
    webservices/synapse/trunk/java/src/site/resources/images/logos/build-by-maven-black.png
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/src/site/resources/images/logos/build-by-maven-black.png
    webservices/synapse/trunk/java/src/site/resources/images/logos/build-by-maven-white.png
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/src/site/resources/images/logos/build-by-maven-white.png
    webservices/synapse/trunk/java/src/site/resources/images/logos/maven-feather.png
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/src/site/resources/images/logos/maven-feather.png
    webservices/synapse/trunk/java/src/site/resources/images/synapse-banner.jpg
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/src/site/resources/images/synapse-banner.jpg
    webservices/synapse/trunk/java/src/site/resources/images/synapse-flow.png
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/src/site/resources/images/synapse-flow.png
    webservices/synapse/trunk/java/src/site/resources/images/synapse-logo-web2.png
      - copied unchanged from r615754, webservices/synapse/branches/1.1.1/src/site/resources/images/synapse-logo-web2.png
Removed:
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/ResourceMapURIResolver.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/ResourceMapWSDLLocator.java
    webservices/synapse/trunk/java/modules/core/src/main/resources/patches.txt
    webservices/synapse/trunk/java/src/main/bin/run-synapse-service.bat
Modified:
    webservices/synapse/trunk/java/modules/core/pom.xml
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/ServerManager.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/SynapseConstants.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/SynapseConfigUtils.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AggregateMediatorFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AggregateMediatorSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/CacheMediatorFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/CacheMediatorSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/CloneMediatorFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/CloneMediatorSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DBLookupMediatorFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DBLookupMediatorSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DBReportMediatorFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DBReportMediatorSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/IterateMediatorFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/IterateMediatorSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/TargetFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/TargetSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/XSLTMediatorFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/XSLTMediatorSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/endpoints/WSDLEndpointFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/endpoints/utils/WSDL11EndpointBuilder.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/ProxyService.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/ResourceMap.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/MediatorWorker.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/base/SequenceMediator.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/CalloutMediator.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/db/DBLookupMediator.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/eip/EIPConstants.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/eip/EIPUtils.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/eip/Target.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/eip/aggregator/Aggregate.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/eip/aggregator/AggregateMediator.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/eip/splitter/CloneMediator.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/eip/splitter/IterateMediator.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/XSLTMediator.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/startup/quartz/SimpleQuartz.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/startup/quartz/SimpleQuartzFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/startup/quartz/SimpleQuartzSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/statistics/Statistics.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/statistics/impl/ProxyServiceStatisticsStack.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/util/MessageHelper.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/util/SimpleMapImpl.java
    webservices/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/mediators/ext/AnnotatedCommand2.java
    webservices/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/n2n/SynapseCommodityServiceTest.java
    webservices/synapse/trunk/java/modules/extensions/pom.xml
    webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediatorFactory.java
    webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediatorSerializer.java
    webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/xquery/XQueryMediatorFactory.java
    webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/xquery/XQueryMediatorSerializer.java
    webservices/synapse/trunk/java/modules/handler/pom.xml
    webservices/synapse/trunk/java/modules/mar/pom.xml
    webservices/synapse/trunk/java/modules/samples/pom.xml
    webservices/synapse/trunk/java/modules/samples/src/main/scripts/axis2server.bat
    webservices/synapse/trunk/java/modules/samples/src/main/scripts/build.xml
    webservices/synapse/trunk/java/modules/transports/pom.xml
    webservices/synapse/trunk/java/modules/transports/src/main/java/org/apache/synapse/transport/jms/JMSConnectionFactory.java
    webservices/synapse/trunk/java/modules/transports/src/main/java/org/apache/synapse/transport/jms/JMSSender.java
    webservices/synapse/trunk/java/modules/transports/src/main/java/org/apache/synapse/transport/jms/JMSUtils.java
    webservices/synapse/trunk/java/modules/transports/src/main/java/org/apache/synapse/transport/nhttp/Axis2HttpRequest.java
    webservices/synapse/trunk/java/modules/transports/src/main/java/org/apache/synapse/transport/nhttp/ClientHandler.java
    webservices/synapse/trunk/java/modules/transports/src/main/java/org/apache/synapse/transport/nhttp/HttpCoreNIOListener.java
    webservices/synapse/trunk/java/modules/transports/src/main/java/org/apache/synapse/transport/nhttp/HttpCoreNIOSender.java
    webservices/synapse/trunk/java/modules/transports/src/main/java/org/apache/synapse/transport/nhttp/ServerWorker.java
    webservices/synapse/trunk/java/modules/war/pom.xml
    webservices/synapse/trunk/java/pom.xml
    webservices/synapse/trunk/java/repository/conf/axis2.xml
    webservices/synapse/trunk/java/repository/conf/sample/resources/misc/client/axis2.xml
    webservices/synapse/trunk/java/repository/conf/sample/resources/misc/server/axis2.xml
    webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_251.xml
    webservices/synapse/trunk/java/repository/conf/wrapper.conf
    webservices/synapse/trunk/java/src/main/assembly/bin.xml
    webservices/synapse/trunk/java/src/main/assembly/src.xml
    webservices/synapse/trunk/java/src/main/bin/synapse.sh
    webservices/synapse/trunk/java/src/main/release/LICENSE
    webservices/synapse/trunk/java/src/main/release/NOTICE
    webservices/synapse/trunk/java/src/main/release/README.txt
    webservices/synapse/trunk/java/src/main/release/docs/release_notes.txt
    webservices/synapse/trunk/java/src/site/resources/Synapse_Configuration_Language.html
    webservices/synapse/trunk/java/src/site/resources/Synapse_QuickStart.html
    webservices/synapse/trunk/java/src/site/resources/Synapse_Samples.html
    webservices/synapse/trunk/java/src/site/resources/Synapse_Samples_Setup.html
    webservices/synapse/trunk/java/src/site/site.xml

Modified: webservices/synapse/trunk/java/modules/core/pom.xml
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/pom.xml?rev=615763&r1=615762&r2=615763&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/pom.xml (original)
+++ webservices/synapse/trunk/java/modules/core/pom.xml Mon Jan 28 00:43:56 2008
@@ -26,7 +26,7 @@
     <parent>
         <groupId>org.apache.synapse</groupId>
         <artifactId>Apache-Synapse</artifactId>
-        <version>1.1.1-SNAPSHOT</version>
+        <version>1.2-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.synapse</groupId>

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/ServerManager.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/ServerManager.java?rev=615763&r1=615762&r2=615763&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/ServerManager.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/ServerManager.java Mon Jan 28 00:43:56 2008
@@ -28,12 +28,10 @@
 import org.apache.synapse.core.SynapseEnvironment;
 import org.apache.synapse.config.SynapseConfiguration;
 import org.apache.synapse.util.ClasspathURLStreamHandler;
+import org.apache.synapse.transport.nhttp.NhttpConstants;
 
 import java.io.File;
-import java.net.ServerSocket;
-import java.net.URL;
-import java.net.URLStreamHandler;
-import java.net.URLStreamHandlerFactory;
+import java.net.*;
 import java.util.Iterator;
 import java.util.Collection;
 
@@ -176,6 +174,7 @@
         if (trsIn != null) {
 
             int port = 8080;
+            String bindAddress = null;
 
             String strPort = System.getProperty("port");
             if (strPort != null) {
@@ -184,18 +183,28 @@
                     port = new Integer(strPort).intValue();
                 } catch (NumberFormatException e) {
                     // user supplied parameter is not a valid integer. so use the port in configuration.
-                    log.error("Given port is not a valid integer. Port specified in the configuration is used for the server.");
-                    port = Integer.parseInt(trsIn.getParameter("port").getValue().toString());
+                    log.error("System property 'port' does not provide a valid integer");
                 }
+            }
 
-            } else {
-                port = Integer.parseInt(trsIn.getParameter("port").getValue().toString());
+            Parameter param = trsIn.getParameter("port");
+            if (param != null && param.getValue() != null) {
+                port = Integer.parseInt(param.getValue().toString());
+            }
+
+            param = trsIn.getParameter(NhttpConstants.BIND_ADDRESS);
+            if (param != null && param.getValue() != null) {
+                bindAddress = ((String) param.getValue()).trim();
             }
 
             while (true) {
                 ServerSocket sock = null;
                 try {
-                    sock = new ServerSocket(port);
+                    if (bindAddress == null) {
+                        sock = new ServerSocket(port);
+                    } else {
+                        sock = new ServerSocket(port, 50, InetAddress.getByName(bindAddress));
+                    }
                     trsIn.getParameter("port").setValue(Integer.toString(port));
                     break;
                 } catch (Exception e) {

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/SynapseConstants.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/SynapseConstants.java?rev=615763&r1=615762&r2=615763&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/SynapseConstants.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/SynapseConstants.java Mon Jan 28 00:43:56 2008
@@ -231,4 +231,20 @@
     
     /** Synapse server instance name */
     public static final String SYNAPSE_SERVER_NAME = "SynapseServerName";
+
+    public static final String SYNAPSE_DATASOURCES = "synapse.datasources";
+    
+    /** Root for relative path */
+    public static final String RESOLVE_ROOT = "resolve.root";
+
+    /* URL connection read timeout and connection timeout */
+
+    public static final int DEFAULT_READTIMEOUT = 100000;
+
+    public static final int DEFAULT_CONNECTTIMEOUT = 20000;
+
+    public static final String READTIMEOUT = "Connection.ReadTimeout";
+
+    public static final String CONNECTTIMEOUT = "Connection.ConnectTimeout";
+
 }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/SynapseConfigUtils.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/SynapseConfigUtils.java?rev=615763&r1=615762&r2=615763&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/SynapseConfigUtils.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/SynapseConfigUtils.java Mon Jan 28 00:43:56 2008
@@ -26,6 +26,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.synapse.SynapseConstants;
 import org.apache.synapse.SynapseException;
+import org.xml.sax.InputSource;
 
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamException;
@@ -35,10 +36,7 @@
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URL;
-import java.net.URLConnection;
+import java.net.*;
 
 public class SynapseConfigUtils {
 
@@ -117,13 +115,13 @@
                     String path = url.getPath();
                     if (log.isDebugEnabled()) {
                         log.debug("Can not open a connection to the URL with a path :" +
-                                  path);
+                            path);
                     }
                     String synapseHome = System.getProperty(SynapseConstants.SYNAPSE_HOME);
                     if (synapseHome != null) {
                         if (log.isDebugEnabled()) {
                             log.debug("Trying  to resolve an absolute path of the " +
-                                      " URL using the synapse.home : " + synapseHome);
+                                " URL using the synapse.home : " + synapseHome);
                         }
                         if (synapseHome.endsWith("/")) {
                             synapseHome = synapseHome.substring(0, synapseHome.lastIndexOf("/"));
@@ -134,7 +132,7 @@
                         } catch (IOException e) {
                             if (log.isDebugEnabled()) {
                                 log.debug("Faild to resolve an absolute path of the " +
-                                          " URL using the synapse.home : " + synapseHome);
+                                    " URL using the synapse.home : " + synapseHome);
                             }
                             log.warn("IO Error reading from URL " + url.getPath() + e);
                         }
@@ -146,11 +144,11 @@
             }
             URLConnection urlc = url.openConnection();
             XMLToObjectMapper xmlToObject =
-                    getXmlToObjectMapper(urlc.getContentType());
+                getXmlToObjectMapper(urlc.getContentType());
 
             try {
                 XMLStreamReader parser = XMLInputFactory.newInstance().
-                        createXMLStreamReader(urlc.getInputStream());
+                    createXMLStreamReader(urlc.getInputStream());
                 StAXOMBuilder builder = new StAXOMBuilder(parser);
                 OMElement omElem = builder.getDocumentElement();
 
@@ -188,8 +186,8 @@
             return null;
         }
         URLConnection conn = url.openConnection();
-        conn.setReadTimeout(10000);
-        conn.setConnectTimeout(2000);
+        conn.setReadTimeout(getReadTimeout());
+        conn.setConnectTimeout(getConnectionTimeout());
         conn.setRequestProperty("Connection", "close"); // if http is being used
         InputStream urlInStream = conn.getInputStream();
 
@@ -201,7 +199,7 @@
                 return doc;
             } catch (Exception e) {
                 handleException("Error parsing resource at URL : " + url +
-                                " as XML", e);
+                    " as XML", e);
             } finally {
                 try {
                     urlInStream.close();
@@ -212,6 +210,60 @@
         return null;
     }
 
+    public static InputSource getInputSourceFormURI(URI uri) {
+        if (uri == null) {
+            if (log.isDebugEnabled()) {
+                log.debug("Can not create a URL from 'null' ");
+            }
+            return null;
+        }
+        try {
+            URL url = uri.toURL();
+            String protocol = url.getProtocol();
+            String path = url.getPath();
+            if (protocol == null || "".equals(protocol)) {
+                url = new URL("file:" + path);
+            }
+            URLConnection conn = url.openConnection();
+            conn.setReadTimeout(getReadTimeout());
+            conn.setConnectTimeout(getConnectionTimeout());
+            conn.setRequestProperty("Connection", "close"); // if http is being used
+            InputStream urlInStream = conn.getInputStream();
+            return new InputSource(urlInStream);
+        } catch (MalformedURLException e) {
+            handleException("Invalid URL ' " + uri + " '", e);
+        } catch (IOException e) {
+            handleException("Error reading at URI ' " + uri + " ' ", e);
+        }
+        return null;
+    }
+
+    private static int getReadTimeout() {
+        //getting  read timeout
+        String readTO = System.getProperty(SynapseConstants.READTIMEOUT);
+        int readTimeout = SynapseConstants.DEFAULT_READTIMEOUT;
+        if (readTO != null && !"".equals(readTO)) {
+            try {
+                readTimeout = Integer.parseInt(readTO);
+            } catch (NumberFormatException ignored) {
+            }
+        }
+        return readTimeout;
+    }
+
+    private static int getConnectionTimeout() {
+        //getting  connection timeout
+        String connectionTO = System.getProperty(SynapseConstants.CONNECTTIMEOUT);
+        int connectionTimeout = SynapseConstants.DEFAULT_CONNECTTIMEOUT;
+        if (connectionTO != null && !"".equals(connectionTO)) {
+            try {
+                connectionTimeout = Integer.parseInt(connectionTO);
+            } catch (NumberFormatException ignored) {
+            }
+        }
+        return connectionTimeout;
+    }
+
     private static void handleException(String msg, Exception e) {
         log.warn(msg, e);
         throw new SynapseException(msg, e);
@@ -257,7 +309,7 @@
                 } catch (IOException ignored) {
                     if (log.isDebugEnabled()) {
                         log.debug("Can not open a connection to the URL with a path :" +
-                                  path);
+                            path);
                     }
                     String synapseHome = System.getProperty(SynapseConstants.SYNAPSE_HOME);
                     if (synapseHome != null) {
@@ -266,24 +318,24 @@
                         }
                         if (log.isDebugEnabled()) {
                             log.debug("Trying  to resolve an absolute path of the " +
-                                      " URL using the synapse.home : " + synapseHome);
+                                " URL using the synapse.home : " + synapseHome);
                         }
                         try {
                             url = new URL(url.getProtocol() + ":" + synapseHome + "/" +
-                                          url.getPath());
+                                url.getPath());
                             url.openStream();
                         } catch (MalformedURLException e) {
                             handleException("Invalid URL reference " + url.getPath() + e);
                         } catch (IOException e) {
                             if (log.isDebugEnabled()) {
                                 log.debug("Faild to resolve an absolute path of the " +
-                                          " URL using the synapse.home : " + synapseHome);
+                                    " URL using the synapse.home : " + synapseHome);
                             }
                             log.warn("IO Error reading from URL : " + url.getPath() + e);
                         }
                     }
                 }
-            }             
+            }
         } catch (MalformedURLException e) {
             handleException("Invalid URL reference :  " + path, e);
         } catch (IOException e) {
@@ -291,4 +343,63 @@
         }
         return url;
     }
+
+    public static InputSource resolveRelativeURI(String parentLocation, String relativeLocation) {
+
+        if (relativeLocation == null) {
+            throw new IllegalArgumentException("Import URI cannot be null");
+        }
+
+        if (log.isDebugEnabled()) {
+            log.debug("Resolving import URI ' " + parentLocation + " '  against base URI ' " + relativeLocation + " '  ");
+        }
+
+        URI importUri = null;
+        try {
+            importUri = new URI(relativeLocation);
+            if (importUri.isAbsolute()) {
+                return getInputSourceFormURI(importUri);
+            }
+        } catch (URISyntaxException e) {
+            handleException("Invalid URI", e);
+        }
+
+        if (parentLocation == null) {
+            return getInputSourceFormURI(importUri);
+        } else {
+            // if the importuri is absolute
+            if (relativeLocation.startsWith("/") || relativeLocation.startsWith("\\")) {
+                if (importUri != null && !importUri.isAbsolute()) {
+                    try {
+                        importUri = new URI("file:" + relativeLocation);
+                        return getInputSourceFormURI(importUri);
+                    } catch (URISyntaxException e) {
+                        handleException("Invalid URI ' " + importUri.getPath() + " '", e);
+                    }
+                }
+            } else {
+                int index = parentLocation.lastIndexOf("/");
+                if (index == -1) {
+                    index = parentLocation.lastIndexOf("\\");
+                }
+                if (index != -1) {
+                    String basepath = parentLocation.substring(0, index + 1);
+                    String resolvedPath = basepath + relativeLocation;
+                    try {
+                        URI resolvedUri = new URI(resolvedPath);
+                        if (!resolvedUri.isAbsolute()) {
+                            resolvedUri = new URI("file:" + resolvedPath);
+                        }
+                        return getInputSourceFormURI(resolvedUri);
+                    } catch (URISyntaxException e) {
+                        handleException("Invalid URI ' " + resolvedPath + " '", e);
+                    }
+                } else {
+                    return getInputSourceFormURI(importUri);
+                }
+            }
+        }
+        return null;
+    }
 }
+

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AggregateMediatorFactory.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AggregateMediatorFactory.java?rev=615763&r1=615762&r2=615763&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AggregateMediatorFactory.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AggregateMediatorFactory.java Mon Jan 28 00:43:56 2008
@@ -20,7 +20,6 @@
 package org.apache.synapse.config.xml;
 
 import org.apache.synapse.Mediator;
-import org.apache.synapse.SynapseException;
 import org.apache.synapse.mediators.eip.aggregator.AggregateMediator;
 import org.apache.synapse.mediators.builtin.DropMediator;
 import org.apache.synapse.mediators.base.SequenceMediator;
@@ -34,33 +33,29 @@
 import javax.xml.namespace.QName;
 
 /**
+ * <pre>
  * &lt;aggregate&gt;
- *  &lt;corelateOn expression="XPATH-expression"/&gt;
- *  &lt;completeCondition timeout="time-in-seconds"&gt;
- *   &lt;messageCount min="int-min" max="int-max"/&gt;
- *  &lt;/completeCondition&gt;
- *  &lt;onComplete expression="XPATH-expression" sequence="sequence-ref"&gt;
- *   (mediator +)?
- *  &lt;/onComplete&gt;
- *  &lt;invalidate sequence="sequence-ref" timeout="time-in-seconds"&gt;
- *   (mediator +)?
- *  &lt;/invalidate&gt;
+ *   &lt;correlateOn expression="xpath"/&gt;?
+ *   &lt;completeCondition [timeout="time-in-seconds"]&gt;
+ *     &lt;messageCount min="int-min" max="int-max"/&gt;?
+ *   &lt;/completeCondition&gt;?
+ *   &lt;onComplete expression="xpath" [sequence="sequence-ref"]&gt;
+ *     (mediator +)?
+ *   &lt;/onComplete&gt;
  * &lt;/aggregate&gt;
+ * </pre>
  */
 public class AggregateMediatorFactory extends AbstractMediatorFactory {
 
     private static final Log log = LogFactory.getLog(AggregateMediatorFactory.class);
 
     private static final QName AGGREGATE_Q = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "aggregate");
-    private static final QName CORELATE_ON_Q = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "corelateOn");
+    private static final QName CORELATE_ON_Q = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "correlateOn");
     private static final QName COMPLETE_CONDITION_Q
             = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "completeCondition");
     private static final QName MESSAGE_COUNT_Q
             = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "messageCount");
     private static final QName ON_COMPLETE_Q = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "onComplete");
-    private static final QName INVALIDATE_Q = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "invalidate");
-
-    private static final QName TIME_TO_LIVE_Q = new QName(XMLConfigConstants.NULL_NAMESPACE, "timeToLive");
     private static final QName EXPRESSION_Q = new QName(XMLConfigConstants.NULL_NAMESPACE, "expression");
     private static final QName TIMEOUT_Q = new QName(XMLConfigConstants.NULL_NAMESPACE, "timeout");
     private static final QName MIN_Q = new QName(XMLConfigConstants.NULL_NAMESPACE, "min");
@@ -71,11 +66,6 @@
 
         AggregateMediator mediator = new AggregateMediator();
         processTraceState(mediator, elem);
-        // todo: need to fix
-        OMAttribute timeToLive = elem.getAttribute(TIME_TO_LIVE_Q);
-        if (timeToLive != null) {
-            mediator.setTimeToInvalidate(Long.parseLong(timeToLive.getAttributeValue()) * 1000);
-        }
 
         OMElement corelateOn = elem.getFirstChildWithName(CORELATE_ON_Q);
         if (corelateOn != null) {
@@ -84,7 +74,7 @@
                 try {
                     AXIOMXPath xp = new AXIOMXPath(corelateExpr.getAttributeValue());
                     OMElementUtils.addNameSpaces(xp, corelateOn, log);
-                    mediator.setCorelateExpression(xp);
+                    mediator.setCorrelateExpression(xp);
                 } catch (JaxenException e) {
                     handleException("Unable to load the corelate XPATH expression", e);
                 }
@@ -95,7 +85,7 @@
         if (completeCond != null) {
             OMAttribute completeTimeout = completeCond.getAttribute(TIMEOUT_Q);
             if (completeTimeout != null) {
-                mediator.setCompleteTimeout(
+                mediator.setCompletionTimeoutMillis(
                         Long.parseLong(completeTimeout.getAttributeValue()) * 1000);
             }
 
@@ -110,24 +100,6 @@
                 if (max != null) {
                     mediator.setMaxMessagesToComplete(Integer.parseInt(max.getAttributeValue()));
                 }
-            }
-        }
-
-        OMElement invalidate = elem.getFirstChildWithName(INVALIDATE_Q);
-        if (invalidate != null) {
-            OMAttribute sequenceRef = invalidate.getAttribute(SEQUENCE_Q);
-            if (sequenceRef != null) {
-                mediator.setInvalidMsgSequenceRef(sequenceRef.getAttributeValue());
-            } else if (invalidate.getFirstElement() != null) {
-                mediator.setInvalidMsgSequence(
-                        (new SequenceMediatorFactory()).createAnonymousSequence(invalidate));
-            }
-
-            OMAttribute timeout = invalidate.getAttribute(TIMEOUT_Q);
-            if (timeout != null) {
-                mediator.setInvlidateToDestroyTime(Long.parseLong(timeout.getAttributeValue()));
-            } else {
-                mediator.setInvlidateToDestroyTime(300);
             }
         }
 

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AggregateMediatorSerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AggregateMediatorSerializer.java?rev=615763&r1=615762&r2=615763&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AggregateMediatorSerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AggregateMediatorSerializer.java Mon Jan 28 00:43:56 2008
@@ -20,27 +20,23 @@
 package org.apache.synapse.config.xml;
 
 import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMAttribute;
 import org.apache.synapse.Mediator;
-import org.apache.synapse.SynapseException;
 import org.apache.synapse.mediators.eip.aggregator.AggregateMediator;
-import org.apache.synapse.mediators.ext.ClassMediator;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 /**
+ * <pre>
  * &lt;aggregate&gt;
- *  &lt;corelateOn expression="XPATH-expression"/&gt;
- *  &lt;completeCondition timeout="time-in-seconds"&gt;
- *   &lt;messageCount min="int-min" max="int-max"/&gt;
- *  &lt;/completeCondition&gt;
- *  &lt;onComplete expression="XPATH-expression" sequence="sequence-ref"&gt;
- *   (mediator +)?
- *  &lt;/onComplete&gt;
- *  &lt;invalidate sequence="sequence-ref" timeout="time-in-seconds"&gt;
- *   (mediator +)?
- *  &lt;/invalidate&gt;
+ *   &lt;correlateOn expression="xpath"/&gt;?
+ *   &lt;completeCondition [timeout="time-in-seconds"]&gt;
+ *     &lt;messageCount min="int-min" max="int-max"/&gt;?
+ *   &lt;/completeCondition&gt;?
+ *   &lt;onComplete expression="xpath" [sequence="sequence-ref"]&gt;
+ *     (mediator +)?
+ *   &lt;/onComplete&gt;
  * &lt;/aggregate&gt;
+ * </pre>
  */
 public class AggregateMediatorSerializer extends AbstractMediatorSerializer {
 
@@ -55,16 +51,16 @@
         OMElement aggregator = fac.createOMElement("aggregate", synNS);
         saveTracingState(aggregator, mediator);
 
-        if (mediator.getCorelateExpression() != null) {
-            OMElement corelateOn = fac.createOMElement("corelateOn", synNS);
-            corelateOn.addAttribute("expression", mediator.getCorelateExpression().toString(), nullNS);
-            super.serializeNamespaces(corelateOn, mediator.getCorelateExpression());
+        if (mediator.getCorrelateExpression() != null) {
+            OMElement corelateOn = fac.createOMElement("correlateOn", synNS);
+            corelateOn.addAttribute("expression", mediator.getCorrelateExpression().toString(), nullNS);
+            super.serializeNamespaces(corelateOn, mediator.getCorrelateExpression());
             aggregator.addChild(corelateOn);
         }
 
         OMElement completeCond = fac.createOMElement("completeCondition", synNS);
-        if (mediator.getCompleteTimeout() != 0) {
-            completeCond.addAttribute("timeout", Long.toString(mediator.getCompleteTimeout()), nullNS);
+        if (mediator.getCompletionTimeoutMillis() != 0) {
+            completeCond.addAttribute("timeout", Long.toString(mediator.getCompletionTimeoutMillis() / 1000), nullNS);
         }
         OMElement messageCount = fac.createOMElement("messageCount", synNS);
         if (mediator.getMinMessagesToComplete() != 0) {
@@ -88,16 +84,6 @@
                     onCompleteElem, mediator.getOnCompleteSequence().getList());
         }
         aggregator.addChild(onCompleteElem);
-
-        OMElement invalidateElem = fac.createOMElement("invalidate", synNS);
-        invalidateElem.addAttribute("timeout", Long.toString(mediator.getInvlidateToDestroyTime()), nullNS);
-        if (mediator.getInvalidMsgSequenceRef() != null) {
-            invalidateElem.addAttribute("sequence", mediator.getInvalidMsgSequenceRef(), nullNS);
-        } else if (mediator.getInvalidMsgSequence() != null) {
-            new SequenceMediatorSerializer().serializeChildren(
-                    invalidateElem, mediator.getInvalidMsgSequence().getList());
-        }
-        aggregator.addChild(invalidateElem);
 
         if (parent != null) {
             parent.addChild(aggregator);

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/CacheMediatorFactory.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/CacheMediatorFactory.java?rev=615763&r1=615762&r2=615763&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/CacheMediatorFactory.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/CacheMediatorFactory.java Mon Jan 28 00:43:56 2008
@@ -32,13 +32,15 @@
 /**
  * Creates an instance of a Cache mediator using XML configuration specified
  *
- * &lt;cache (id="string")? scope="string" collector=(true | false)
- *      hashGenerator="class" timeout="seconds" maxMessageSize="in-bytes"&gt;
- *  &lt;onCacheHit (sequence="key")?&gt;
- *   (mediator)+
- *  &lt;/onCacheHit&gt;
- *  &lt;implementation type=(memory | disk) maxSize="int"/&gt;
+ * <pre>
+ * &lt;cache id="string" [hashGenerator="class"] [timeout="seconds"]
+ *      [scope=(per-host | per-mediator)] collector=(true | false) [maxMessageSize="in-bytes"]&gt;
+ *   &lt;onCacheHit [sequence="key"]&gt;
+ *     (mediator)+
+ *   &lt;/onCacheHit&gt;?
+ *   &lt;implementation type=(memory | disk) maxSize="int"/&gt;
  * &lt;/cache&gt;
+ * </pre>
  */
 public class CacheMediatorFactory extends AbstractMediatorFactory {
 

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/CacheMediatorSerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/CacheMediatorSerializer.java?rev=615763&r1=615762&r2=615763&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/CacheMediatorSerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/CacheMediatorSerializer.java Mon Jan 28 00:43:56 2008
@@ -26,13 +26,15 @@
 /**
  * Serializes the Cache mediator to the XML configuration specified
  * <p/>
- * &lt;cache (id="string")? scope="string" collector=(true | false)
- *      hashGenerator="class" timeout="seconds" maxMessageSize="in-bytes"&gt;
- *  &lt;onCacheHit (sequence="key")?&gt;
- *   (mediator)+
- *  &lt;/onCacheHit&gt;
- *  &lt;implementation type=(memory | disk) maxSize="int"/&gt;
+ * <pre>
+ * &lt;cache id="string" [hashGenerator="class"] [timeout="seconds"]
+ *      [scope=(per-host | per-mediator)] collector=(true | false) [maxMessageSize="in-bytes"]&gt;
+ *   &lt;onCacheHit [sequence="key"]&gt;
+ *     (mediator)+
+ *   &lt;/onCacheHit&gt;?
+ *   &lt;implementation type=(memory | disk) maxSize="int"/&gt;
  * &lt;/cache&gt;
+ * </pre>
  */
 public class CacheMediatorSerializer extends AbstractMediatorSerializer {
 

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/CloneMediatorFactory.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/CloneMediatorFactory.java?rev=615763&r1=615762&r2=615763&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/CloneMediatorFactory.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/CloneMediatorFactory.java Mon Jan 28 00:43:56 2008
@@ -32,13 +32,17 @@
  * different message contexts and mediated using the specified targets
  *
  * <pre>
- *  &lt;clone continueParent=(true | false)&gt;
- *   &lt;target to="TO address" [soapAction="urn:Action"] sequence="sequence ref"
- *                                                         endpoint="endpoint ref"&gt;
- *    &lt;sequence&gt; (mediator +) &lt;/sequence&gt;
- *    &lt;endpoint&gt; endpoint &lt;/endpoint&gt;
- *   &lt;/target&gt;
- *  &lt;/clone&gt;
+ * &lt;clone [continueParent=(true | false)]&gt;
+ *   &lt;target [to="uri"] [soapAction="qname"] [sequence="sequence_ref"]
+ *          [endpoint="endpoint_ref"]&gt;
+ *     &lt;sequence&gt;
+ *       (mediator)+
+ *     &lt;/sequence&gt;?
+ *     &lt;endpoint&gt;
+ *       endpoint
+ *     &lt;/endpoint&gt;?
+ *   &lt;/target&gt;+
+ * &lt;/clone&gt;
  * </pre>
  */
 public class CloneMediatorFactory extends AbstractMediatorFactory {

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/CloneMediatorSerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/CloneMediatorSerializer.java?rev=615763&r1=615762&r2=615763&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/CloneMediatorSerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/CloneMediatorSerializer.java Mon Jan 28 00:43:56 2008
@@ -30,13 +30,17 @@
  * This will serialize the CloneMediator to the xml configuration as specified bellow
  *
  * <pre>
- *  &lt;clone continueParent=(true | false)&gt;
- *   &lt;target to="TO address" [soapAction="urn:Action"] sequence="sequence ref"
- *                                                         endpoint="endpoint ref"&gt;
- *    &lt;sequence&gt; (mediator +) &lt;/sequence&gt;
- *    &lt;endpoint&gt; endpoint &lt;/endpoint&gt;
- *   &lt;/target&gt;
- *  &lt;/iterate&gt;
+ *  &lt;clone [continueParent=(true | false)]&gt;
+ *   &lt;target [to="uri"] [soapAction="qname"] [sequence="sequence_ref"]
+ *          [endpoint="endpoint_ref"]&gt;
+ *     &lt;sequence&gt;
+ *       (mediator)+
+ *     &lt;/sequence&gt;?
+ *     &lt;endpoint&gt;
+ *       endpoint
+ *     &lt;/endpoint&gt;?
+ *   &lt;/target&gt;+
+ * &lt;/clone&gt;
  * </pre>
  */
 public class CloneMediatorSerializer extends AbstractMediatorSerializer {

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DBLookupMediatorFactory.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DBLookupMediatorFactory.java?rev=615763&r1=615762&r2=615763&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DBLookupMediatorFactory.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DBLookupMediatorFactory.java Mon Jan 28 00:43:56 2008
@@ -27,30 +27,32 @@
 import javax.xml.namespace.QName;
 
 /**
- * <dblookup>
- *   <connection>
- *     <pool>
+ * <pre>
+ * &lt;dblookup&gt;
+ *   &lt;connection&gt;
+ *     &lt;pool&gt;
  *      (
- *       <driver/>
- *       <url/>
- *       <user/>
- *       <password/>
+ *       &lt;driver/&gt;
+ *       &lt;url/&gt;
+ *       &lt;user/&gt;
+ *       &lt;password/&gt;
  *     |
- *       <dsName/>
- *       <icClass/>
- *       <url/>
- *       <user/>
- *       <password/>
+ *       &lt;dsName/&gt;
+ *       &lt;icClass/&gt;
+ *       &lt;url/&gt;
+ *       &lt;user/&gt;
+ *       &lt;password/&gt;
  *     )
- *       <property name="name" value="value"/>*
- *     </pool>
- *   </connection>
- *   <statement>
- *     <sql>select something from table where something_else = ?</sql>
- *     <parameter [value="" | expression=""] type="int|string"/>*
- *     <result name="string" column="int|string"/>*
- *   </statement>+
- * </dblookup>
+ *       &lt;property name="name" value="value"/&gt;*
+ *     &lt;/pool&gt;
+ *   &lt;/connection&gt;
+ *   &lt;statement&gt;
+ *     &lt;sql&gt;select something from table where something_else = ?&lt;/sql&gt;
+ *     &lt;parameter [value="" | expression=""] type="int|string"/&gt;*
+ *     &lt;result name="string" column="int|string"/&gt;*
+ *   &lt;/statement&gt;+
+ * &lt;/dblookup&gt;
+ * </pre>
  */
 public class DBLookupMediatorFactory extends AbstractDBMediatorFactory {
 

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DBLookupMediatorSerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DBLookupMediatorSerializer.java?rev=615763&r1=615762&r2=615763&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DBLookupMediatorSerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DBLookupMediatorSerializer.java Mon Jan 28 00:43:56 2008
@@ -24,20 +24,32 @@
 import org.apache.synapse.mediators.db.DBLookupMediator;
 
 /**
- * <dblookup>
- *   <connection>
- *     <jdbc>
- *       <driver/>
- *       <url/>
- *       <user/>
- *       <password/>
- *     </jdbc>
- *   </connection>
- *   <query setAttribute="queue_name">
- *     <sql>select queue from table where device_id = ?</sql>
- *     <parameter [property="" | xpath=""] type="int|string"/>*
- *   </query>+
- * </dblookup>
+ * <pre>
+ * &lt;dblookup&gt;
+ *   &lt;connection&gt;
+ *     &lt;pool&gt;
+ *      (
+ *       &lt;driver/&gt;
+ *       &lt;url/&gt;
+ *       &lt;user/&gt;
+ *       &lt;password/&gt;
+ *     |
+ *       &lt;dsName/&gt;
+ *       &lt;icClass/&gt;
+ *       &lt;url/&gt;
+ *       &lt;user/&gt;
+ *       &lt;password/&gt;
+ *     )
+ *       &lt;property name="name" value="value"/&gt;*
+ *     &lt;/pool&gt;
+ *   &lt;/connection&gt;
+ *   &lt;statement&gt;
+ *     &lt;sql&gt;select something from table where something_else = ?&lt;/sql&gt;
+ *     &lt;parameter [value="" | expression=""] type="int|string"/&gt;*
+ *     &lt;result name="string" column="int|string"/&gt;*
+ *   &lt;/statement&gt;+
+ * &lt;/dblookup&gt;
+ * </pre>
  */
 public class DBLookupMediatorSerializer extends AbstractDBMediatorSerializer {
 

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DBReportMediatorFactory.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DBReportMediatorFactory.java?rev=615763&r1=615762&r2=615763&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DBReportMediatorFactory.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DBReportMediatorFactory.java Mon Jan 28 00:43:56 2008
@@ -27,29 +27,31 @@
 import javax.xml.namespace.QName;
 
 /**
- * <dbreport>
- *   <connection>
- *     <pool>
- *       (
- *       <driver/>
- *       <url/>
- *       <user/>
- *       <password/>
+ * <pre>
+ * &lt;dbreport&gt;
+ *   &lt;connection&gt;
+ *     &lt;pool&gt;
+ *      (
+ *       &lt;driver/&gt;
+ *       &lt;url/&gt;
+ *       &lt;user/&gt;
+ *       &lt;password/&gt;
  *     |
- *       <dsName/>
- *       <icClass/>
- *       <url/>
- *       <user/>
- *       <password/>
+ *       &lt;dsName/&gt;
+ *       &lt;icClass/&gt;
+ *       &lt;url/&gt;
+ *       &lt;user/&gt;
+ *       &lt;password/&gt;
  *     )
- *       <property name="name" value="value"/>*
- *     </pool>
- *   </connection>
- *   <statement>
- *     <sql>insert into table values (?, ?, ..)</sql>
- *     <parameter [value="" | expression=""] type="int|string"/>*
- *   </statement>+
- * </dbreport>
+ *       &lt;property name="name" value="value"/&gt;*
+ *     &lt;/pool&gt;
+ *   &lt;/connection&gt;
+ *   &lt;statement&gt;
+ *     &lt;sql&gt;insert into something values(?, ?, ?, ?)&lt;/sql&gt;
+ *     &lt;parameter [value="" | expression=""] type="int|string"/&gt;*
+ *    &lt;/statement&gt;+
+ * &lt;/dblreport&gt;
+ * </pre>
  */
 public class DBReportMediatorFactory extends AbstractDBMediatorFactory {
 

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DBReportMediatorSerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DBReportMediatorSerializer.java?rev=615763&r1=615762&r2=615763&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DBReportMediatorSerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DBReportMediatorSerializer.java Mon Jan 28 00:43:56 2008
@@ -24,20 +24,31 @@
 import org.apache.synapse.mediators.db.DBReportMediator;
 
 /**
- * <dbreport>
- *   <connection>
- *     <jdbc>
- *       <driver/>
- *       <url/>
- *       <user/>
- *       <password/>
- *     </jdbc>
- *   </connection>
- *   <insert>
- *     <sql>insert into table values (?, ?, ..)</sql>
- *     <parameter [property="" | xpath=""] type="int|string"/>*
- *   </insert>+
- * </dbreport>
+ * <pre>
+ * &lt;dbreport&gt;
+ *   &lt;connection&gt;
+ *     &lt;pool&gt;
+ *      (
+ *       &lt;driver/&gt;
+ *       &lt;url/&gt;
+ *       &lt;user/&gt;
+ *       &lt;password/&gt;
+ *     |
+ *       &lt;dsName/&gt;
+ *       &lt;icClass/&gt;
+ *       &lt;url/&gt;
+ *       &lt;user/&gt;
+ *       &lt;password/&gt;
+ *     )
+ *       &lt;property name="name" value="value"/&gt;*
+ *     &lt;/pool&gt;
+ *   &lt;/connection&gt;
+ *   &lt;statement&gt;
+ *     &lt;sql&gt;insert into something values(?, ?, ?, ?)&lt;/sql&gt;
+ *     &lt;parameter [value="" | expression=""] type="int|string"/&gt;*
+ *    &lt;/statement&gt;+
+ * &lt;/dblreport&gt;
+ * </pre>
  */
 public class DBReportMediatorSerializer extends AbstractDBMediatorSerializer {
 

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/IterateMediatorFactory.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/IterateMediatorFactory.java?rev=615763&r1=615762&r2=615763&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/IterateMediatorFactory.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/IterateMediatorFactory.java Mon Jan 28 00:43:56 2008
@@ -36,14 +36,18 @@
  * one part of the elements described in the XPATH expression.
  * <p/>
  * <pre>
- *  &lt;iterate continueParent=(true | false) preservePayload=(true | false)
- *                          (attachPath="XPATH expression")? expression="XPATH expression"&gt;
- *   &lt;target to="TO address" [soapAction="urn:Action"] sequence="sequence ref"
- *                                                         endpoint="endpoint ref"&gt;
- *    &lt;sequence&gt; (mediator +) &lt;/sequence&gt;
- *    &lt;endpoint&gt; endpoint &lt;/endpoint&gt;
- *   &lt;/target&gt;
- *  &lt;/iterate&gt;
+ * &lt;iterate [continueParent=(true | false)] [preservePayload=(true | false)]
+ *          (attachPath="xpath")? expression="xpath"&gt;
+ *   &lt;target [to="uri"] [soapAction="qname"] [sequence="sequence_ref"]
+ *          [endpoint="endpoint_ref"]&gt;
+ *     &lt;sequence&gt;
+ *       (mediator)+
+ *     &lt;/sequence&gt;?
+ *     &lt;endpoint&gt;
+ *       endpoint
+ *     &lt;/endpoint&gt;?
+ *   &lt;/target&gt;+
+ * &lt;/iterate&gt;
  * </pre>
  */
 public class IterateMediatorFactory extends AbstractMediatorFactory {

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/IterateMediatorSerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/IterateMediatorSerializer.java?rev=615763&r1=615762&r2=615763&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/IterateMediatorSerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/IterateMediatorSerializer.java Mon Jan 28 00:43:56 2008
@@ -28,13 +28,18 @@
  * IterateMediator instance to the following xml configuration
  *
  * <pre>
- *  &lt;iterate continueParent=(true | false) expression="XPATH expression"&gt;
- *   &lt;target to="TO address" [soapAction="urn:Action"] sequence="sequence ref"
- *                                                         endpoint="endpoint ref"&gt;
- *    &lt;sequence&gt; (mediator +) &lt;/sequence&gt;
- *    &lt;endpoint&gt; endpoint &lt;/endpoint&gt;
- *   &lt;/target&gt;
- *  &lt;/iterate&gt;
+ * &lt;iterate [continueParent=(true | false)] [preservePayload=(true | false)]
+ *          (attachPath="xpath")? expression="xpath"&gt;
+ *   &lt;target [to="uri"] [soapAction="qname"] [sequence="sequence_ref"]
+ *          [endpoint="endpoint_ref"]&gt;
+ *     &lt;sequence&gt;
+ *       (mediator)+
+ *     &lt;/sequence&gt;?
+ *     &lt;endpoint&gt;
+ *       endpoint
+ *     &lt;/endpoint&gt;?
+ *   &lt;/target&gt;+
+ * &lt;/iterate&gt;
  * </pre>
  */
 public class IterateMediatorSerializer extends AbstractMediatorSerializer {

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/TargetFactory.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/TargetFactory.java?rev=615763&r1=615762&r2=615763&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/TargetFactory.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/TargetFactory.java Mon Jan 28 00:43:56 2008
@@ -64,7 +64,7 @@
         Target target = new Target();
         OMAttribute toAttr = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "to"));
         if (toAttr != null && toAttr.getAttributeValue() != null) {
-            target.setTo(toAttr.getAttributeValue());
+            target.setToAddress(toAttr.getAttributeValue());
         }
 
         OMAttribute soapAction = elem.getAttribute(

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/TargetSerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/TargetSerializer.java?rev=615763&r1=615762&r2=615763&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/TargetSerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/TargetSerializer.java Mon Jan 28 00:43:56 2008
@@ -61,8 +61,8 @@
     public static OMElement serializeTarget(Target target) {
 
         OMElement targetElem = fac.createOMElement("target", synNS);
-        if (target.getTo() != null) {
-            targetElem.addAttribute("to", target.getTo(), nullNS);
+        if (target.getToAddress() != null) {
+            targetElem.addAttribute("to", target.getToAddress(), nullNS);
         }
 
         if (target.getSoapAction() != null) {

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/XSLTMediatorFactory.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/XSLTMediatorFactory.java?rev=615763&r1=615762&r2=615763&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/XSLTMediatorFactory.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/XSLTMediatorFactory.java Mon Jan 28 00:43:56 2008
@@ -39,6 +39,7 @@
  * <pre>
  * &lt;xslt key="property-key" [source="xpath"] [target="string"]&gt;
  *   &lt;property name="string" (value="literal" | expression="xpath")/&gt;*
+ *   &lt;feature name="string" value="true| false" /&gt;*
  * &lt;/transform&gt;
  * </pre>
  */

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/XSLTMediatorSerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/XSLTMediatorSerializer.java?rev=615763&r1=615762&r2=615763&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/XSLTMediatorSerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/XSLTMediatorSerializer.java Mon Jan 28 00:43:56 2008
@@ -34,6 +34,7 @@
  * <pre>
  * &lt;xslt key="property-key" [source="xpath"] [target="string"]&gt;
  *   &lt;property name="string" (value="literal" | expression="xpath")/&gt;*
+ *   &lt;feature name="string" value="true| false" /&gt;*
  * &lt;/transform&gt;
  * </pre>
  */

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/endpoints/WSDLEndpointFactory.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/endpoints/WSDLEndpointFactory.java?rev=615763&r1=615762&r2=615763&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/endpoints/WSDLEndpointFactory.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/endpoints/WSDLEndpointFactory.java Mon Jan 28 00:43:56 2008
@@ -19,23 +19,24 @@
 
 package org.apache.synapse.config.xml.endpoints;
 
-import org.apache.synapse.endpoints.Endpoint;
-import org.apache.synapse.endpoints.WSDLEndpoint;
-import org.apache.synapse.SynapseConstants;
-import org.apache.synapse.SynapseException;
-import org.apache.synapse.endpoints.utils.EndpointDefinition;
-import org.apache.synapse.config.xml.endpoints.utils.WSDL11EndpointBuilder;
-import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMAttribute;
-import org.apache.axiom.om.OMNode;
+import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.OMNode;
+import org.apache.axis2.description.WSDL2Constants;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.axis2.description.WSDL2Constants;
+import org.apache.synapse.SynapseConstants;
+import org.apache.synapse.SynapseException;
 import org.apache.synapse.config.SynapseConfigUtils;
+import org.apache.synapse.config.xml.endpoints.utils.WSDL11EndpointBuilder;
+import org.apache.synapse.endpoints.Endpoint;
+import org.apache.synapse.endpoints.WSDLEndpoint;
+import org.apache.synapse.endpoints.utils.EndpointDefinition;
 
 import javax.xml.namespace.QName;
 import java.net.URL;
+import java.io.File;
 
 /**
  * Creates an WSDL based endpoint from a XML configuration.
@@ -142,7 +143,7 @@
                             String nsUri = wsdlOM.getNamespace().getNamespaceURI();
                             if (org.apache.axis2.namespace.Constants.NS_URI_WSDL11.equals(nsUri)) {
                                 endpoint = new WSDL11EndpointBuilder().
-                                    createEndpointDefinitionFromWSDL(wsdlOM, serviceName, portName);
+                                    createEndpointDefinitionFromWSDL(wsdlURI.trim(),wsdlOM, serviceName, portName);
 
                             } else if (WSDL2Constants.WSDL_NAMESPACE.equals(nsUri)) {
                                 //endpoint = new WSDL20EndpointBuilder().
@@ -163,9 +164,16 @@
                     (new QName(org.apache.axis2.namespace.Constants.NS_URI_WSDL11, "definitions"));
             if (endpoint == null && definitionElement != null) {
                 wsdlEndpoint.setWsdlDoc(definitionElement);
-
+                String resolveRoot = System.getProperty(SynapseConstants.RESOLVE_ROOT);
+                String baseUri = "file:./";
+                if (resolveRoot != null) {
+                    baseUri = resolveRoot.trim();
+                }
+                if(!baseUri.endsWith(File.separator)){
+                    baseUri = baseUri + File.separator;
+                }
                 endpoint = new WSDL11EndpointBuilder().
-                        createEndpointDefinitionFromWSDL(definitionElement, serviceName, portName);
+                    createEndpointDefinitionFromWSDL(baseUri, definitionElement, serviceName, portName);
             }
 
             // check if a wsdl 2.0 document is supplied inline

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/endpoints/utils/WSDL11EndpointBuilder.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/endpoints/utils/WSDL11EndpointBuilder.java?rev=615763&r1=615762&r2=615763&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/endpoints/utils/WSDL11EndpointBuilder.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/endpoints/utils/WSDL11EndpointBuilder.java Mon Jan 28 00:43:56 2008
@@ -19,28 +19,35 @@
 
 package org.apache.synapse.config.xml.endpoints.utils;
 
-import org.apache.synapse.endpoints.utils.EndpointDefinition;
-import org.apache.synapse.SynapseConstants;
-import org.apache.synapse.SynapseException;
 import org.apache.axiom.om.OMElement;
+import org.apache.axis2.util.XMLUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.synapse.SynapseConstants;
+import org.apache.synapse.SynapseException;
+import org.apache.synapse.core.axis2.CustomWSDLLocator;
+import org.apache.synapse.endpoints.utils.EndpointDefinition;
+import org.w3c.dom.Document;
 import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
 
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.WSDLException;
 import javax.wsdl.Definition;
-import javax.wsdl.Service;
 import javax.wsdl.Port;
+import javax.wsdl.Service;
+import javax.wsdl.WSDLException;
 import javax.wsdl.extensions.soap.SOAPAddress;
 import javax.wsdl.extensions.soap12.SOAP12Address;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLLocator;
 import javax.wsdl.xml.WSDLReader;
 import javax.xml.namespace.QName;
+import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.stream.XMLStreamException;
-import java.util.List;
-import java.io.ByteArrayOutputStream;
 import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
 import java.io.InputStream;
+import java.util.List;
 
 /**
  * Builds the EndpointDefinition containing the details for an epr using a WSDL 1.1 document.
@@ -53,6 +60,7 @@
      * Creates an EndpointDefinition for WSDL endpoint from an inline WSDL supplied in the WSDL
      * endpoint configuration.
      *
+     * @param baseUri base uri of the wsdl
      * @param wsdl OMElement representing the inline WSDL
      * @param service Service of the endpoint
      * @param port Port of the endpoint
@@ -60,19 +68,30 @@
      * @return EndpointDefinition containing the information retrieved from the WSDL
      */
     public EndpointDefinition createEndpointDefinitionFromWSDL
-            (OMElement wsdl, String service, String port) {
+            (String baseUri, OMElement wsdl, String service, String port) {
 
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         try {
             wsdl.serialize(baos);
             InputStream in = new ByteArrayInputStream(baos.toByteArray());
             InputSource inputSource = new InputSource(in);
-            WSDLFactory fac = WSDLFactory.newInstance();
-            WSDLReader reader = fac.newWSDLReader();
-            Definition definition = reader.readWSDL(null, inputSource);
-
-            return createEndpointDefinitionFromWSDL(definition, service, port);
-
+            WSDLLocator wsdlLocator = new CustomWSDLLocator(inputSource,baseUri);
+            Document doc = null;
+            try {
+                doc = XMLUtils.newDocument(inputSource);
+            } catch (ParserConfigurationException e) {
+                handleException("Parser Configuration Error", e);
+            } catch (SAXException e) {
+                handleException("Parser SAX Error", e);
+            } catch (IOException e) {
+                handleException(WSDLException.INVALID_WSDL+ "IO Error",e);
+            }
+            if (doc != null) {
+                WSDLFactory fac = WSDLFactory.newInstance();
+                WSDLReader reader = fac.newWSDLReader();
+                Definition definition = reader.readWSDL(wsdlLocator, doc.getDocumentElement());
+                return createEndpointDefinitionFromWSDL(definition, service, port);
+            }
         } catch (XMLStreamException e) {
             handleException("Error retrieving the WSDL definition from the inline WSDL.");
         } catch (WSDLException e) {
@@ -91,7 +110,7 @@
      *
      * @return EndpointDefinition containing the information retrieved from the WSDL
      */
-    public EndpointDefinition createEndpointDefinitionFromWSDL
+    private EndpointDefinition createEndpointDefinitionFromWSDL
             (String wsdlURI, String service, String port) {
 
         try {
@@ -170,5 +189,10 @@
     private static void handleException(String msg) {
         log.error(msg);
         throw new SynapseException(msg);
+    }
+
+    private static void handleException(String msg, Exception e) {
+        log.error(msg, e);
+        throw new SynapseException(msg, e);
     }
 }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/ProxyService.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/ProxyService.java?rev=615763&r1=615762&r2=615763&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/ProxyService.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/ProxyService.java Mon Jan 28 00:43:56 2008
@@ -19,8 +19,8 @@
 
 package org.apache.synapse.core.axis2;
 
-import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMNamespace;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.description.*;
 import org.apache.axis2.engine.AxisConfiguration;
@@ -30,20 +30,23 @@
 import org.apache.neethi.PolicyEngine;
 import org.apache.synapse.SynapseConstants;
 import org.apache.synapse.SynapseException;
-import org.apache.synapse.mediators.base.SequenceMediator;
-import org.apache.synapse.endpoints.Endpoint;
-import org.apache.synapse.config.SynapseConfiguration;
 import org.apache.synapse.config.SynapseConfigUtils;
+import org.apache.synapse.config.SynapseConfiguration;
+import org.apache.synapse.core.SynapseEnvironment;
+import org.apache.synapse.endpoints.Endpoint;
+import org.apache.synapse.mediators.base.SequenceMediator;
 import org.xml.sax.InputSource;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.ByteArrayInputStream;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
 import java.util.*;
-import java.net.*;
 
 /**
  * <proxy-service name="string" [transports="(http |https |jms )+|all"] [trace="enable|disable"]>
@@ -259,7 +262,7 @@
                         } else if (org.apache.axis2.namespace.Constants.NS_URI_WSDL11.
                                 equals(wsdlNamespace.getNamespaceURI())) {
                             wsdlToAxisServiceBuilder =
-                                    new WSDL11ToAxisServiceBuilder(wsdlInputStream, null, null);
+                                    new WSDL11ToAxisServiceBuilder(wsdlInputStream);
                             isWSDL11 = true;
                         } else {
                             handleException("Unknown WSDL format.. not WSDL 1.1 or WSDL 2.0");
@@ -273,24 +276,37 @@
                         wsdlToAxisServiceBuilder.setBaseUri(
                                 wsdlURI != null ? wsdlURI.toString() : "");
 
-                        if (resourceMap != null) {
+                        if (trace()) {
+                            trace.info("Setting up custom resolvers");
+                        }
+                        // Set up the URIResolver
 
-                            if (trace()) {
-                                trace.info("Setting up custom resolvers");
-                            }
-                            // Set up the URIResolver
+                        if (resourceMap != null) {
+                            // if the resource map is available use it
                             wsdlToAxisServiceBuilder.setCustomResolver(
-                                new ResourceMapURIResolver(resourceMap, synCfg));
+                                new CustomURIResolver(resourceMap, synCfg));
                             // Axis 2 also needs a WSDLLocator for WSDL 1.1 documents
                             if (wsdlToAxisServiceBuilder instanceof WSDL11ToAxisServiceBuilder) {
                                 ((WSDL11ToAxisServiceBuilder)
                                     wsdlToAxisServiceBuilder).setCustomWSLD4JResolver(
-                                    new ResourceMapWSDLLocator(new InputSource(wsdlInputStream),
+                                    new CustomWSDLLocator(new InputSource(wsdlInputStream),
                                                           wsdlURI != null ? wsdlURI.toString() : "",
                                                           resourceMap, synCfg));
                             }
+                        } else {
+                            //if the resource map isn't available ,
+                            //then each import URIs will be resolved using base URI 
+                            wsdlToAxisServiceBuilder.setCustomResolver(
+                                new CustomURIResolver());
+                            // Axis 2 also needs a WSDLLocator for WSDL 1.1 documents
+                            if (wsdlToAxisServiceBuilder instanceof WSDL11ToAxisServiceBuilder) {
+                                ((WSDL11ToAxisServiceBuilder)
+                                    wsdlToAxisServiceBuilder).setCustomWSLD4JResolver(
+                                    new CustomWSDLLocator(new InputSource(wsdlInputStream),
+                                                          wsdlURI != null ? wsdlURI.toString() : ""));
+                            }
                         }
-                        
+
                         if (trace()) {
                             trace.info("Populating Axis2 service using WSDL");
                             if (trace.isTraceEnabled()) {
@@ -298,14 +314,6 @@
                             }
                         }
                         proxyService = wsdlToAxisServiceBuilder.populateService();
-                        List schemaList = proxyService.getSchema();
-                        if (schemaList != null && schemaList.size() > 0) {
-                            // just pick the first schema's target namespace as Axis2's
-                            // HTTPTransportUtils code already contains a bug where it uses the
-                            // services' schema target NS for each operation
-                            proxyService.setSchemaTargetNamespace(
-                                proxyService.getSchema(0).getTargetNamespace());
-                        }
                         proxyService.setWsdlFound(true);
 
                         if (isWSDL11) {
@@ -482,6 +490,24 @@
     public void start(SynapseConfiguration synCfg) {
         AxisConfiguration axisConfig = synCfg.getAxisConfiguration();
         if (axisConfig != null) {
+            
+            Parameter param = axisConfig.getParameter(SynapseConstants.SYNAPSE_ENV);
+            if (param != null && param.getValue() instanceof SynapseEnvironment)  {
+                SynapseEnvironment env = (SynapseEnvironment) param.getValue();
+                if (targetInLineInSequence != null) {
+                    targetInLineInSequence.init(env);
+                }
+                if (targetInLineOutSequence != null) {
+                    targetInLineOutSequence.init(env);
+                }
+                if (targetInLineFaultSequence != null) {
+                    targetInLineFaultSequence.init(env);
+                }
+            } else {
+                auditWarn("Unable to find the SynapseEnvironment. " +
+                    "Components of the proxy service may not be initialized");
+            }
+            
             axisConfig.getServiceForActivation(this.getName()).setActive(true);
             this.setRunning(true);
             auditInfo("Started the proxy service : " + name);
@@ -498,6 +524,17 @@
     public void stop(SynapseConfiguration synCfg) {
         AxisConfiguration axisConfig = synCfg.getAxisConfiguration();
         if (axisConfig != null) {
+
+            if (targetInLineInSequence != null) {
+                targetInLineInSequence.destroy();
+            }
+            if (targetInLineOutSequence != null) {
+                targetInLineOutSequence.destroy();
+            }
+            if (targetInLineFaultSequence != null) {
+                targetInLineFaultSequence.destroy();
+            }
+
             try {
                 AxisService as = axisConfig.getService(this.getName());
                 if (as != null) {

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/ResourceMap.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/ResourceMap.java?rev=615763&r1=615762&r2=615763&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/ResourceMap.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/ResourceMap.java Mon Jan 28 00:43:56 2008
@@ -19,14 +19,6 @@
 
 package org.apache.synapse.core.axis2;
 
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-import javax.xml.stream.XMLStreamException;
-
 import org.apache.axiom.om.OMElement;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -34,6 +26,13 @@
 import org.apache.synapse.config.SynapseConfiguration;
 import org.xml.sax.InputSource;
 
+import javax.xml.stream.XMLStreamException;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
 /**
  * A resource map.
  * 
@@ -45,7 +44,7 @@
  * object.
  */
 public class ResourceMap {
-    private static final Log log = LogFactory.getLog(ResourceMapURIResolver.class);
+    private static final Log log = LogFactory.getLog(ResourceMap.class);
     
     private final Map/*<String,String>*/ resources = new LinkedHashMap();
     

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/MediatorWorker.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/MediatorWorker.java?rev=615763&r1=615762&r2=615763&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/MediatorWorker.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/MediatorWorker.java Mon Jan 28 00:43:56 2008
@@ -68,7 +68,7 @@
     public void run() {
         try {
             seq.mediate(synCtx);
-            ((Axis2MessageContext)synCtx).getAxis2MessageContext().getEnvelope().discard();
+            //((Axis2MessageContext)synCtx).getAxis2MessageContext().getEnvelope().discard();
 
         } catch (SynapseException syne) {
             if (!synCtx.getFaultStack().isEmpty()) {
@@ -81,7 +81,7 @@
             }
 
         } catch (Exception e) {
-            String msg = "Unexpected error executing task";
+            String msg = "Unexpected error executing task/async inject";
             log.error(msg, e);
             if (synCtx.getServiceLog() != null) {
                 synCtx.getServiceLog().error(msg, e);

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/base/SequenceMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/base/SequenceMediator.java?rev=615763&r1=615762&r2=615763&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/base/SequenceMediator.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/base/SequenceMediator.java Mon Jan 28 00:43:56 2008
@@ -22,6 +22,7 @@
 import org.apache.synapse.Mediator;
 import org.apache.synapse.SynapseConstants;
 import org.apache.synapse.MessageContext;
+import org.apache.synapse.core.SynapseEnvironment;
 import org.apache.synapse.mediators.AbstractListMediator;
 import org.apache.synapse.mediators.MediatorFaultHandler;
 import org.apache.synapse.statistics.StatisticsUtils;
@@ -49,6 +50,8 @@
     private String errorHandler = null;
     /** is this definition dynamic */
     private boolean dynamic = false;
+    /** flag to ensure that each and every sequence is initialized and destroyed atmost once */
+    private boolean initialized = false;
     /** the registry key to load this definition if dynamic */
     private String registryKey = null;
 
@@ -178,6 +181,24 @@
         }
 
         return false;
+    }
+
+    /**
+     * This method will ensure that each and every sequence wil only be initialized atmost once
+     * @param se - enviorenment to be initialized
+     */
+    public synchronized void init(SynapseEnvironment se) {
+        if (!initialized) {
+            super.init(se);
+            initialized = true;
+        }
+    }
+
+    public synchronized void destroy() {
+        if (initialized) {
+            super.destroy();
+            initialized = false;
+        }
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


Mime
View raw message