You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by as...@apache.org on 2007/04/27 10:04:44 UTC
svn commit: r533007 - in /webservices/synapse/trunk/java:
modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/
repository/conf/sample/ repository/conf/sample/resources/script/
src/main/assembly/ src/main/release/ src/main/release/docs/ sr...
Author: asankha
Date: Fri Apr 27 01:04:42 2007
New Revision: 533007
URL: http://svn.apache.org/viewvc?view=rev&rev=533007
Log:
various updates to documentation and samples and release docs to prep for 1.0
Removed:
webservices/synapse/trunk/java/src/site/resources/Synapse_Userguide.html
Modified:
webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/ScriptMediator.java
webservices/synapse/trunk/java/repository/conf/sample/resources/script/stockquoteTransform.rb
webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_503.xml
webservices/synapse/trunk/java/src/main/assembly/bin.xml
webservices/synapse/trunk/java/src/main/release/BUILDING.txt
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_Extending.html
webservices/synapse/trunk/java/src/site/resources/Synapse_Samples.html
webservices/synapse/trunk/java/src/site/resources/Synapse_Samples_Setup.html
Modified: webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/ScriptMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/ScriptMediator.java?view=diff&rev=533007&r1=533006&r2=533007
==============================================================================
--- webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/ScriptMediator.java (original)
+++ webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/ScriptMediator.java Fri Apr 27 01:04:42 2007
@@ -37,6 +37,10 @@
import org.apache.synapse.config.Entry;
import org.apache.synapse.mediators.AbstractMediator;
+import java.io.Writer;
+import java.io.StringWriter;
+import java.io.PrintWriter;
+
/**
* A Synapse mediator that calls a function in any scripting language supported by the BSF.
* The ScriptMediator supports scripts specified in-line or those loaded through a registry
@@ -191,7 +195,9 @@
}
} catch (ScriptException e) {
- handleException("Error executing inline " + language + " script", e);
+ handleException("The Script engine returned an error executing the " +
+ (key == null ? "inline " : "external ") + language + " script" +
+ (key != null? " : " + key : ""), e);
returnValue = false;
}
return returnValue;
Modified: webservices/synapse/trunk/java/repository/conf/sample/resources/script/stockquoteTransform.rb
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/repository/conf/sample/resources/script/stockquoteTransform.rb?view=diff&rev=533007&r1=533006&r2=533007
==============================================================================
--- webservices/synapse/trunk/java/repository/conf/sample/resources/script/stockquoteTransform.rb (original)
+++ webservices/synapse/trunk/java/repository/conf/sample/resources/script/stockquoteTransform.rb Fri Apr 27 01:04:42 2007
@@ -1,52 +1,37 @@
<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you 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.
- -->
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you 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.
+ -->
<x><![CDATA[
-
require 'rexml/document'
include REXML
-def transformRequest(mc)
- newRequest= Document.new($REQUEST)
- newRequest.root.elements[1].text = mc.getPayloadXML().root.elements[1].get_text
- mc.setPayloadXML(newRequest)
+def transformRequest(mc)
+ newRequest= Document.new '<m:getQuote xmlns:m="http://services.samples/xsd">'<<
+ '<m:request><m:symbol></m:symbol></m:request></m:getQuote>'
+ newRequest.root.elements[1].elements[1].text = mc.getPayloadXML().root.elements[1].get_text
+ mc.setPayloadXML(newRequest)
end
-def transformResponse(mc)
- newResponse = Document.new($RESPONSE)
- newResponse.root.elements[1].text = mc.getPayloadXML().root.elements[1].elements[1].get_text
- newResponse.root.elements[2].text = mc.getPayloadXML().root.elements[1].elements[2].get_text
- mc.setPayloadXML(newResponse)
+def transformResponse(mc)
+ newResponse = Document.new '<m:CheckPriceResponse xmlns:m="http://www.apache-synapse.org/test"><m:Code>' <<
+ '</m:Code><m:Price></m:Price></m:CheckPriceResponse>'
+ newResponse.root.elements[1].text = mc.getPayloadXML().root.elements[1].elements[1].get_text
+ newResponse.root.elements[2].text = mc.getPayloadXML().root.elements[1].elements[2].get_text
+ mc.setPayloadXML(newResponse)
end
-
-$REQUEST = <<EOF
- <m:getQuote xmlns:m="http://services.samples/xsd">
- <m:request>
- <m:symbol></m:symbol>
- </m:request>
- </m:getQuote>
-EOF
-
-$RESPONSE = <<EOF
- <m:CheckPriceResponse xmlns:m="http://www.apache-synapse.org/test">
- <m:Code></m:Code>
- <m:Price></m:Price>
- </m:CheckPriceResponse>
-EOF
-
]]></x>
Modified: webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_503.xml
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_503.xml?view=diff&rev=533007&r1=533006&r2=533007
==============================================================================
--- webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_503.xml (original)
+++ webservices/synapse/trunk/java/repository/conf/sample/synapse_sample_503.xml Fri Apr 27 01:04:42 2007
@@ -19,10 +19,7 @@
<!-- Introduction to the script mediator with Ruby scripts-->
<definitions xmlns="http://ws.apache.org/ns/synapse">
- <localEntry key="stockquoteScript">
- <address src="file:repository/conf/sample/resources/script/stockquoteTransform.rb"/>
- </localEntry>
-
+ <localEntry key="stockquoteScript" src="file:repository/conf/sample/resources/script/stockquoteTransform.rb"/>
<in>
<!-- transform the custom quote request into a standard quote request expected by the service -->
<script language="rb" key="stockquoteScript" function="transformRequest"/>
@@ -30,7 +27,7 @@
<!-- send message to real endpoint referenced by name "stockquote" and stop -->
<send>
<endpoint name="stockquote">
- <address uri="http://localhost:9000/axis2/services/SimpleStockQuoteService"/>
+ <address uri="http://localhost:9000/soap/SimpleStockQuoteService"/>
</endpoint>
</send>
</in>
Modified: webservices/synapse/trunk/java/src/main/assembly/bin.xml
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/src/main/assembly/bin.xml?view=diff&rev=533007&r1=533006&r2=533007
==============================================================================
--- webservices/synapse/trunk/java/src/main/assembly/bin.xml (original)
+++ webservices/synapse/trunk/java/src/main/assembly/bin.xml Fri Apr 27 01:04:42 2007
@@ -97,16 +97,7 @@
<include>Synapse_Samples.html</include>
<include>Synapse_Samples_Setup.html</include>
<include>Synapse_QuickStart.html</include>
- <include>userguide.html</include>
- <include>extending_synapse.html</include>
- </includes>
- </fileSet>
- <fileSet>
- <directory>src/site/resources</directory>
- <outputDirectory>synapse-${synapse.version}/docs</outputDirectory>
- <includes>
- <include>Synapse_Samples.html</include>
- <include>sample_*.txt</include>
+ <include>Synapse_Extending.html</include>
</includes>
</fileSet>
<fileSet>
Modified: webservices/synapse/trunk/java/src/main/release/BUILDING.txt
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/src/main/release/BUILDING.txt?view=diff&rev=533007&r1=533006&r2=533007
==============================================================================
--- webservices/synapse/trunk/java/src/main/release/BUILDING.txt (original)
+++ webservices/synapse/trunk/java/src/main/release/BUILDING.txt Fri Apr 27 01:04:42 2007
@@ -2,21 +2,18 @@
The Synapse source code is available at http://svn.apache.org/repos/asf/webservices/synapse/trunk/java
-To build Synapse, you will need JDK 1.4.x or 1.5.x., Maven 2 and any of its dependencies.
+To build Synapse, you will need JDK 1.5.x., Maven 2.0.6
-The Synapse JARs could be built with maven 2 as follows:
+The Synapse JARs could be built with Maven 2 as follows:
-mvn clean install
+ mvn clean install
-Note: If you encounter any issues with Maven 2 complaining of invalid POMs refer to this ->
-http://www.nabble.com/forum/ViewPost.jtp?post=7437760&framed=y
+To build the Synapse distributions, use the following:
-To build the Synapse distribution, use the following:
+ mvn assembly:assembly -Drelease
-mvn assembly:assembly -Drelease
-
-This will build the source and binary distributions in the target folder.
+This will build the source and binary distributions in the target folder created.
To build the site, use:
-mvn site
+ mvn site
Modified: webservices/synapse/trunk/java/src/main/release/LICENSE
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/src/main/release/LICENSE?view=diff&rev=533007&r1=533006&r2=533007
==============================================================================
--- webservices/synapse/trunk/java/src/main/release/LICENSE (original)
+++ webservices/synapse/trunk/java/src/main/release/LICENSE Fri Apr 27 01:04:42 2007
@@ -215,57 +215,6 @@
The exceptions are as follows:
===========================
-avalon-framework-4.1.3.jar
-===========================
-
- ============================================================================
- The Apache Software License, Version 1.1
- ============================================================================
-
- Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without modifica-
- tion, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- 3. The end-user documentation included with the redistribution, if any, must
- include the following acknowledgment: "This product includes software
- developed by the Apache Software Foundation (http://www.apache.org/)."
- Alternately, this acknowledgment may appear in the software itself, if
- and wherever such third-party acknowledgments normally appear.
-
- 4. The names "Jakarta", "Apache Avalon", "Avalon Framework" and
- "Apache Software Foundation" must not be used to endorse or promote
- products derived from this software without prior written
- permission. For written permission, please contact apache@apache.org.
-
- 5. Products derived from this software may not be called "Apache", nor may
- "Apache" appear in their name, without prior written permission of the
- Apache Software Foundation.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- This software consists of voluntary contributions made by many individuals
- on behalf of the Apache Software Foundation. For more information on the
- Apache Software Foundation, please see <http://www.apache.org/>.
-
-
-===========================
activation.jar
mail-1.4.jar
===========================
@@ -406,7 +355,7 @@
====================
-jaxen-1.-beta-10.jar
+jaxen-1.1-beta-10.jar
====================
Copyright 2003-2006 The Werken Company. All Rights Reserved.
@@ -438,5 +387,49 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+=====================
+groovy-all-1.0.jar
+=====================
+
+ Copyright 2003 (C) James Strachan and Bob Mcwhirter. All Rights Reserved.
+
+ Redistribution and use of this software and associated documentation
+ ("Software"), with or without modification, are permitted provided
+ that the following conditions are met:
+
+ 1. Redistributions of source code must retain copyright
+ statements and notices. Redistributions must also contain a
+ copy of this document.
+
+ 2. Redistributions in binary form must reproduce the
+ above copyright notice, this list of conditions and the
+ following disclaimer in the documentation and/or other
+ materials provided with the distribution.
+
+ 3. The name "groovy" must not be used to endorse or promote
+ products derived from this Software without prior written
+ permission of The Codehaus. For written permission,
+ please contact info@codehaus.org.
+
+ 4. Products derived from this Software may not be called "groovy"
+ nor may "groovy" appear in their names without prior written
+ permission of The Codehaus. "groovy" is a registered
+ trademark of The Codehaus.
+
+ 5. Due credit should be given to The Codehaus -
+ http://groovy.codehaus.org/
+
+ THIS SOFTWARE IS PROVIDED BY THE CODEHAUS AND CONTRIBUTORS
+ ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
+ NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ THE CODEHAUS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------------------------------
Modified: webservices/synapse/trunk/java/src/main/release/NOTICE
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/src/main/release/NOTICE?view=diff&rev=533007&r1=533006&r2=533007
==============================================================================
--- webservices/synapse/trunk/java/src/main/release/NOTICE (original)
+++ webservices/synapse/trunk/java/src/main/release/NOTICE Fri Apr 27 01:04:42 2007
@@ -14,8 +14,9 @@
COPYRIGHT NOTICES
-* Synapse binary is bundled with jaxen-1.1-beta-10.jar
+* Synapse binary is bundled with:
+ jaxen-1.1-beta-10.jar
Copyright 2003-2006 The Werken Company. All Rights Reserved.
-
-
+ groovy-all-1.0.jar
+ Copyright 2003 (C) James Strachan and Bob Mcwhirter. All Rights Reserved.
Modified: webservices/synapse/trunk/java/src/main/release/README.txt
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/src/main/release/README.txt?view=diff&rev=533007&r1=533006&r2=533007
==============================================================================
--- webservices/synapse/trunk/java/src/main/release/README.txt (original)
+++ webservices/synapse/trunk/java/src/main/release/README.txt Fri Apr 27 01:04:42 2007
@@ -1,20 +1,56 @@
-Apache Synapse 0.91 build (January 2007)
-
-http://ws.apache.org/synapse/
-------------------------------------------------------
-
-Synapse graduated from the Apache Incubator on the 2nd of January 2007. The 0.91 release
-is its first public release after graduation.
-
+Apache Synapse 1.0 build (May 2007) - http://ws.apache.org/synapse/
+------------------------------------------------------------------------------------------
+
+-------------------
+First Steps
+===================
+
+Once you extract the downloaded binary distribution, it will create the following directory
+structure.
+
+ synapse
+ /bin
+ synapse.sh
+ synapse.bat
+ /docs
+ <documentation>
+ /lib
+ <libraries>
+ log4j.properties
+ /repository
+ /conf
+ synapse.xml
+ axis2.xml
+ /sample
+ <sample configuration files>
+ /resources
+ <sample resources>
+ /samples
+ /axis2Client
+ <ant script to run sample clients>
+ /axis2Server
+ axis2Server.sh
+ axis2Server.bat
+ /src/
+ <sample services source>
+
+
+You could start Synapse using the bin/synapse.sh or bin/synapse.bat script, which will load
+the configuration found in repository/conf/synapse.xml. To configure the underlying Axis2
+SOAP engine (e.g. to enable JMS) you need to configure the repository/conf/axis2.xml. To
+configure logging levels and to turn on/off debug level logging, please configure the
+lib/log4j.properties file, and set the line "log4j.category.org.apache.synapse=DEBUG" as
+"log4j.category.org.apache.synapse=INFO"
+
-------------------
Documentation
===================
-Documentation can be found in the 'docs' directory included with the
-binary distribution and in the 'src/site/resources' directory in the source
-distribution.
+Documentation can be found in the 'docs' directory included with the binary distribution
+and in the 'src/site/resources' directory in the source distribution.
-For examples on Apache Synapse message mediation please see the Synapse_Samples.html
+For Synapse mediation samples please see the Synapse_Quickstart.html, Synapse_Samples.html
+and Synapse_Samples_Setup.html
For more information on the Synapse Configuration language syntax and useage refer to
Synapse_Configuration_Language.html
@@ -23,26 +59,28 @@
Getting Started
===================
-Refer to the Synapse_Samples.html document for examples of Synapse usage and configuration.
+Refer to the Synapse_Quickstart.html document to get started with Synapse in just a couple of minutes.
+
+More indepth samples could be found in Synapse_Samples_Setup.html and Synapse_Samples.html found in
+the docs directory.
The actual sample Synapse configurations could be found at <SYNAPSE>/respository/conf/sample.
The resources sub-directory contains the sample XSLT transformations, XSD schemas, WS policies
and all other resources required to demonstrate various aspects of Synapse.
-
+-------------------
Support
===================
-Any issues with this release can be reported to Apache Synapse mailing list
-or in the JIRA issue tracker.
+Any issues with this release can be reported to Apache Synapse mailing list or in the JIRA issue tracker.
Mailing list subscription:
- synapse-dev-subscribe@ws.apache.org
+ synapse-dev-subscribe@ws.apache.org
+ synapse-user-subscribe@ws.apache.org
Jira:
http://issues.apache.org/jira/browse/Synapse
Thank you for using Synapse!
-
-
The Synapse Team.
+
Modified: webservices/synapse/trunk/java/src/main/release/docs/release_notes.txt
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/src/main/release/docs/release_notes.txt?view=diff&rev=533007&r1=533006&r2=533007
==============================================================================
--- webservices/synapse/trunk/java/src/main/release/docs/release_notes.txt (original)
+++ webservices/synapse/trunk/java/src/main/release/docs/release_notes.txt Fri Apr 27 01:04:42 2007
@@ -1,26 +1,43 @@
-Apache Synapse 0.91 Release Notes
+Apache Synapse 1.0 Release Notes
1. Overview
-Apache Synapse is a highly flexible XML router and mediator that can be the basis of your SOA infrastructure.
+The Synapse project is a robust, lightweight implementation of a highly scalable and distributed
+service mediation framework based on Web services and XML specifications.
Apache Synapse graduated from the Apache Incubator on the 2nd of January 2007
Please see http://ws.apache.org/synapse/
2. Installation Prerequisites
-Apache Synapse requires either JDK1.4 or JDK1.5
+Apache Synapse requires a J2SE runtime of version 1.4.2 or later for runtime. However, to build
+Synapse from source, you will need JDK 1.5 or later and Apache Maven 2.0.6
-3. Building the Samples
-Please see the document docs/Synapse_Samples.html
+3. Quick start
+Please see the docs/Synapse_Quickstart.html guide
-4. Known Problems
-Incoming POX support does not work at this time.
+4. Building the Samples
+Please see the documents docs/Synapse_Samples.html and docs/Synapse_Samples_Setup.html
+
+3. Synapse configuration language
+Please see the document docs/Synapse_Configuration_Language.html
+
+4. Known Issues
5. Reporting Problems
-Please use Apache's JIRA system (http://issues.apache.org/jira/) to report issues you find. You may also join the synapse-dev mailing list by
-sending email to synapse-dev-subscribe@ws.apache.org
+Please use Apache's JIRA system (http://issues.apache.org/jira/) to report issues you find.
+You may also join the:
+ synapse-dev mailing list by sending email to synapse-dev-subscribe@ws.apache.org
+ synapse-user mailing list by sending email to synapse-user-subscribe@ws.apache.org
6. New features
+The 1.0 release
+ * Non blocking HTTP and HTTPS transport based on Apache HttpCore/NIO
+ * Enhanced Proxy services with in/out/fault sequences and endpoints, inline sequence and WSDL
+ support
+ * WSDL endpoints
+ * Load balancing and Failover endpoints
+ * Throttling mediator
+
The 0.91 release adds support for:
* WS-Reliable Messaging Sequence management
The 0.90 release adds support for:
Modified: webservices/synapse/trunk/java/src/site/resources/Synapse_Extending.html
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/src/site/resources/Synapse_Extending.html?view=diff&rev=533007&r1=533006&r2=533007
==============================================================================
--- webservices/synapse/trunk/java/src/site/resources/Synapse_Extending.html (original)
+++ webservices/synapse/trunk/java/src/site/resources/Synapse_Extending.html Fri Apr 27 01:04:42 2007
@@ -1,32 +1,125 @@
<!--
-~ Licensed to the Apache Software Foundation (ASF) under one
-~ or more contributor license agreements. See the NOTICE file
-~ distributed with this work for additional information
-~ regarding copyright ownership. The ASF licenses this file
-~ to you 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
+~ Licensed to the Apache Software Foundation (ASF) under one
+~ or more contributor license agreements. See the NOTICE file
+~ distributed with this work for additional information
+~ regarding copyright ownership. The ASF licenses this file
+~ to you 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
+~ 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.
+~ 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.
-->
<html>
<head>
<meta content="text/html; charset=iso-8859-1" http-equiv="content-type">
<title>Extending Synapse</title>
+ <style type="text/css">
+ .command {
+ border: 1px dashed #3c78b5;
+ text-align: left;
+ background-color: #f0f0f0;
+ padding: 3px;
+ font-size: 11px;
+ font-family: Courier;
+ margin: 10px;
+ line-height: 13px;
+ }
+ .consoleOutput {
+ border: 1px dashed #3c78b5;
+ font-size: 11px;
+ font-family: Courier;
+ margin: 10px;
+ line-height: 13px;
+ background-color: #f0f0f0;
+ border-bottom: 1px dashed #3c78b5;
+ padding: 3px;
+ border-style: solid;
+ }
+ .info {
+ border-style: solid;
+ border-width: 1px;
+ border-color: #090;
+ background-color: #dfd;
+ text-align:left;
+ margin-top: 5px;
+ margin-bottom: 5px;
+ }
+ li {
+ font-family: Verdana, arial, sans-serif;
+ font-size: 11px;
+ line-height: 16px;
+ color: #000000;
+ font-weight: normal;
+ }
+ p {
+ font-family: Verdana, arial, sans-serif;
+ font-size: 11px;
+ line-height: 16px;
+ color: #000000;
+ font-weight: normal;
+ }
+ pre {
+ padding: 0px;
+ margin-top: 5px;
+ margin-left: 15px;
+ margin-bottom: 5px;
+ margin-right: 5px;
+ text-align: left;
+ background-color: #f0f0f0;
+ padding: 3px;
+ border: 1px dashed #3c78b5;
+ font-size: 11px;
+ font-family: Courier;
+ margin: 10px;
+ line-height: 13px;
+ }
+ h1 {
+ font-size: 24px;
+ line-height: normal;
+ font-weight: bold;
+ background-color: #f0f0f0;
+ color: #003366;
+ border-bottom: 1px solid #3c78b5;
+ padding: 2px;
+ margin: 36px 0px 4px 0px;
+ }
+ h2 {
+ font-size: 18px;
+ line-height: normal;
+ font-weight: bold;
+ background-color: #f0f0f0;
+ border-bottom: 1px solid #3c78b5;
+ padding: 2px;
+ margin: 27px 0px 4px 0px;
+ }
+ h3 {
+ font-size: 14px;
+ line-height: normal;
+ font-weight: bold;
+ background-color: #f0f0f0;
+ padding: 2px;
+ margin: 21px 0px 4px 0px;
+ }
+ h4 {
+ font-size: 12px;
+ line-height: normal;
+ font-weight: bold;
+ background-color: #f0f0f0;
+ padding: 2px;
+ margin: 18px 0px 4px 0px;
+ }</style>
</head>
<body>
<h1>Extending Synapse<br>
</h1>
-<br>
-
<h2>Writing custom Mediator implementations</h2>
@@ -35,16 +128,16 @@
through the chain of mediators, for each and every message received and
processed by Synapse. Each message instance is wrapped within a
MessageContext instance, and the message context is set with the references
-to the SynapseConfiguration and SynapseEnvironments to be used. The
-SynapseConfiguration holds the global configuration model that defines
-message mediation rules and common definitions to be used, while the
-environment gives access to the underlying SOAP implementation used. A
-typical mediator would need to manipulate the MessageContext by referring to
-the SynapseConfiguration. However it is strongly recommended that the
-SynapseConfiguration should not be updated by mediator instances as it is
-shared by all messages, and may be updated by Synapse administration or
-configuration modules. Mediator instances may store custom named properties
-into the MessageContext for later retrieval by successive mediators.<br>
+to the SynapseConfiguration and SynapseEnvironments. The SynapseConfiguration
+holds the global configuration model that defines mediation rules, local
+registry entries and other and configuration, while the environment gives
+access to the underlying SOAP implementation used - Axis2. A typical mediator
+would need to manipulate the MessageContext by referring to the
+SynapseConfiguration. However it is strongly recommended that the
+SynapseConfiguration is not updated by mediator instances as it is shared by
+all messages, and may be updated by Synapse administration or configuration
+modules. Mediator instances may store local message properties into the
+MessageContext for later retrieval by successive mediators.<br>
</p>
<h4><a
@@ -127,12 +220,10 @@
<p>The MessageContext interface is based on the Axis2 <a>MessageContext</a>
interface, and uses the Axis2 <a>EndpointReference</a> and SOAPEnvelope
-classes/interfaces.</p>
-
-<p>The purpose of this interface is to capture a message as it flows through
-the system. As you will see the messages are represented using the SOAP
-infoset. Binary messages can be embedded in the Envelope using the MTOM
-support built into Axis2's AXIOM object model.</p>
+classes/interfaces. The purpose of this interface is to capture a message as
+it flows through the system. As you will see the message payload is
+represented using the SOAP infoset. Binary messages can be embedded in the
+Envelope using MTOM or SwA attachments using the AXIOM object model.</p>
<h4><a
href="http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/Mediator.java?view=markup">Mediator
@@ -178,10 +269,12 @@
usually designed to co-operate to process the message onwards.</p>
<h3>Leaf and Node Mediators, List mediators and Filter mediators</h3>
-Mediators may be Node mediators (i.e. these contain sub mediators) or Leaf
-mediators (mediators that does not hold any sub mediators). A Node mediator
-must implement the org.apache.synapse.api.ListMediator interface listed
-below, or extend from the org.apache.synapse.mediators.AbstractListMediator.
+
+<p>Mediators may be Node mediators (i.e. these that can contain child
+mediators) or Leaf mediators (mediators that does not hold any other child
+mediators). A Node mediator must implement the
+org.apache.synapse.api.ListMediator interface listed below, or extend from
+the org.apache.synapse.mediators.AbstractListMediator. </p>
<h4><a
href="http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/ListMediator.java?view=markup">The
@@ -236,11 +329,12 @@
*/
public List getList();
}</pre>
-A ListMediator implementation should call super.mediate(synCtx) to process
+
+<p>A ListMediator implementation should call super.mediate(synCtx) to process
its sub mediator sequence. A FilterMediator is a ListMediator which executes
-its sequence of sub mediators on successful outcome of a test condition.
+its sequence of sub mediators on successful outcome of a test condition. The
Mediator instance which performs filtering should implement the
-FilterMediator interface.
+FilterMediator interface. </p>
<h4><a
href="http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/FilterMediator.java?view=markup">FilterMediator
@@ -267,7 +361,8 @@
}</pre>
<h2>Writing custom Configuration implementations for mediators</h2>
-You may write your own custom configurator for the Mediator implementation
+
+<p>You may write your own custom configurator for the Mediator implementation
you write without relying on the Class mediator or Spring extension for its
initialization. You could thus write a MediatorFactory implementation which
defines how to digest a custom XML configuration element to be used to create
@@ -280,19 +375,20 @@
SYNAPSE_HOME/lib folder, so that the Synapse runtime could find and load the
definition. Essentially this means that a custom JAR file must bundle your
class implementing the Mediator interface, and the MediatorFactory
-implementation class and contain a text file by the name
-"org.apache.synapse.config.xml.MediatorFactory" which will contain the fully
-qualified name(s) of your MediatorFactory implementation class(es). You
-should also place any dependency JARs into the same lib folder so that the
-correct classpath references could be made. The MediatorFactory interface
-listing is given below, which you should implement, and its getTagQName()
-method must define the fully qualified element of interest for custom
-configuration. The Synapse initialization will call back to this
-MediatorFactory instance through the createMediator(OMElement elem) method
-passing in this XML element, so that an instance of the mediator could be
-created utilizing the custom XML specification and returned. See the
+implementation class and contain two text files named
+"org.apache.synapse.config.xml.MediatorFactory" and
+"org.apache.synapse.config.xml.MediatorSerializer" which will contain the
+fully qualified name(s) of your MediatorFactory and MediatorSerializer
+implementation classes. You should also place any dependency JARs into the
+same lib folder so that the correct classpath references could be made. The
+MediatorFactory interface listing is given below, which you should implement,
+and its getTagQName() method must define the fully qualified element of
+interest for custom configuration. The Synapse initialization will call back
+to this MediatorFactory instance through the createMediator(OMElement elem)
+method passing in this XML element, so that an instance of the mediator could
+be created utilizing the custom XML specification and returned. See the
ValidateMediator and the ValidateMediatorFactory classes under
-modules/extensions in the Synapse source distribution for examples.
+modules/extensions in the Synapse source distribution for examples. </p>
<h4><a
href="http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorFactory.java?view=markup">The
@@ -325,45 +421,51 @@
<h4><a
href="http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorSerializer.java?view=markup">The
MediatorSerializer interface</a></h4>
-<pre>/**</pre>
-<pre>* Interface which should be implemented by mediator serializers. Does the</pre>
-<pre>* reverse of the MediatorFactory</pre>
-<pre>*/</pre>
-<pre>public interface MediatorSerializer {</pre>
-<pre></pre>
-<pre> /**</pre>
-<pre> * Return the XML representation of this mediator</pre>
-<pre> * @param m mediator to be serialized</pre>
-<pre> * @param parent the OMElement to which the serialization should be attached</pre>
-<pre> * @return the serialized mediator XML</pre>
-<pre> */</pre>
-<pre> public OMElement serializeMediator(OMElement parent, Mediator m);</pre>
-<pre></pre>
-<pre> /**</pre>
-<pre> * Return the class name of the mediator which can be serialized</pre>
-<pre> * @return the class name</pre>
-<pre> */</pre>
-<pre> public String getMediatorClassName();</pre>
-<pre>}</pre>
+<pre>package org.apache.synapse.config.xml;
+
+import ...
+
+/**
+ * Interface which should be implemented by mediator serializers. Does the
+ * reverse of the MediatorFactory
+ */
+public interface MediatorSerializer {
+
+ /**
+ * Return the XML representation of this mediator
+ * @param m mediator to be serialized
+ * @param parent the OMElement to which the serialization should be attached
+ * @return the serialized mediator XML
+ */
+ public OMElement serializeMediator(OMElement parent, Mediator m);
+
+ /**
+ * Return the class name of the mediator which can be serialized
+ * @return the class name
+ */
+ public String getMediatorClassName();
+}</pre>
<h2>Configuring mediators</h2>
-Mediators could access properties defined into the Synapse configuration to
+
+<p>Mediators could access the Synapse registry to load resources and
configure the local behaviour. Refer to the Spring mediator and Script
-mediator implementations for examples on how this could be achieved.
+mediator implementations for examples on how this could be achieved. </p>
<h4>Loading of Extensions by the Synapse runtime</h4>
-Synapse loads available extensions from the runtime classpath using the <a
+
+<p>Synapse loads available extensions from the runtime classpath using the <a
href="http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html#Service%20Provider">J2SE
Service Provider model</a>. This essentially iterates over the available JAR
files, for a META-INF/services directory within each file, and looks for a
-text file with the name org.apache.synapse.config.xml.ExtensionFactory which
+text file with the name org.apache.synapse.config.xml.MediatorFactory which
contains a list of fully qualified classname that implement the above
interface, listing each class in a separate line. e.g. The built-in
-synapse-extensions.jar contains the following structure
+synapse-extensions.jar contains the following structure</p>
<pre>synapse-extensions.jar
/META-INF/services
- org.apache.synapse.config.xml.ExtensionFactory
org.apache.synapse.config.xml.MediatorFactory
+ org.apache.synapse.config.xml.MediatorSerializer
/... the implementation classes as usual...</pre>
</body>
</html>
Modified: webservices/synapse/trunk/java/src/site/resources/Synapse_Samples.html
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/src/site/resources/Synapse_Samples.html?view=diff&rev=533007&r1=533006&r2=533007
==============================================================================
--- webservices/synapse/trunk/java/src/site/resources/Synapse_Samples.html (original)
+++ webservices/synapse/trunk/java/src/site/resources/Synapse_Samples.html Fri Apr 27 01:04:42 2007
@@ -20,8 +20,7 @@
<head>
<meta http-equiv="content-type" content="">
<title></title>
-
-<style type="text/css">
+ <style type="text/css">
.command {
border: 1px dashed #3c78b5;
text-align: left;
@@ -115,8 +114,7 @@
background-color: #f0f0f0;
padding: 2px;
margin: 18px 0px 4px 0px;
- }
-</style>
+ }</style>
</head>
<body>
@@ -1061,7 +1059,7 @@
correlation</strong></p>
<p><strong>Pre-Requisites:</strong><br>
-Start the Synapse configuration numbered 10: i.e. synapse -sample 51<br>
+Start the Synapse configuration numbered 51: i.e. synapse -sample 51<br>
Start the Axis2 server and deploy the MTOMSwASampleService if not already
done</p>
@@ -1960,10 +1958,7 @@
<pre><!-- Introduction to the script mediator with Ruby scripts-->
<definitions xmlns="http://ws.apache.org/ns/synapse">
- <localEntry key="stockquoteScript">
- <address src="file:repository/conf/sample/resources/script/stockquoteTransform.rb"/>
- </localEntry>
-
+ <localEntry key="stockquoteScript" src="file:repository/conf/sample/resources/script/stockquoteTransform.rb"/>
<in>
<!-- transform the custom quote request into a standard quote request expected by the service -->
<script language="rb" key="stockquoteScript" function="transformRequest"/>
@@ -1971,7 +1966,7 @@
<!-- send message to real endpoint referenced by name "stockquote" and stop -->
<send>
<endpoint name="stockquote">
- <address uri="http://localhost:9000/axis2/services/SimpleStockQuoteService"/>
+ <address uri="http://localhost:9000/soap/SimpleStockQuoteService"/>
</endpoint>
</send>
</in>
@@ -1986,32 +1981,19 @@
include REXML
def transformRequest(mc)
- newRequest= Document.new($REQUEST)
- newRequest.root.elements[1].text = mc.getPayloadXML().root.elements[1].get_text
+ newRequest= Document.new '<m:getQuote xmlns:m="http://services.samples/xsd">'<<
+ '<m:request><m:symbol></m:symbol></m:request></m:getQuote>'
+ newRequest.root.elements[1].elements[1].text = mc.getPayloadXML().root.elements[1].get_text
mc.setPayloadXML(newRequest)
end
def transformResponse(mc)
- newResponse = Document.new($RESPONSE)
+ newResponse = Document.new '<m:CheckPriceResponse xmlns:m="http://www.apache-synapse.org/test"><m:Code>' <<
+ '</m:Code><m:Price></m:Price></m:CheckPriceResponse>'
newResponse.root.elements[1].text = mc.getPayloadXML().root.elements[1].elements[1].get_text
newResponse.root.elements[2].text = mc.getPayloadXML().root.elements[1].elements[2].get_text
mc.setPayloadXML(newResponse)
end
-
-$REQUEST = <<EOF
- <m:getQuote xmlns:m="http://services.samples/xsd">
- <m:request>
- <m:symbol></m:symbol>
- </m:request>
- </m:getQuote>
-EOF
-
-$RESPONSE = <<EOF
- <m:CheckPriceResponse xmlns:m="http://www.apache-synapse.org/test">
- <m:Code></m:Code>
- <m:Price></m:Price>
- </m:CheckPriceResponse>
-EOF
]]></x></pre>
<p><strong>Objective: Script mediators using Ruby</strong></p>
Modified: webservices/synapse/trunk/java/src/site/resources/Synapse_Samples_Setup.html
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/src/site/resources/Synapse_Samples_Setup.html?view=diff&rev=533007&r1=533006&r2=533007
==============================================================================
--- webservices/synapse/trunk/java/src/site/resources/Synapse_Samples_Setup.html (original)
+++ webservices/synapse/trunk/java/src/site/resources/Synapse_Samples_Setup.html Fri Apr 27 01:04:42 2007
@@ -1,6 +1,3 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org