You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by pz...@apache.org on 2005/11/30 18:40:05 UTC
svn commit: r350001 [24/48] - in /incubator/synapse/trunk/java: ./
SpringMediator/ SpringMediator/META-INF/ SpringMediator/META-INF/services/
SpringMediator/org/ SpringMediator/org/apache/
SpringMediator/org/apache/synapse/ SpringMediator/org/apache/sy...
Modified: incubator/synapse/trunk/java/maven.xml
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/maven.xml?rev=350001&r1=350000&r2=350001&view=diff
==============================================================================
--- incubator/synapse/trunk/java/maven.xml (original)
+++ incubator/synapse/trunk/java/maven.xml Wed Nov 30 09:26:22 2005
@@ -8,6 +8,131 @@
xmlns:define="jelly:define">
+
+ <goal name="setclasspath">
+ <path id="test.classpath">
+ <path refid="maven.dependency.classpath"/>
+ </path>
+ </goal>
+
+ <postGoal name="test:compile">
+ <ant:mkdir dir="${basedir}/target/lib"/>
+ <deploy:copy-deps todir="${basedir}/target/lib"/>
+
+ <echo message="----------------Creating synapse.mar----------------"/>
+ <mkdir dir="target/modules/synapse/META-INF"/>
+ <copy file="src/org/apache/synapse/axis2/META-INF/module.xml"
+ tofile="target/modules/synapse/META-INF/module.xml"/>
+ <jar jarfile="target/synapse.mar"
+ basedir="target/modules/synapse">
+ <include name="**"/>
+ </jar>
+
+ <echo message="----------------Creating First Dispatching aar----------------"/>
+ <mkdir dir="target/services/synapse/META-INF"/>
+ <copy file="synapse-test-resources/axis2/services/synapse/META-INF/services.xml"
+ tofile="target/services/synapse/META-INF/services.xml"/>
+ <jar jarfile="target/synapse.aar"
+ basedir="target/services/synapse">
+ <include name="**"/>
+ </jar>
+ <echo message="----------------Creating Empty Mediator aar----------------"/>
+ <mkdir dir="target/services/emptymediator/META-INF"/>
+ <copy file="synapse-test-resources/axis2/services/emptymediator/META-INF/services.xml"
+ tofile="target/services/emptymediator/META-INF/services.xml"/>
+ <jar jarfile="target/emptymediator.aar"
+ basedir="target/services/emptymediator">
+ <include name="**"/>
+ </jar>
+
+ <echo message="----------------Creating NPE aar----------------"/>
+ <mkdir dir="target/services/npe/META-INF"/>
+ <mkdir dir="target/services/npe/org/apache/axis2/test"/>
+ <copy file="test/org/apache/axis2/META-INF/services.xml"
+ tofile="target/services/npe/META-INF/services.xml"/>
+ <copy file="target/test-classes/org/apache/axis2/test/Echo.class"
+ tofile="target/services/npe/org/apache/axis2/test/Echo.class"/>
+ <jar jarfile="target/npe.aar"
+ basedir="target/services/npe">
+ <include name="**"/>
+ </jar>
+
+
+ <echo message="-----------Creating Testing Repository - Genral----------"/>
+ <mkdir dir="target/synapse-repository"/>
+ <copy file="target/synapse.aar"
+ tofile="target/synapse-repository/services/synapse.aar"/>
+ <copy file="target/emptymediator.aar"
+ tofile="target/synapse-repository/services/emptymediator.aar"/>
+ <mkdir dir="target/synapse-repository/modules"/>
+ <copy file="target/synapse.mar"
+ tofile="target/synapse-repository/modules/synapse.mar"/>
+ <copy file="synapse-test-resources/axis2/modules/addressing.mar"
+ tofile="target/synapse-repository/modules/addressing.mar"/>
+ <copy file="synapse-test-resources/axis2/axis2.xml"
+ tofile="target/synapse-repository/axis2.xml"/>
+
+ <echo message="-----------Creating Testing Repository - Fault Handling ----------"/>
+ <mkdir dir="target/synapse-repository-fault"/>
+ <copy file="target/synapse.aar"
+ tofile="target/synapse-repository-fault/services/synapse.aar"/>
+ <copy file="target/emptymediator.aar"
+ tofile="target/synapse-repository-fault/services/emptymediator.aar"/>
+ <mkdir dir="target/synapse-repository-fault/modules"/>
+ <copy file="target/synapse.mar"
+ tofile="target/synapse-repository-fault/modules/synapse.mar"/>
+ <copy file="synapse-test-resources/axis2/modules/addressing.mar"
+ tofile="target/synapse-repository-fault/modules/addressing.mar"/>
+ <copy file="synapse-test-resources/axis2/axis2.xml"
+ tofile="target/synapse-repository-fault/axis2.xml"/>
+ <copy file="test/rules/synapse-fault-return.xml"
+ tofile="target/synapse-repository-fault/synapse.xml"/>
+
+ <echo message="-----------Creating Testing Repository - Send ----------"/>
+ <mkdir dir="target/synapse-repository-send"/>
+ <copy file="target/synapse.aar"
+ tofile="target/synapse-repository-send/services/synapse.aar"/>
+ <copy file="target/emptymediator.aar"
+ tofile="target/synapse-repository-send/services/emptymediator.aar"/>
+ <mkdir dir="target/synapse-repository-send/modules"/>
+ <copy file="target/synapse.mar"
+ tofile="target/synapse-repository-send/modules/synapse.mar"/>
+ <copy file="synapse-test-resources/axis2/modules/addressing.mar"
+ tofile="target/synapse-repository-send/modules/addressing.mar"/>
+ <copy file="synapse-test-resources/axis2/axis2.xml"
+ tofile="target/synapse-repository-send/axis2.xml"/>
+ <copy file="test/rules/synapse-send.xml"
+ tofile="target/synapse-repository-send/synapse.xml"/>
+
+ <echo message="-----------Creating Testing Repository - SendOn ----------"/>
+ <mkdir dir="target/synapse-repository-sendon"/>
+ <copy file="target/synapse.aar"
+ tofile="target/synapse-repository-sendon/services/synapse.aar"/>
+ <copy file="target/npe.aar"
+ tofile="target/synapse-repository-sendon/services/npe.aar"/>
+ <copy file="target/emptymediator.aar"
+ tofile="target/synapse-repository-sendon/services/emptymediator.aar"/>
+ <mkdir dir="target/synapse-repository-sendon/modules"/>
+ <copy file="target/synapse.mar"
+ tofile="target/synapse-repository-sendon/modules/synapse.mar"/>
+ <copy file="synapse-test-resources/axis2/modules/addressing.mar"
+ tofile="target/synapse-repository-sendon/modules/addressing.mar"/>
+ <copy file="synapse-test-resources/axis2/axis2.xml"
+ tofile="target/synapse-repository-sendon/axis2.xml"/>
+ <copy file="test/rules/synapse-sendon.xml"
+ tofile="target/synapse-repository-sendon/synapse.xml"/>
+
+ <echo message="-----------Creating Testing Repository - SendOnAxis2 ----------"/>
+ <mkdir dir="target/synapse-repository-sendonAxis2"/>
+
+ <copy file="target/npe.aar"
+ tofile="target/synapse-repository-sendonAxis2/services/npe.aar"/>
+
+ <copy file="synapse-test-resources/axis2/modules/addressing.mar"
+ tofile="target/synapse-repository-sendonAxis2/modules/addressing.mar"/>
+ <copy file="synapse-test-resources/axis2/axis2.xml"
+ tofile="target/synapse-repository-sendonAxis2/axis2.xml"/>
+ </postGoal>
<!-- ================================================================ -->
<!--- Reports -->
<!-- ================================================================ -->
@@ -34,4 +159,6 @@
<echo>tasklist is disabled.</echo>
</postGoal>
-</project>
+
+
+</project>
Added: incubator/synapse/trunk/java/maven.xml.fromjava
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/maven.xml.fromjava?rev=350001&view=auto
==============================================================================
--- incubator/synapse/trunk/java/maven.xml.fromjava (added)
+++ incubator/synapse/trunk/java/maven.xml.fromjava Wed Nov 30 09:26:22 2005
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project default="jar"
+ xmlns:j="jelly:core"
+ xmlns:u="jelly:util"
+ xmlns:deploy="deploy"
+ xmlns:ant="jelly:ant"
+ xmlns:maven="jelly:maven"
+ xmlns:define="jelly:define">
+
+
+<!-- ================================================================ -->
+ <!--- Reports -->
+ <!-- ================================================================ -->
+ <!-- Conditionally disable linkcheck based on a property. -->
+
+ <postGoal name="xdoc:register-reports">
+
+ <echo>Reports are disabled. Deregistering all the reports ....</echo>
+ <attainGoal name="maven-linkcheck-plugin:deregister"/>
+ <echo>linkcheck is disabled.</echo>
+ <attainGoal name="maven-checkstyle-plugin:deregister"/>
+ <echo>checkstyle is disabled.</echo>
+ <attainGoal name="maven-changes-plugin:deregister"/>
+ <echo>changes is disabled.</echo>
+ <attainGoal name="maven-changelog-plugin:deregister"/>
+ <echo>changelog is disabled.</echo>
+ <attainGoal name="maven-license-plugin:deregister"/>
+ <echo>license is disabled.</echo>
+ <attainGoal name="maven-javadoc-plugin:deregister"/>
+ <echo>javadoc is disabled.</echo>
+ <attainGoal name="maven-junit-report-plugin:deregister"/>
+ <echo>junit-report is disabled.</echo>
+ <attainGoal name="maven-tasklist-plugin:deregister"/>
+ <echo>tasklist is disabled.</echo>
+
+ </postGoal>
+</project>
Added: incubator/synapse/trunk/java/project.properties
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/project.properties?rev=350001&view=auto
==============================================================================
--- incubator/synapse/trunk/java/project.properties (added)
+++ incubator/synapse/trunk/java/project.properties Wed Nov 30 09:26:22 2005
@@ -0,0 +1,64 @@
+# -------------------------------------------------------------------
+# Dependency Repositories
+# -------------------------------------------------------------------
+maven.repo.remote=\
+http://www.ibiblio.org/maven,\
+http://cvs.apache.org/repository/,\
+http://www.apache.org/dist/java-repository/,\
+http://www.openejb.org/maven,\
+http://dist.codehaus.org,\
+http://mirrors.sunsite.dk/maven/,\
+http://people.apache.org/~dims/maven/
+
+# -------------------------------------------------------------------
+# XDocs Settings
+# -------------------------------------------------------------------
+maven.xdoc.date=left
+## maven.xdoc.version=${pom.currentVersion}
+
+# -------------------------------------------------------------------
+# JUnit
+# -------------------------------------------------------------------
+maven.junit.jvmargs=-Djava.awt.headless=true
+maven.junit.fork=true
+
+# -------------------------------------------------------------------
+# Compile
+# -------------------------------------------------------------------
+maven.compile.optimize=false
+maven.compile.fork=true
+
+
+# -------------------------------------------------------------------
+# Versions of dependencies
+# -------------------------------------------------------------------
+ant.version=1.6.5
+axis.wsdl4j.version=1.2
+axis2.version=0.93-SNAPSHOT
+bcprov.version=jdk13-128
+commons.codec.version=1.3
+commons.discovery.version=0.2
+commons.fileupload.version=1.0
+commons.httpclient.version=3.0-rc3
+commons.logging.version=1.0.4
+geronimo.spec.activation.version=1.0.2-rc4
+geronimo.spec.javamail.version=1.3.1-rc5
+geronimo.spec.servlet.version=2.4-rc4
+servletapi.version=2.3
+groovy.all.version=1.0-jsr-01
+jaxen.version=1.1-beta-7
+junit.version=3.8.1
+log4j.version=1.2.12
+opensaml.version=1.0.1
+stax.api.version=1.0
+stax.impl.groupid=stax
+stax.impl.artifactid=stax
+stax.impl.version=1.1.2-dev
+wss4j.version=SNAPSHOT
+xalan.version=2.6.0
+xbean.version=2.0.0
+xerces.version=2.6.2
+XmlSchema.version=SNAPSHOT
+xmlsec.version=1.2.1
+xmlunit.version=1.0
+
Modified: incubator/synapse/trunk/java/project.xml
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/project.xml?rev=350001&r1=350000&r2=350001&view=diff
==============================================================================
--- incubator/synapse/trunk/java/project.xml (original)
+++ incubator/synapse/trunk/java/project.xml Wed Nov 30 09:26:22 2005
@@ -1,164 +1,287 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<project>
- <name>Synapse</name>
- <pomVersion>3</pomVersion>
-
- <!-- a unique name for this project -->
- <name>Apache Synapse</name>
- <id>synapse</id>
- <groupId>synapse</groupId>
- <package>org.apache.synapse</package>
-
- <currentVersion></currentVersion>
-
- <!-- details about the organization that 'owns' the project -->
- <organization>
- <name>Apache Software Foundation</name>
- <url>http://www.apache.org/</url>
- <logo>http://www.apache.org/images/asf-logo.gif</logo>
- </organization>
-
- <inceptionYear>2005</inceptionYear>
- <package></package>
- <logo></logo>
- <description>The Synapse project will create a robust, lightweight implementation of a highly scalable and distributed service mediation framework based on Web services specifications.</description>
- <shortDescription>Apache Synapse</shortDescription>
- <!-- the project home page -->
- <url>http://incubator.apache.org/synapse</url>
- <issueTrackingUrl></issueTrackingUrl>
- <siteAddress>http://incubator.apache.org/synapse</siteAddress>
- <siteDirectory></siteDirectory>
- <distributionDirectory></distributionDirectory>
- <mailingLists>
- <mailingList>
- <name>Synapse Developer List</name>
- <subscribe>synapse-dev-subscribe@ws.apache.org</subscribe>
- <unsubscribe>synapse-dev-unsubscribe@ws.apache.org</unsubscribe>
- <archive></archive>
-
- </mailingList>
- <mailingList>
- <name>Synapse User List</name>
- <subscribe></subscribe>
- <unsubscribe></unsubscribe>
- <archive></archive>
- </mailingList>
- </mailingLists>
-
- <!-- ========== -->
- <!-- Developers -->
- <!-- ========== -->
-
- <developers>
-<developer>
- <name>Fabrice Medio</name>
- <id>Fabrice</id>
- <email>fmedio AT bluetitan.com</email>
- <organization>Blue Titan</organization>
- </developer>
-<developer>
- <name>Dan Kulp</name>
- <id>dan</id>
- <email>daniel.kulp AT iona.com</email>
- <organization>Iona</organization>
- </developer>
-<developer>
- <name>Adi Sakala</name>
- <id>adi</id>
- <email>adi.sakala AT iona.com</email>
- <organization>Iona</organization>
- </developer>
-<developer>
- <name>Carl Trieloff </name>
- <id>carl</id>
- <email>ctrieloff AT iona.com</email>
- <organization>Iona</organization>
- </developer>
-<developer>
- <name>Sathish Kumar T.K</name>
- <id>sathish</id>
- <email></email>
- <organization>Infravio</organization>
- </developer>
-<developer>
- <name>D. Hariharasudhan</name>
- <id>hariharasudhan</id>
- <email></email>
- <organization>Infravio</organization>
- </developer>
-<developer>
- <name> P. Vikas Roonwal</name>
- <id>vikas</id>
- <email></email>
- <organization>Infravio</organization>
- </developer>
-<developer>
- <name>Dave Chappell</name>
- <id>dave</id>
- <email>chappell AT sonicsoftware.com</email>
- <organization>Sonic Software</organization>
- </developer>
-
-
-<developer>
- <name>Glen Daniels - Member of ASF, Member of WS PMC and Axis Committer</name>
- <id>glen</id>
- <email>gdaniels AT apache.org</email>
- <organization>Sonic Software</organization>
- </developer>
-
-<developer>
- <name>Paul Fremantle - Member of WS PMC and Axis Committer</name>
- <id>paul</id>
- <email>paul AT wso2.com</email>
- <organization>WSO2</organization>
- </developer>
-<developer>
- <name>Davanum Srinivas - Member of ASF, WS PMC Chair and Axis Committer</name>
- <id>dims</id>
- <email>dims AT apache.org</email>
- <organization>WSO2</organization>
- </developer>
-<developer>
- <name>Sanjiva Weerawarana - - Member of ASF, Member of WS PMC and Axis Committer</name>
- <id>sanjiva</id>
- <email>sanjiva AT apache.org</email>
- <organization>WSO2</organization>
- </developer>
- <developer>
- <name>Eran Chinthaka - Member of WS PMC and Axis Committer</name>
- <id>chinthaka</id>
- <email>chinthaka AT apache.org</email>
- <organization>WSO2</organization>
- <url>http://www.apache.org/~chinthaka</url>
- </developer>
- <developer>
- <name>Saminda Abeyruwan - Axis Committer</name>
- <id>saminda</id>
- <email>saminda AT apache.org</email>
- <organization>WSO2</organization>
- </developer>
-
-
- </developers>
-
-
-
-
-
-
-
- <!-- ======= -->
- <!-- Reports -->
- <!-- ======= -->
-
- <reports>
-
-
- <report>maven-changes-plugin</report>
-
-
- </reports>
-
-</project>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+
+ <pomVersion>3</pomVersion>
+
+ <id>Synapse</id>
+
+ <name>Apache Synpase</name>
+
+ <currentVersion>M1-SNAPSHOT</currentVersion>
+
+ <organization>
+ <name>Apache Web Services</name>
+ <url>http://ws.apache.org/</url>
+ <logo>http://www.apache.org/images/asf-logo.gif</logo>
+ </organization>
+
+ <inceptionYear>2005</inceptionYear>
+ <package>org.apache.synapse</package>
+ <logo/>
+ <description>The Synapse project will create a robust, lightweight
+ implementation of a highly scalable and distributed service mediation
+ framework based on Web services specifications.</description>
+
+ <!-- the project home page -->
+ <!--todo: need to setup uri, issueTracker, site, and dist dir -->
+ <!--<url>http://ws.apache.org/synapse/</url>-->
+ <!--<issueTrackingUrl>http://issues.apache.org/jira/browse/KAND</issueTrackingUrl>-->
+ <!--<siteAddress>ws.apache.org</siteAddress>-->
+ <!--<siteDirectory>/synapse/</siteDirectory>-->
+ <!--<distributionDirectory>/www/ws.apache.org/builds/</distributionDirectory>-->
+ <!--todo-->
+
+ <!-- any mailing lists for the project -->
+ <!--todo-->
+ <!--<mailingLists>-->
+ <!--<mailingList>-->
+ <!--<name>Synpase Developer List</name>-->
+ <!--<subscribe>synapse-dev-subscribe@ws.apache.org</subscribe>-->
+ <!--<unsubscribe>synapse-dev-unsubscribe@ws.apache.org</unsubscribe>-->
+ <!--<archive></archive>-->
+ <!--</mailingList>-->
+ <!--</mailingLists>-->
+
+ <!-- who the developers are for the project -->
+ <developers>
+ <developer>
+ <name>Paul Fremantle</name>
+ <id>paul</id>
+ <email>paul@wso2.com</email>
+ <organization>WSO2</organization>
+ </developer>
+ <developer>
+ <name>Sanjiva Weerawarana</name>
+ <id>sanjiva</id>
+ <email>sanjiva@wso2.com</email>
+ <organization>WSO2</organization>
+ </developer>
+ <!--todo : all the developers here-->
+
+ </developers>
+
+ <licenses>
+ <license>
+ <name>The Apache Software License, Version 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0</url>
+ <distribution>repo</distribution>
+ </license>
+ </licenses>
+
+ <!-- build information for the project -->
+ <build>
+ <nagEmailAddress>synapse-dev@ws.apache.org</nagEmailAddress>
+ <sourceDirectory>src</sourceDirectory>
+ </build>
+
+ <!-- ============ -->
+ <!-- Dependencies -->
+ <!-- ============ -->
+
+ <dependencies>
+ <dependency>
+ <groupId>axis2</groupId>
+ <artifactId>axis2</artifactId>
+ <version>${axis2.version}</version>
+ </dependency>
+
+ <!-- external JARs -->
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>${commons.logging.version}</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>${commons.httpclient.version}</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>commons-discovery</groupId>
+ <artifactId>commons-discovery</artifactId>
+ <version>${commons.discovery.version}</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>${commons.codec.version}</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>${log4j.version}</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ <url>http://dist.codehaus.org/stax/jars/</url>
+ </dependency>
+ <dependency>
+ <groupId>${stax.impl.groupid}</groupId>
+ <artifactId>${stax.impl.artifactid}</artifactId>
+ <version>${stax.impl.version}</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ <version>${stax.api.version}</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>axis</groupId>
+ <artifactId>axis-wsdl4j</artifactId>
+ <version>${axis.wsdl4j.version}</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>geronimo-spec</groupId>
+ <artifactId>geronimo-spec-javamail</artifactId>
+ <version>${geronimo.spec.javamail.version}</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>geronimo-spec</groupId>
+ <artifactId>geronimo-spec-activation</artifactId>
+ <version>${geronimo.spec.activation.version}</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>xmlbeans</groupId>
+ <artifactId>xbean</artifactId>
+ <version>${xbean.version}</version>
+ <type>jar</type>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>wss4j</groupId>
+ <artifactId>wss4j</artifactId>
+ <version>${wss4j.version}</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>xml-security</groupId>
+ <artifactId>xmlsec</artifactId>
+ <version>${xmlsec.version}</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>bouncycastle</groupId>
+ <artifactId>bcprov</artifactId>
+ <version>${bcprov.version}</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>opensaml</groupId>
+ <artifactId>opensaml</artifactId>
+ <version>${opensaml.version}</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ <properties>
+ <classloader>root</classloader>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xmlParserAPIs</artifactId>
+ <version>${xerces.version}</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>jaxen</groupId>
+ <artifactId>jaxen</artifactId>
+ <version>${jaxen.version}</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
+ <version>2.6.0</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
+ </dependencies>
+
+ <!-- ================================= -->
+ <!-- build information for the project -->
+ <!-- ================================= -->
+
+ <build>
+ <nagEmailAddress>synapse-dev@ws.apache.org</nagEmailAddress>
+ <sourceDirectory>src</sourceDirectory>
+ <unitTestSourceDirectory>test</unitTestSourceDirectory>
+ <unitTest>
+ <includes>
+ <include>**/*Test.java</include>
+ </includes>
+ <!--<excludes>-->
+ <!--<exclude>**/NaughtyTest.java</exclude>-->
+ <!--</excludes>-->
+ </unitTest>
+ <resources>
+ <!--<resource>-->
+ <!--<directory>test-resources</directory>-->
+ <!--<includes>-->
+ <!--<include>*.*</include>-->
+ <!--</includes>-->
+ <!--</resource>-->
+ </resources>
+
+ </build>
+
+ <!-- ======= -->
+ <!-- Reports -->
+ <!-- ======= -->
+
+ <reports>
+ <!--<report>maven-changes-plugin</report>-->
+ <!--<report>maven-jdepend-plugin</report>-->
+ <!--<report>maven-checkstyle-plugin</report>-->
+ <!--<report>maven-pmd-plugin</report>-->
+ <!--<report>maven-junit-report-plugin</report>-->
+ <!--<report>maven-license-plugin</report>-->
+ <!--<report>maven-jxr-plugin</report>-->
+ </reports>
+</project>
+
Added: incubator/synapse/trunk/java/project.xml.fromjava
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/project.xml.fromjava?rev=350001&view=auto
==============================================================================
--- incubator/synapse/trunk/java/project.xml.fromjava (added)
+++ incubator/synapse/trunk/java/project.xml.fromjava Wed Nov 30 09:26:22 2005
@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project>
+ <name>Synapse</name>
+ <pomVersion>3</pomVersion>
+
+ <!-- a unique name for this project -->
+ <name>Apache Synapse</name>
+ <id>synapse</id>
+ <groupId>synapse</groupId>
+ <package>org.apache.synapse</package>
+
+ <currentVersion></currentVersion>
+
+ <!-- details about the organization that 'owns' the project -->
+ <organization>
+ <name>Apache Software Foundation</name>
+ <url>http://www.apache.org/</url>
+ <logo>http://www.apache.org/images/asf-logo.gif</logo>
+ </organization>
+
+ <inceptionYear>2005</inceptionYear>
+ <package></package>
+ <logo></logo>
+ <description>The Synapse project will create a robust, lightweight implementation of a highly scalable and distributed service mediation framework based on Web services specifications.</description>
+ <shortDescription>Apache Synapse</shortDescription>
+ <!-- the project home page -->
+ <url>http://incubator.apache.org/synapse</url>
+ <issueTrackingUrl></issueTrackingUrl>
+ <siteAddress>http://incubator.apache.org/synapse</siteAddress>
+ <siteDirectory></siteDirectory>
+ <distributionDirectory></distributionDirectory>
+ <mailingLists>
+ <mailingList>
+ <name>Synapse Developer List</name>
+ <subscribe>synapse-dev-subscribe@ws.apache.org</subscribe>
+ <unsubscribe>synapse-dev-unsubscribe@ws.apache.org</unsubscribe>
+ <archive></archive>
+
+ </mailingList>
+ <mailingList>
+ <name>Synapse User List</name>
+ <subscribe></subscribe>
+ <unsubscribe></unsubscribe>
+ <archive></archive>
+ </mailingList>
+ </mailingLists>
+
+ <!-- ========== -->
+ <!-- Developers -->
+ <!-- ========== -->
+
+ <developers>
+<developer>
+ <name>Fabrice Medio</name>
+ <id>Fabrice</id>
+ <email>fmedio AT bluetitan.com</email>
+ <organization>Blue Titan</organization>
+ </developer>
+<developer>
+ <name>Dan Kulp</name>
+ <id>dan</id>
+ <email>daniel.kulp AT iona.com</email>
+ <organization>Iona</organization>
+ </developer>
+<developer>
+ <name>Adi Sakala</name>
+ <id>adi</id>
+ <email>adi.sakala AT iona.com</email>
+ <organization>Iona</organization>
+ </developer>
+<developer>
+ <name>Carl Trieloff </name>
+ <id>carl</id>
+ <email>ctrieloff AT iona.com</email>
+ <organization>Iona</organization>
+ </developer>
+<developer>
+ <name>Sathish Kumar T.K</name>
+ <id>sathish</id>
+ <email></email>
+ <organization>Infravio</organization>
+ </developer>
+<developer>
+ <name>D. Hariharasudhan</name>
+ <id>hariharasudhan</id>
+ <email></email>
+ <organization>Infravio</organization>
+ </developer>
+<developer>
+ <name> P. Vikas Roonwal</name>
+ <id>vikas</id>
+ <email></email>
+ <organization>Infravio</organization>
+ </developer>
+<developer>
+ <name>Dave Chappell</name>
+ <id>dave</id>
+ <email>chappell AT sonicsoftware.com</email>
+ <organization>Sonic Software</organization>
+ </developer>
+
+
+<developer>
+ <name>Glen Daniels - Member of ASF, Member of WS PMC and Axis Committer</name>
+ <id>glen</id>
+ <email>gdaniels AT apache.org</email>
+ <organization>Sonic Software</organization>
+ </developer>
+
+<developer>
+ <name>Paul Fremantle - Member of WS PMC and Axis Committer</name>
+ <id>paul</id>
+ <email>paul AT wso2.com</email>
+ <organization>WSO2</organization>
+ </developer>
+<developer>
+ <name>Davanum Srinivas - Member of ASF, WS PMC Chair and Axis Committer</name>
+ <id>dims</id>
+ <email>dims AT apache.org</email>
+ <organization>WSO2</organization>
+ </developer>
+<developer>
+ <name>Sanjiva Weerawarana - - Member of ASF, Member of WS PMC and Axis Committer</name>
+ <id>sanjiva</id>
+ <email>sanjiva AT apache.org</email>
+ <organization>WSO2</organization>
+ </developer>
+ <developer>
+ <name>Eran Chinthaka - Member of WS PMC and Axis Committer</name>
+ <id>chinthaka</id>
+ <email>chinthaka AT apache.org</email>
+ <organization>WSO2</organization>
+ <url>http://www.apache.org/~chinthaka</url>
+ </developer>
+ <developer>
+ <name>Saminda Abeyruwan - Axis Committer</name>
+ <id>saminda</id>
+ <email>saminda AT apache.org</email>
+ <organization>WSO2</organization>
+ </developer>
+
+
+ </developers>
+
+
+
+
+
+
+
+ <!-- ======= -->
+ <!-- Reports -->
+ <!-- ======= -->
+
+ <reports>
+
+
+ <report>maven-changes-plugin</report>
+
+
+ </reports>
+
+</project>
+
Added: incubator/synapse/trunk/java/repo/axis2.xml
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/repo/axis2.xml?rev=350001&view=auto
==============================================================================
--- incubator/synapse/trunk/java/repo/axis2.xml (added)
+++ incubator/synapse/trunk/java/repo/axis2.xml Wed Nov 30 09:26:22 2005
@@ -0,0 +1,140 @@
+<axisconfig name="AxisJava2.0">
+ <!-- ================================================= -->
+ <!-- Parameters -->
+ <!-- ================================================= -->
+ <parameter name="hotdeployment" locked="false">true</parameter>
+ <parameter name="hotupdate" locked="false">false</parameter>
+ <parameter name="enableMTOM" locked="false">true</parameter>
+ <!-- Uncomment this to enable REST support -->
+ <!-- <parameter name="enableREST" locked="false">true</parameter>-->
+
+
+ <parameter name="userName" locked="false">admin</parameter>
+ <parameter name="password" locked="false">axis2</parameter>
+
+ <parameter name="seralizeLocation" locked="false">.</parameter>
+
+ <parameter name="SynapseConfiguration" locked="false">synapse.xml</parameter>
+
+ <!--if you want to extract the service archive file and work with that please uncomment this-->
+ <!--else , it wont extract archive file or does not take into consideration if someone drop-->
+ <!--exploded directory into /service directory-->
+ <!--<parameter name="extractServiceArchive" locked="false">true</parameter>-->
+
+
+ <!-- The way of adding listener to the system-->
+ <!-- <listener class="org.apache.axis2.ObserverIMPL">-->
+ <!-- <parameter name="RSS_URL" locked="false">http://127.0.0.1/rss</parameter>-->
+ <!-- </listener>-->
+
+ <!--Registering Axis Storage Class if you comment this default one will -->
+ <!--does the job (org.apache.axis2.storage.impl.AxisMemoryStorage) , if you-->
+ <!--want to register new one write a class by extanding AbastractStorage-->
+ <!--and put that name here-->
+ <axisStorage
+ class="org.apache.axis2.storage.impl.AxisMemoryStorage">
+ <parameter name="StoreLocation" locked="false">N:S</parameter>
+ </axisStorage>
+
+
+
+ <!-- ================================================= -->
+ <!-- Message Receivers -->
+ <!-- ================================================= -->
+ <!-- This is the Deafult Message Receiver for the Request Response style Operations -->
+ <messageReceiver mep="INOUT"
+ class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver" />
+
+ <!-- ================================================= -->
+ <!-- Transport Ins -->
+ <!-- ================================================= -->
+ <transportReceiver name="http"
+ class="org.apache.axis2.transport.http.SimpleHTTPServer">
+ <parameter name="port" locked="false">6060</parameter>
+ </transportReceiver>
+
+ <!-- Uncomment this one with the appropriate papameters to enable the SMTP transport Receiver
+ <transportReceiver name="mail" class="org.apache.axis2.transport.mail.SimpleMailListener">
+ <parameter name="transport.mail.pop3.host" locked="false">127.0.0.1</parameter>
+ <parameter name="transport.mail.pop3.user" locked="false">axis2</parameter>
+ <parameter name="transport.mail.pop3.password" locked="false">axis2</parameter>
+ <parameter name="transport.mail.pop3.port" locked="false">110</parameter>
+ <parameter name="transport.mail.replyToAddress" locked="false">axis2@127.0.0.1</parameter>
+ </transportReceiver> -->
+
+ <transportReceiver name="tcp"
+ class="org.apache.axis2.transport.tcp.TCPServer">
+ <parameter name="port" locked="false">6060</parameter>
+ </transportReceiver>
+
+ <!-- ================================================= -->
+ <!-- Transport Outs -->
+ <!-- ================================================= -->
+
+ <transportSender name="tcp"
+ class="org.apache.axis2.transport.tcp.TCPTransportSender" />
+ <transportSender name="local"
+ class="org.apache.axis2.transport.local.LocalTransportSender" />
+ <transportSender name="http"
+ class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+ <parameter name="PROTOCOL" locked="false">HTTP/1.0</parameter>
+ </transportSender>
+ <transportSender name="https"
+ class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+ <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
+ </transportSender>
+
+ <!-- Uncomment this one with the appropriate papameters to enable the SMTP transport Receiver
+ <transportSender name="mail" class="org.apache.axis2.transport.mail.MailTransportSender">
+ <parameter name="transport.mail.smtp.host" locked="false">127.0.0.1</parameter>
+ <parameter name="transport.mail.smtp.user" locked="false">axis2</parameter>
+ <parameter name="transport.mail.smtp.password" locked="false">axis2</parameter>
+ <parameter name="transport.mail.smtp.port" locked="false">25</parameter>
+ </transportSender>
+ -->
+
+ <!-- ================================================= -->
+ <!-- Global Modules -->
+ <!-- ================================================= -->
+ <!-- Comment this to disable Addressing -->
+ <!-- <module ref="addressing" /> -->
+ <!--module ref="addressing" /-->
+
+
+ <!--Configuring module , providing paramters for modules whether they refer or not-->
+ <!--<moduleConfig name="addressing">-->
+ <!--<parameter name="addressingPara" locked="false">N/A</parameter>-->
+ <!--</moduleConfig>-->
+
+ <dispatchOrder>
+ <dispatcher name="SynapseDispatcher"
+ class="org.apache.synapse.axis2.SynapseDispatcher" />
+ </dispatchOrder>
+
+ <!-- ================================================= -->
+ <!-- Phases -->
+ <!-- ================================================= -->
+ <phaseOrder type="inflow">
+ <!-- System pre defined phases -->
+ <phase name="TransportIn" />
+ <phase name="PreDispatch" />
+ <phase name="Dispatch" />
+ <phase name="PostDispatch" />
+ <!-- System pre defined phases -->
+ <!-- After Postdispatch phase module author or or service author can add any phase he want -->
+ <phase name="userphase1" />
+ </phaseOrder>
+ <phaseOrder type="outflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="userphase1" />
+ </phaseOrder>
+ <phaseOrder type="INfaultflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="userphase1" />
+ </phaseOrder>
+ <phaseOrder type="Outfaultflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="userphase1" />
+ </phaseOrder>
+</axisconfig>
+
Added: incubator/synapse/trunk/java/repo/modules/addressing.mar
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/repo/modules/addressing.mar?rev=350001&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/synapse/trunk/java/repo/modules/addressing.mar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/synapse/trunk/java/repo/services/emptymediator/META-INF/services.xml
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/repo/services/emptymediator/META-INF/services.xml?rev=350001&view=auto
==============================================================================
--- incubator/synapse/trunk/java/repo/services/emptymediator/META-INF/services.xml (added)
+++ incubator/synapse/trunk/java/repo/services/emptymediator/META-INF/services.xml Wed Nov 30 09:26:22 2005
@@ -0,0 +1,6 @@
+<service name="emptymediator">
+ <operation name="mediate" >
+ <messageReceiver class="org.apache.synapse.axis2.EmptyMessageReceiver" />
+ </operation>
+</service>
+
\ No newline at end of file
Added: incubator/synapse/trunk/java/repo/services/synapse/META-INF/services.xml
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/repo/services/synapse/META-INF/services.xml?rev=350001&view=auto
==============================================================================
--- incubator/synapse/trunk/java/repo/services/synapse/META-INF/services.xml (added)
+++ incubator/synapse/trunk/java/repo/services/synapse/META-INF/services.xml Wed Nov 30 09:26:22 2005
@@ -0,0 +1,8 @@
+ <service name="synapse">
+
+ <operation name="mediate" >
+ <messageReceiver class="org.apache.synapse.axis2.SynapseMessageReceiver" />
+ </operation>
+
+ </service>
+
\ No newline at end of file
Added: incubator/synapse/trunk/java/repo/synapse.xml
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/repo/synapse.xml?rev=350001&view=auto
==============================================================================
--- incubator/synapse/trunk/java/repo/synapse.xml (added)
+++ incubator/synapse/trunk/java/repo/synapse.xml Wed Nov 30 09:26:22 2005
@@ -0,0 +1,18 @@
+<synapse xmlns="http://ws.apache.org/ns/synapse">
+ <stage name="logall">
+ <addressing/>
+ <log/>
+ </stage>
+ <stage name="service-specific" >
+ <regex message-address="to" pattern="http://xmethods.*">
+ <header type="to" value="http://64.124.140.30:9090/soap"/>
+ <xpath expr="//*[Symbol='MSFT']">
+ <fault/>
+ </xpath>
+ </regex>
+ </stage>
+ <stage name="sender">
+ <send/>
+ </stage>
+</synapse>
+
Added: incubator/synapse/trunk/java/src/org/apache/synapse/Constants.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/src/org/apache/synapse/Constants.java?rev=350001&view=auto
==============================================================================
--- incubator/synapse/trunk/java/src/org/apache/synapse/Constants.java (added)
+++ incubator/synapse/trunk/java/src/org/apache/synapse/Constants.java Wed Nov 30 09:26:22 2005
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.synapse;
+
+
+
+/**
+ *
+ *
+ * <p> Global constants for the Synapse project
+ *
+ */
+public interface Constants {
+
+
+ public static final String CLASSMEDIATOR = "classmediator";
+
+ public static final String MEDIATE_OPERATION_NAME = "mediate";
+
+ public static final String MEDIATOR_RESPONSE_PROPERTY = "synapse.mediator.response";
+
+ public static final String ISRESPONSE_PROPERTY = "synapse.isresponse";
+
+ public static final String EMPTYMEDIATOR = "emptymediator";
+
+ //this is for the synapse.xml config
+ String SYNAPSECONFIGURATION = "SynapseConfiguration";
+
+ String SYNAPSE_ENVIRONMENT = "synapse.environment";
+}
Added: incubator/synapse/trunk/java/src/org/apache/synapse/HeaderType.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/src/org/apache/synapse/HeaderType.java?rev=350001&view=auto
==============================================================================
--- incubator/synapse/trunk/java/src/org/apache/synapse/HeaderType.java (added)
+++ incubator/synapse/trunk/java/src/org/apache/synapse/HeaderType.java Wed Nov 30 09:26:22 2005
@@ -0,0 +1,130 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.synapse;
+
+import org.apache.axis2.addressing.EndpointReference;
+
+/**
+ *
+ * <p> This class encapsulates access to headers. It has a set of "logical names" (e.g. strings)
+ * Once you have set the logical name you can read and write that header on a SynapseMessage
+ * It is used by the RegexProcessor and the HeaderProcessor classes.
+ *
+ */
+public class HeaderType {
+
+ private final static int TO = 1, FROM = 2, FAULT = 3, ACTION = 4,
+ REPLYTO = 5;
+
+ public final static String STRTO = "to", STRFROM = "from",
+ STRFAULT = "faultto", STRACTION = "action", STRREPLYTO = "replyto";
+
+ private int headerType = 0;
+
+ public void setHeaderType(String header) {
+ if (header.equalsIgnoreCase(STRTO))
+ headerType = TO;
+ else if (header.equalsIgnoreCase(STRFROM))
+ headerType = FROM;
+ else if (header.equalsIgnoreCase(STRFAULT))
+ headerType = FAULT;
+ else if (header.equalsIgnoreCase(STRACTION))
+ headerType = ACTION;
+ else if (header.equalsIgnoreCase(STRREPLYTO))
+ headerType = REPLYTO;
+ else
+ throw new SynapseException("unknown header type");
+ }
+
+ public String getHeaderType() {
+ switch (headerType) {
+
+ case TO:
+ return STRTO;
+ case FROM:
+ return STRFROM;
+ case FAULT:
+ return STRFAULT;
+ case ACTION:
+ return STRACTION;
+ case REPLYTO:
+ return STRREPLYTO;
+
+ }
+ return null;
+ }
+
+ public String getHeader(SynapseMessage sm) {
+ switch (headerType) {
+ case TO: {
+ if (sm.getTo() != null)
+ return sm.getTo().getAddress();
+
+ }
+ case FROM: {
+ if (sm.getFrom() != null)
+ return sm.getFrom().getAddress();
+ break;
+ }
+ case FAULT: {
+ if (sm.getFaultTo() != null)
+ return sm.getFaultTo().getAddress();
+ break;
+ }
+ case ACTION: {
+ if (sm.getWSAAction() != null)
+ return sm.getWSAAction();
+ break;
+ }
+ case REPLYTO: {
+ if (sm.getReplyTo() != null)
+ return sm.getReplyTo().getAddress();
+ break;
+ }
+ }
+
+ return null;
+ }
+
+ public void setHeader(SynapseMessage sm, String value) {
+ switch (headerType) {
+ case 0: {
+ throw new SynapseException(
+ "headerType=0 in setHeader. Assume called setHeader before setHeaderType");
+ }
+
+ case TO: {
+
+ sm.setTo(new EndpointReference(value));
+ break;
+ }
+ case FROM: {
+ sm.setFrom(new EndpointReference(value));
+ break;
+ }
+ case REPLYTO: {
+ sm.setReplyTo(new EndpointReference(value));
+ break;
+ }
+ case ACTION: {
+ sm.setWSAAction(value);
+ break;
+ }
+
+ }
+ }
+}
Added: incubator/synapse/trunk/java/src/org/apache/synapse/Processor.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/src/org/apache/synapse/Processor.java?rev=350001&view=auto
==============================================================================
--- incubator/synapse/trunk/java/src/org/apache/synapse/Processor.java (added)
+++ incubator/synapse/trunk/java/src/org/apache/synapse/Processor.java Wed Nov 30 09:26:22 2005
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.synapse;
+
+
+/**
+ *
+ *
+ * The processor then deals with a message. It returns false if no further
+ * processing is desired. It can have a name (or null)
+ *
+ * Processors can either devolve processing to other processors (e.g. a rule,
+ * stage, etc) or deal with the message itself (e.g. mediator)
+ *
+ */
+public interface Processor {
+ public boolean process(SynapseEnvironment se, SynapseMessage sm);
+ public String getName();
+ public void setName(String name);
+}
Added: incubator/synapse/trunk/java/src/org/apache/synapse/SynapseEnvironment.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/src/org/apache/synapse/SynapseEnvironment.java?rev=350001&view=auto
==============================================================================
--- incubator/synapse/trunk/java/src/org/apache/synapse/SynapseEnvironment.java (added)
+++ incubator/synapse/trunk/java/src/org/apache/synapse/SynapseEnvironment.java Wed Nov 30 09:26:22 2005
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.synapse;
+
+
+/**
+ *
+ *
+ * <p>Common stuff needed to embed Synapse into a given runtime (e.g. Axis2)
+ *
+ */
+public interface SynapseEnvironment {
+ public void injectMessage(SynapseMessage smc);
+ public ClassLoader getClassLoader();
+ public void send(SynapseMessage smc);
+ public Processor lookupProcessor(String name);
+ public void addProcessor(Processor p);
+ public Processor getMasterProcessor();
+ public void setMasterProcessor(Processor p);
+}
Added: incubator/synapse/trunk/java/src/org/apache/synapse/SynapseException.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/src/org/apache/synapse/SynapseException.java?rev=350001&view=auto
==============================================================================
--- incubator/synapse/trunk/java/src/org/apache/synapse/SynapseException.java (added)
+++ incubator/synapse/trunk/java/src/org/apache/synapse/SynapseException.java Wed Nov 30 09:26:22 2005
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.synapse;
+
+/**
+ *
+ * <p>Runtime exception for Synapse code to throw
+ *
+ */
+public class SynapseException extends RuntimeException {
+
+ private static final long serialVersionUID = -7244032125641596311L;
+
+ public SynapseException(String string) {
+ super(string);
+
+ }
+
+ public SynapseException(String msg, Throwable e) {
+ super(msg, e);
+
+ }
+
+ public SynapseException(Throwable t) {
+ super(t);
+
+ }
+
+}
Added: incubator/synapse/trunk/java/src/org/apache/synapse/SynapseMessage.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/src/org/apache/synapse/SynapseMessage.java?rev=350001&view=auto
==============================================================================
--- incubator/synapse/trunk/java/src/org/apache/synapse/SynapseMessage.java (added)
+++ incubator/synapse/trunk/java/src/org/apache/synapse/SynapseMessage.java Wed Nov 30 09:26:22 2005
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.synapse;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.addressing.RelatesTo;
+import org.apache.axis2.soap.SOAPEnvelope;
+
+/**
+ *
+ *
+ * <p> The core definition of a message flowing thru Axis.
+ *
+ */
+public interface SynapseMessage {
+
+ public EndpointReference getFaultTo();
+
+ public void setFaultTo(EndpointReference reference);
+
+ public EndpointReference getFrom();
+
+ public void setFrom(EndpointReference reference);
+
+ public SOAPEnvelope getEnvelope();
+
+ public void setEnvelope(SOAPEnvelope envelope) throws AxisFault;
+
+ public String getMessageID();
+
+ public void setMessageID(String string);
+
+ public RelatesTo getRelatesTo();
+
+ public void setRelatesTo(RelatesTo reference);
+
+ public EndpointReference getReplyTo();
+
+ public void setReplyTo(EndpointReference reference);
+
+ public EndpointReference getTo();
+
+ public void setTo(EndpointReference reference);
+
+ public void setWSAAction(String actionURI);
+
+ public String getWSAAction();
+
+ public void setWSAMessageId(String messageID);
+
+ public String getWSAMessageId();
+
+ public Object getProperty(String key);
+
+ public void setProperty(String key, Object value);
+
+ public String getSoapAction();
+
+ public void setSoapAction(String string);
+
+ public boolean isDoingMTOM();
+
+ public void setDoingMTOM(boolean b);
+
+ public boolean isDoingREST();
+
+ public void setDoingREST(boolean b);
+
+ public boolean isSOAP11();
+
+ public void setResponse(boolean b);
+
+ public boolean isResponse();
+}
Added: incubator/synapse/trunk/java/src/org/apache/synapse/api/EnvironmentAware.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/src/org/apache/synapse/api/EnvironmentAware.java?rev=350001&view=auto
==============================================================================
--- incubator/synapse/trunk/java/src/org/apache/synapse/api/EnvironmentAware.java (added)
+++ incubator/synapse/trunk/java/src/org/apache/synapse/api/EnvironmentAware.java Wed Nov 30 09:26:22 2005
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.synapse.api;
+
+import org.apache.synapse.SynapseEnvironment;
+
+/**
+ *
+ * <p>API for Mediators to get access to the Synapse Environment
+ *
+ */
+public interface EnvironmentAware {
+ public void setSynapseEnvironment(SynapseEnvironment se);
+
+}
Added: incubator/synapse/trunk/java/src/org/apache/synapse/api/Mediator.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/src/org/apache/synapse/api/Mediator.java?rev=350001&view=auto
==============================================================================
--- incubator/synapse/trunk/java/src/org/apache/synapse/api/Mediator.java (added)
+++ incubator/synapse/trunk/java/src/org/apache/synapse/api/Mediator.java Wed Nov 30 09:26:22 2005
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.synapse.api;
+
+import org.apache.synapse.SynapseMessage;
+
+/**
+ *
+ * <p>API interface for pluggable mediators
+ *
+ */
+public interface Mediator {
+ public boolean mediate(SynapseMessage smc);
+}
\ No newline at end of file
Added: incubator/synapse/trunk/java/src/org/apache/synapse/axis2/Axis2FlexibleMEPClient.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/src/org/apache/synapse/axis2/Axis2FlexibleMEPClient.java?rev=350001&view=auto
==============================================================================
--- incubator/synapse/trunk/java/src/org/apache/synapse/axis2/Axis2FlexibleMEPClient.java (added)
+++ incubator/synapse/trunk/java/src/org/apache/synapse/axis2/Axis2FlexibleMEPClient.java Wed Nov 30 09:26:22 2005
@@ -0,0 +1,163 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.synapse.axis2;
+
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.ServiceContext;
+import org.apache.axis2.deployment.util.PhasesInfo;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.OutInAxisOperation;
+import org.apache.axis2.engine.AxisConfigurationImpl;
+import org.apache.axis2.engine.AxisEngine;
+import org.apache.axis2.om.OMAbstractFactory;
+
+import org.apache.axis2.soap.SOAPEnvelope;
+import org.apache.axis2.transport.TransportUtils;
+import org.apache.axis2.util.UUIDGenerator;
+import org.apache.synapse.Constants;
+import org.apache.synapse.SynapseException;
+
+
+import javax.xml.namespace.QName;
+
+
+public class Axis2FlexibleMEPClient {
+
+ // wholesale cut and paste from axis2.clientapi.*
+ public static MessageContext send(MessageContext smc) {
+ try {
+
+ ConfigurationContext configContext = null;
+ ConfigurationContextFactory efac = new ConfigurationContextFactory();
+ configContext = efac.buildClientConfigurationContext(null);
+ QName assumedServiceName = new QName("AnonymousService");
+ AxisService axisService = new AxisService(assumedServiceName);
+ AxisOperation axisOperationTemplate = new OutInAxisOperation(
+ new QName("TemplateOperation"));
+ PhasesInfo info = ((AxisConfigurationImpl) configContext
+ .getAxisConfiguration()).getPhasesinfo();
+ if (info != null) {
+ info.setOperationPhases(axisOperationTemplate);
+ }
+ axisService.addOperation(axisOperationTemplate);
+ configContext.getAxisConfiguration().addService(axisService);
+ ServiceContext serviceContext = axisService.getParent()
+ .getServiceGroupContext(configContext).getServiceContext(
+ assumedServiceName.getLocalPart());
+
+ MessageContext msgCtx = new MessageContext(serviceContext
+ .getConfigurationContext());
+
+ if (smc.getSoapAction() != null)
+ msgCtx.setSoapAction(smc.getSoapAction());
+ if (smc.getTo() != null)
+ msgCtx.setTo(smc.getTo());
+ if (smc.getWSAAction() != null)
+ msgCtx.setWSAAction(smc.getWSAAction());
+ if (smc.getFrom() != null)
+ msgCtx.setFrom(smc.getFrom());
+ if (smc.getMessageID() != null)
+ msgCtx.setMessageID(smc.getMessageID());
+ else
+ msgCtx.setMessageID(String.valueOf("uuid:"
+ + UUIDGenerator.getUUID()));
+ if (smc.getReplyTo() != null)
+ msgCtx.setReplyTo(smc.getReplyTo());
+ if (smc.getRelatesTo() != null)
+ msgCtx.setRelatesTo(smc.getRelatesTo());
+ /**
+ * We need to detach the body of the Env and attach only the body
+ * part that is necessary
+ */
+
+ //msgCtx.setEnvelope(smc.getEnvelope());
+ msgCtx.setEnvelope(outEnvelopeConfiguration(smc));
+ if (msgCtx.getEnvelope().getHeader() == null)
+ msgCtx.getEnvelope().getBody().insertSiblingBefore(
+ OMAbstractFactory.getSOAP11Factory()
+ .getDefaultEnvelope().getHeader());
+
+ msgCtx.setServiceContext(serviceContext);
+
+ EndpointReference epr = msgCtx.getTo();
+ String transport = null;
+ if (epr != null) {
+ String toURL = epr.getAddress();
+ int index = toURL.indexOf(':');
+ if (index > 0) {
+ transport = toURL.substring(0, index);
+ }
+ }
+
+ if (transport != null) {
+
+ msgCtx.setTransportOut(serviceContext.getConfigurationContext()
+ .getAxisConfiguration().getTransportOut(
+ new QName(transport)));
+
+ } else {
+ throw new SynapseException("cannotInferTransport");
+ }
+ // initialize and set the Operation Context
+
+ msgCtx.setOperationContext(axisOperationTemplate
+ .findOperationContext(msgCtx, serviceContext));
+ AxisEngine engine = new AxisEngine(configContext);
+ engine.send(msgCtx);
+
+ MessageContext response = new MessageContext(msgCtx
+ .getSystemContext(), msgCtx.getSessionContext(), msgCtx
+ .getTransportIn(), msgCtx.getTransportOut());
+ response.setProperty(MessageContext.TRANSPORT_IN, msgCtx
+ .getProperty(MessageContext.TRANSPORT_IN));
+ msgCtx.getAxisOperation().registerOperationContext(response,
+ msgCtx.getOperationContext());
+ response.setServerSide(false);
+ response.setServiceContext(msgCtx.getServiceContext());
+ response.setServiceGroupContext(msgCtx.getServiceGroupContext());
+
+ // If request is REST we assume the response is REST, so set the
+ // variable
+ response.setDoingREST(msgCtx.isDoingREST());
+
+ SOAPEnvelope resenvelope = TransportUtils.createSOAPMessage(
+ response, msgCtx.getEnvelope().getNamespace().getName());
+
+ response.setEnvelope(resenvelope);
+ engine = new AxisEngine(msgCtx.getSystemContext());
+ engine.receive(response);
+ response.setProperty(Constants.ISRESPONSE_PROPERTY, new Boolean(
+ true));
+ return response;
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new SynapseException(e);
+ }
+
+ }
+
+ private static SOAPEnvelope outEnvelopeConfiguration(MessageContext smc) {
+ SOAPEnvelope env = smc.getEnvelope();
+ env.getHeader().detach();
+ return env;
+ }
+
+}
Added: incubator/synapse/trunk/java/src/org/apache/synapse/axis2/Axis2Sender.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/src/org/apache/synapse/axis2/Axis2Sender.java?rev=350001&view=auto
==============================================================================
--- incubator/synapse/trunk/java/src/org/apache/synapse/axis2/Axis2Sender.java (added)
+++ incubator/synapse/trunk/java/src/org/apache/synapse/axis2/Axis2Sender.java Wed Nov 30 09:26:22 2005
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.synapse.axis2;
+
+import org.apache.axis2.AxisFault;
+
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.MessageContext;
+
+import org.apache.axis2.context.OperationContextFactory;
+
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.engine.AxisEngine;
+import org.apache.axis2.om.OMAbstractFactory;
+import org.apache.axis2.transport.http.HTTPConstants;
+import org.apache.synapse.Constants;
+import org.apache.synapse.SynapseException;
+import org.apache.synapse.SynapseMessage;
+
+
+public class Axis2Sender {
+
+ public static void sendOn(SynapseMessage smc) {
+
+ try {
+
+ MessageContext messageContext = ((Axis2SynapseMessage) smc)
+ .getMessageContext();
+ AxisEngine ae = new AxisEngine(messageContext.getSystemContext());
+
+ ConfigurationContext sc = messageContext.getSystemContext();
+
+ MessageContext outMsgContext = Axis2FlexibleMEPClient
+ .send(messageContext);
+
+ // run all rules on response
+
+ outMsgContext.setServerSide(true);
+
+ // deal with the fact that AddressingOutHandler has a bug if
+ // there
+ // is no header at all.
+ if (outMsgContext.getEnvelope().getHeader() == null)
+ outMsgContext.getEnvelope().getBody().insertSiblingBefore(
+ OMAbstractFactory.getSOAP11Factory()
+ .getDefaultEnvelope().getHeader());
+ Object os = messageContext
+ .getProperty(MessageContext.TRANSPORT_OUT);
+ outMsgContext.setProperty(MessageContext.TRANSPORT_OUT, os);
+ Object ti = messageContext
+ .getProperty(HTTPConstants.HTTPOutTransportInfo);
+ outMsgContext.setProperty(HTTPConstants.HTTPOutTransportInfo, ti);
+
+ SynapseDispatcher sd = new SynapseDispatcher();
+ sd.initDispatcher();
+ AxisService synapseService = sd.findService(messageContext);
+ AxisOperation synapseOperation = sd.findOperation(synapseService,
+ messageContext);
+
+ outMsgContext.setConfigurationContext(sc);
+ outMsgContext.setAxisService(synapseService);
+ outMsgContext.setAxisOperation(synapseOperation);
+ outMsgContext.setOperationContext(OperationContextFactory
+ .createOperationContext(
+ OperationContextFactory.MEP_CONSTANT_OUT_ONLY,
+ synapseOperation));
+
+ ae.receive(outMsgContext);
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new SynapseException(e);
+ }
+ }
+
+ public static void sendBack(SynapseMessage smc) {
+ MessageContext messageContext = ((Axis2SynapseMessage) smc)
+ .getMessageContext();
+ AxisEngine ae = new AxisEngine(messageContext.getSystemContext());
+
+ if (messageContext.getEnvelope().getHeader() == null)
+ messageContext.getEnvelope().getBody().insertSiblingBefore(
+ OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope()
+ .getHeader());
+
+ messageContext.setProperty(Constants.ISRESPONSE_PROPERTY, new Boolean(
+ true));
+
+ try {
+ ae.send(messageContext);
+ } catch (AxisFault e) {
+ throw new SynapseException(e);
+
+ }
+
+ }
+
+}
Added: incubator/synapse/trunk/java/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.java?rev=350001&view=auto
==============================================================================
--- incubator/synapse/trunk/java/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.java (added)
+++ incubator/synapse/trunk/java/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.java Wed Nov 30 09:26:22 2005
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.synapse.axis2;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.axis2.om.OMElement;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.apache.synapse.Processor;
+import org.apache.synapse.SynapseEnvironment;
+import org.apache.synapse.SynapseMessage;
+
+import org.apache.synapse.xml.ProcessorConfiguratorFinder;
+
+/**
+ *
+ *
+ *
+ * <p> This is the Axis2 implementation of the SynapseEnvironment
+ *
+ */
+public class Axis2SynapseEnvironment implements SynapseEnvironment {
+ private Processor mainprocessor = null;
+
+ private ClassLoader cl = null;
+
+ private Map processors = new HashMap();
+
+ private Log log = LogFactory.getLog(getClass());
+
+ public Axis2SynapseEnvironment(OMElement synapseConfiguration,
+ ClassLoader cl) {
+ super();
+ this.cl = cl;
+ mainprocessor = ProcessorConfiguratorFinder.getProcessor(this, synapseConfiguration);
+ }
+
+ public void injectMessage(SynapseMessage smc) {
+ mainprocessor.process(this, smc);
+ }
+
+ public ClassLoader getClassLoader() {
+ return cl;
+ }
+
+ public void setClassLoader(ClassLoader cl) {
+ this.cl = cl;
+ }
+
+ public void send(SynapseMessage sm) {
+ if (sm.isResponse())
+ Axis2Sender.sendBack(sm);
+ else
+ Axis2Sender.sendOn(sm);
+ }
+
+
+ public Processor lookupProcessor(String name) {
+ return (Processor) processors.get(name);
+ }
+
+ public void addProcessor(Processor p) {
+ log.debug("adding processor with name " + p.getName());
+ if (processors.containsKey(p.getName()))
+ log.warn("name " + p.getName() + "already present");
+ processors.put(p.getName(), p);
+ }
+
+ public Processor getMasterProcessor() {
+ return mainprocessor;
+ }
+
+ public void setMasterProcessor(Processor p) {
+ mainprocessor = p;
+ }
+}
Added: incubator/synapse/trunk/java/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.java?rev=350001&view=auto
==============================================================================
--- incubator/synapse/trunk/java/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.java (added)
+++ incubator/synapse/trunk/java/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.java Wed Nov 30 09:26:22 2005
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.synapse.axis2;
+
+import java.io.InputStream;
+
+import javax.xml.stream.XMLStreamException;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.description.Parameter;
+import org.apache.axis2.description.ParameterImpl;
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.om.OMElement;
+import org.apache.axis2.om.impl.llom.builder.StAXOMBuilder;
+
+import org.apache.synapse.SynapseEnvironment;
+import org.apache.synapse.SynapseException;
+import org.apache.synapse.Constants;
+
+/**
+
+
+ *
+ * <p>
+ * The SynapseEnvironment needs to be set up and then is used by the SynapseMessageReceiver to inject messages.
+ * This class is used by the SynapseMessageReceiver to find the environment. The env is stored in a Parameter to the Axis2 config
+ *
+ *
+ */
+public class Axis2SynapseEnvironmentFinder implements Constants {
+
+ public static synchronized SynapseEnvironment getSynapseEnvironment(
+ MessageContext mc) {
+ AxisConfiguration ac = mc.getSystemContext().getAxisConfiguration();
+ Parameter synapseEnvParam = ac.getParameter(SYNAPSE_ENVIRONMENT);
+ if (synapseEnvParam == null) {
+
+ Parameter param = ac.getParameter(SYNAPSECONFIGURATION);
+ if (param == null) {
+ throw new SynapseException("no parameter '"
+ + SYNAPSECONFIGURATION + "' in axis2.xml");
+ }
+ String synapseConfig = (String) param.getValue();
+ InputStream is = mc.getAxisService().getClassLoader()
+ .getResourceAsStream(synapseConfig);
+
+ StAXOMBuilder builder;
+ try {
+ builder = new StAXOMBuilder(is);
+
+ } catch (XMLStreamException e1) {
+ throw new SynapseException(
+ "Trouble parsing Synapse Configuration ", e1);
+
+ }
+ OMElement config = builder.getDocumentElement();
+ // todo: ---- following needed to be added.
+ config.build();
+ Axis2SynapseEnvironment se = new Axis2SynapseEnvironment(config, mc
+ .getAxisService().getClassLoader());
+
+ synapseEnvParam = new ParameterImpl(SYNAPSE_ENVIRONMENT, null);
+ synapseEnvParam.setValue(se);
+ try {
+ ac.addParameter(synapseEnvParam);
+ } catch (AxisFault e) {
+ throw new SynapseException(e);
+ }
+ }
+ return (SynapseEnvironment) synapseEnvParam.getValue();
+
+ }
+
+}
Added: incubator/synapse/trunk/java/src/org/apache/synapse/axis2/Axis2SynapseMessage.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/src/org/apache/synapse/axis2/Axis2SynapseMessage.java?rev=350001&view=auto
==============================================================================
--- incubator/synapse/trunk/java/src/org/apache/synapse/axis2/Axis2SynapseMessage.java (added)
+++ incubator/synapse/trunk/java/src/org/apache/synapse/axis2/Axis2SynapseMessage.java Wed Nov 30 09:26:22 2005
@@ -0,0 +1,208 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.synapse.axis2;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.addressing.RelatesTo;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.soap.SOAPEnvelope;
+import org.apache.synapse.Constants;
+import org.apache.synapse.SynapseMessage;
+
+/**
+ *
+ *
+ * <p>
+ * A wrapper on Axis2's Message Context that implements the SynapseMessage interface
+ *
+ */
+public class Axis2SynapseMessage implements SynapseMessage {
+
+ private MessageContext mc = null;
+
+ private Map props = new HashMap();
+
+ private boolean response = false;
+
+ public Axis2SynapseMessage(MessageContext mc) {
+ setMessageContext(mc);
+ Boolean resp = (Boolean) mc.getProperty(Constants.ISRESPONSE_PROPERTY);
+ if (resp != null)
+ response = resp.booleanValue();
+ }
+
+ public EndpointReference getFaultTo() {
+ return mc.getFaultTo();
+ }
+
+ public void setFaultTo(EndpointReference reference) {
+ mc.setFaultTo(reference);
+ }
+
+ public EndpointReference getFrom() {
+ return mc.getFrom();
+ }
+
+ public void setFrom(EndpointReference reference) {
+ mc.setFrom(reference);
+
+ }
+
+ public SOAPEnvelope getEnvelope() {
+
+ return mc.getEnvelope();
+ }
+
+ public void setEnvelope(SOAPEnvelope envelope) throws AxisFault {
+ mc.setEnvelope(envelope);
+
+ }
+
+ public String getMessageID() {
+ return mc.getMessageID();
+ }
+
+ public void setMessageID(String string) {
+ mc.setMessageID(string);
+
+ }
+
+ public RelatesTo getRelatesTo() {
+ return getRelatesTo();
+
+ }
+
+ public void setRelatesTo(RelatesTo reference) {
+ mc.setRelatesTo(reference);
+
+ }
+
+ public EndpointReference getReplyTo() {
+ return mc.getReplyTo();
+
+ }
+
+ public void setReplyTo(EndpointReference reference) {
+ mc.setReplyTo(reference);
+
+ }
+
+ public EndpointReference getTo() {
+ return mc.getTo();
+
+ }
+
+ public void setTo(EndpointReference reference) {
+ mc.setTo(reference);
+
+ }
+
+ public void setWSAAction(String actionURI) {
+ mc.setWSAAction(actionURI);
+
+ }
+
+ public String getWSAAction() {
+
+ return mc.getWSAAction();
+ }
+
+ public void setWSAMessageId(String messageID) {
+ mc.setWSAMessageId(messageID);
+
+ }
+
+ public String getWSAMessageId() {
+ return mc.getWSAMessageId();
+ }
+
+ public Object getProperty(String key) {
+ Object obj = props.get(key);
+ if ( obj == null) {
+ obj = mc.getProperty(key);
+ }
+ return obj;
+
+ }
+
+ public void setProperty(String key, Object value) {
+ props.put(key, value);
+ }
+
+ public Iterator getPropertyNames() {
+ return props.keySet().iterator();
+ }
+
+ public String getSoapAction() {
+ return mc.getSoapAction();
+ }
+
+ public void setSoapAction(String string) {
+ mc.setSoapAction(string);
+
+ }
+
+ public boolean isDoingMTOM() {
+
+ return mc.isDoingMTOM();
+ }
+
+ public void setDoingMTOM(boolean b) {
+ mc.setDoingMTOM(b);
+
+ }
+
+ public boolean isDoingREST() {
+
+ return mc.isDoingREST();
+ }
+
+ public void setDoingREST(boolean b) {
+ mc.setDoingREST(b);
+
+ }
+
+ public boolean isSOAP11() {
+
+ return mc.isSOAP11();
+ }
+
+ public MessageContext getMessageContext() {
+ return mc;
+ }
+
+ public void setMessageContext(MessageContext mc) {
+ this.mc = mc;
+ Boolean resp = (Boolean) mc.getProperty(Constants.ISRESPONSE_PROPERTY);
+ if (resp != null)
+ response = resp.booleanValue();
+ }
+
+ public void setResponse(boolean b) {
+ response = b;
+ mc.setProperty(Constants.ISRESPONSE_PROPERTY, new Boolean(b));
+ }
+
+ public boolean isResponse() {
+ return response;
+ }
+
+}
Added: incubator/synapse/trunk/java/src/org/apache/synapse/axis2/EmptyMessageReceiver.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/src/org/apache/synapse/axis2/EmptyMessageReceiver.java?rev=350001&view=auto
==============================================================================
--- incubator/synapse/trunk/java/src/org/apache/synapse/axis2/EmptyMessageReceiver.java (added)
+++ incubator/synapse/trunk/java/src/org/apache/synapse/axis2/EmptyMessageReceiver.java Wed Nov 30 09:26:22 2005
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.synapse.axis2;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+
+import org.apache.axis2.engine.MessageReceiver;
+import org.apache.synapse.Constants;
+
+/**
+ *
+ * <p>Does nothing! Used as an endpoint so we can engage modules
+ *
+ */
+public class EmptyMessageReceiver implements MessageReceiver {
+
+ public void receive(MessageContext mc) throws AxisFault {
+ mc.setProperty(Constants.MEDIATOR_RESPONSE_PROPERTY, Boolean
+ .valueOf(true));
+ }
+
+}
Added: incubator/synapse/trunk/java/src/org/apache/synapse/axis2/META-INF/module.xml
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/src/org/apache/synapse/axis2/META-INF/module.xml?rev=350001&view=auto
==============================================================================
--- incubator/synapse/trunk/java/src/org/apache/synapse/axis2/META-INF/module.xml (added)
+++ incubator/synapse/trunk/java/src/org/apache/synapse/axis2/META-INF/module.xml Wed Nov 30 09:26:22 2005
@@ -0,0 +1,7 @@
+<module name="synapse">
+ <inflow>
+ <handler name="SynapseDispatcher" class="org.apache.synapse.axis2.SynapseDispatcher">
+ <order phaseFirst="true" phase="Dispatch"/>
+ </handler>
+ </inflow>
+</module>
\ No newline at end of file
Added: incubator/synapse/trunk/java/src/org/apache/synapse/axis2/SynapseDispatcher.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/src/org/apache/synapse/axis2/SynapseDispatcher.java?rev=350001&view=auto
==============================================================================
--- incubator/synapse/trunk/java/src/org/apache/synapse/axis2/SynapseDispatcher.java (added)
+++ incubator/synapse/trunk/java/src/org/apache/synapse/axis2/SynapseDispatcher.java Wed Nov 30 09:26:22 2005
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.synapse.axis2;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.OperationContext;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.HandlerDescription;
+import org.apache.axis2.engine.AbstractDispatcher;
+import org.apache.axis2.engine.AxisConfiguration;
+
+/**
+ *
+ *
+ * This sends every message to the SynapseMessageReceiver so that it can pass them to Synapse
+ *
+ */
+public class SynapseDispatcher extends AbstractDispatcher {
+ // FOR EVERY REQUEST - ALWAYS DISPATH TO THE SYNAPSE SERVICE
+
+ private static final long serialVersionUID = -6970206989111592645L;
+
+ private static final String SYNAPSE_SERVICE_NAME = "synapse";
+
+ private static final String MEDIATE_OPERATION_NAME = "mediate";
+
+ public void initDispatcher() {
+ QName qn = new QName("http://synapse.apache.org", "SynapseDispatcher");
+ HandlerDescription hd = new HandlerDescription(qn);
+ super.init(hd);
+
+ }
+
+ public AxisService findService(MessageContext mc) throws AxisFault {
+ AxisConfiguration ac = mc.getSystemContext().getAxisConfiguration();
+ AxisService as = ac.getService(SYNAPSE_SERVICE_NAME);
+ // TODO handle missing config
+ return as;
+ }
+
+ public AxisOperation findOperation(AxisService svc, MessageContext mc)
+ throws AxisFault {
+
+ AxisOperation ao = svc.getOperation(MEDIATE_OPERATION_NAME);
+ // code taken from InstanceDispatcher
+ OperationContext oc = new OperationContext(ao);
+
+ ao.registerOperationContext(mc, oc);
+
+ // fill the service group context and service context info
+ mc.getSystemContext().fillServiceContextAndServiceGroupContext(mc);
+ // TODO handle missing config
+ return ao;
+ }
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org