You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlrpc-auto@ws.apache.org by jo...@apache.org on 2006/12/04 23:09:20 UTC
svn commit: r482386 - in /webservices/jaxme/trunk/ws-jaxme:
jaxme-api/pom.xml jaxme-api/src/site/ jaxme-api/src/site/site.xml
jaxme-api/src/site/xdoc/ jaxme-api/src/site/xdoc/index.xml
jaxme-js/src/site/xdoc/apps/xmlrpc.xml
Author: jochen
Date: Mon Dec 4 14:09:18 2006
New Revision: 482386
URL: http://svn.apache.org/viewvc?view=rev&rev=482386
Log:
Enabled Maven 2 build for JaxMeAPI site.
Added:
webservices/jaxme/trunk/ws-jaxme/jaxme-api/src/site/
webservices/jaxme/trunk/ws-jaxme/jaxme-api/src/site/site.xml
webservices/jaxme/trunk/ws-jaxme/jaxme-api/src/site/xdoc/
webservices/jaxme/trunk/ws-jaxme/jaxme-api/src/site/xdoc/index.xml
webservices/jaxme/trunk/ws-jaxme/jaxme-js/src/site/xdoc/apps/xmlrpc.xml
Modified:
webservices/jaxme/trunk/ws-jaxme/jaxme-api/pom.xml
Modified: webservices/jaxme/trunk/ws-jaxme/jaxme-api/pom.xml
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-api/pom.xml?view=diff&rev=482386&r1=482385&r2=482386
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-api/pom.xml (original)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-api/pom.xml Mon Dec 4 14:09:18 2006
@@ -54,4 +54,19 @@
<version>1.3.02</version>
</dependency>
</dependencies>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>changes-maven-plugin</artifactId>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>changes-report</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+ </plugins>
+ </reporting>
</project>
Added: webservices/jaxme/trunk/ws-jaxme/jaxme-api/src/site/site.xml
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-api/src/site/site.xml?view=auto&rev=482386
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-api/src/site/site.xml (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-api/src/site/site.xml Mon Dec 4 14:09:18 2006
@@ -0,0 +1,25 @@
+<project name="jaxme-api">
+ <bannerLeft>
+ <name>Apache JaxMe</name>
+ <src>http://ws.apache.org/jaxme/images/group-logo.gif</src>
+ <href>http://ws.apache.org/jaxme/</href>
+ </bannerLeft>
+ <body>
+ <links>
+ <item name="Apache" href="http://www.apache.org/"/>
+ <item name="Webservices" href="http://ws.apache.org/"/>
+ <item name="JaxMe" href="http://ws.apache.org/jaxme/"/>
+ <item name="JAXB 1.0 API" href="http://ws.apache.org/jaxme/api/"/>
+ </links>
+
+ <menu name="JAXB 1.0 API">
+ <item name="Introduction" href="index.html"/>
+ <item name="License" href="license.html"/>
+ <item name="Javadocs" href="apidocs/index.html"/>
+ <item name="Mailing Lists" href="mail-lists.html"/>
+ </menu>
+
+ ${reports}
+
+ </body>
+</project>
Added: webservices/jaxme/trunk/ws-jaxme/jaxme-api/src/site/xdoc/index.xml
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-api/src/site/xdoc/index.xml?view=auto&rev=482386
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-api/src/site/xdoc/index.xml (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-api/src/site/xdoc/index.xml Mon Dec 4 14:09:18 2006
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright 2004 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.
+
+-->
+<document>
+ <properties>
+ <title>
+ JaxMeAPI: A clean room implementation of the JAXB API
+ </title>
+ </properties>
+ <body>
+ <section
+ name="JaxMeAPI: A clean room implementation of the JAXB API">
+ <p>
+ JaxMeAPI is clean room implementation of the JAXB API.
+ Unlike the
+ <a href="https://jaxb.dev.java.net/">reference implementation</a>
+ this one comes under a very moderate open source
+ license, the
+ <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0</a>.
+ </p>
+ <table border="1">
+ <tr>
+ <th>Note</th>
+ </tr>
+ <tr>
+ <td>
+ The reference implementation is now distributed
+ from
+ <a href='https://jaxb.dev.java.net/'>https://jaxb.dev.java.net/</a>.
+ Though the source may be viewed, the license
+ model used does not really seem to be open
+ source (in the usual sense of
+ <a href='http://www.opensource.org/docs/definition.php'>
+ The Open Source Initiative
+ </a>
+ definition). Our implementation (of the basic
+ API) is licensed under the Apache License, a
+ truly open source license allowing easy
+ redistribution. Therefore, we continue to
+ recommend our implementation.
+ </td>
+ </tr>
+ </table>
+ <p>
+ In terms of Jar files, the JaxMeAPI is equivalent to the
+ following Jar files from the reference implementation:
+ </p>
+ <ol>
+ <li>jaxb-api.jar</li>
+ <li>jax-qname.jar</li>
+ <li>namespace.jar</li>
+ </ol>
+ <p>
+ JaxMeAPI was written as a part of the
+ <a href="http://ws.apache.org/jaxme/">JaxMe 2</a>
+ project. It is available as a separate module to be
+ included in source distributions of JAXB client
+ applications. Perhaps other JAXB provider
+ implementations. might be interested too at some point.
+ </p>
+ </section>
+ </body>
+</document>
Added: webservices/jaxme/trunk/ws-jaxme/jaxme-js/src/site/xdoc/apps/xmlrpc.xml
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-js/src/site/xdoc/apps/xmlrpc.xml?view=auto&rev=482386
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-js/src/site/xdoc/apps/xmlrpc.xml (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-js/src/site/xdoc/apps/xmlrpc.xml Mon Dec 4 14:09:18 2006
@@ -0,0 +1,220 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright 2004 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.
+
+-->
+<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.2//EN" "document-v12.dtd">
+<document>
+ <properties>
+ <title>Apache XML-RPC Clients</title>
+ </properties>
+ <body>
+ <section name="Apache XML-RPC Clients">
+ <p>Apache XML-RPC is an implementation of XML-RPC: Remote procedure
+ calls are transmitted as XML documents and the results are returned
+ in the same way.</p>
+ <p>The most important feature of XML-RPC is portability: XML-RPC
+ implementations are available for almost any programming language.
+ The protocol is intentionally restricted to some typical data type,
+ including integers, strings, arrays, and maps.</p>
+ <p>Apache XML-RPC is based on Java reflection: You trade flexibility
+ for type safety and compiler control. But why take the disadvantage?
+ The client generator allows you to have both flexibility and
+ compiler control.</p>
+ </section>
+
+ <section name="How it works">
+ <p>The client generator is roughly similar to the
+ <a href="../patterns/proxy.html">Proxy Generator</a>:
+ Assuming that you have classes A, B, and C on the server,
+ which are being called via XML-RPC, the generator creates
+ classes A', B', and C' with roughly the same set of public
+ methods. The difference is, that the latter classes have
+ every method implemented as an XML-RPC call. However, this
+ XML-RPC call is completely transparent!</p>
+ <p>More precisely, if you have the following class on the
+ server:</p>
+ <source>
+public class Calculator {
+ public int add(int i1, int i2) {
+ return i1 + i2;
+ }
+ public double multiply(double d1, double d2) {
+ return d1 * d2;
+ }
+}
+ </source>
+ <p>The generator will create a class for you, which is roughly
+ similar to:</p>
+ <source>
+public class Calculator {
+ private XmlRpcCaller caller;
+ public Calculator(caller) {
+ this.caller = caller;
+ }
+ public int add(int i1, int i2) {
+ Vector v = new Vector();
+ v.add(new Integer(i1));
+ v.add(new Integer(i2));
+ XmlRpcClient c = new XmlRpcClient(url);
+ Object o = caller.xmlRpcCall("Calculator.add", v);
+ return ((Integer) o).intValue();
+ }
+ public double add(double d1, double d2) {
+ Vector v = new Vector();
+ v.add(new Double(d1));
+ v.add(new Double(d2));
+ Object o = caller.xmlRpcCall("Calculator.add", v);
+ return ((Double) o).doubleValue();
+ }
+}
+ </source>
+ <p>In particular, note that the generated classes are
+ automatically converting from or to primitive types.
+ A basic implementation for the
+ <a href="../apidocs/org/apache/ws/jaxme/js/apps/XmlRpcCaller.html">
+ XmlRpcCaller</a> would be:</p>
+ <source>
+public class MyCaller implements org.apache.ws.jaxme.js.apps.XmlRpcCaller {
+ private final URL url;
+ public MyCaller(URL url) {
+ this.url = url;
+ }
+ public Object xmlRpcCall(String name, Vector params) throws Exception {
+ return new XmlRpcClient(url).execute(name, params);
+ }
+}
+ </source>
+ </section>
+
+ <section name="The dispatcher">
+ <p>The generator may create one additional class for you, which is
+ dedicated for the server: The dispatcher. In the above example,
+ a dispatcher would be:</p>
+ <source>
+public class Dispatcher implements org.apache.xmlrpc.XmlRpcHandler {
+ public Object execute(String pName, Vector pParams) throws Throwable {
+ if ("Calculator-add".equals(pName)) {
+ int i1 = ((Integer) params.get(0)).intValue();
+ int i2 = ((Integer) params.get(1)).intValue();
+ return new Integer(new Calculator().add(i1, i2));
+ } else if ("Calculator-multiply".equals(pName)) {
+ double d1 = ((Double) params.get(0)).doubleValue();
+ double d2 = ((Double) params.get(1)).doubleValue();
+ return new Double(new Calculator().multiply(d1, d2));
+ }
+ }
+}
+ </source>
+ <p>Note, that the dispatcher may very well be a static final instance
+ variable. It is quite easy, to embed the dispatcher into the server:</p>
+<source>
+ XmlRpcServer xmlrpc = new XmlRpcServer ();
+ xmlrpc.addHandler ("$default", new org.apache.xmlrpc.XmlRpcHandler() {
+ Dispatcher d = new Dispatcher();
+ public Object execute(String pName, Vector pVector) throws Exception {
+ try {
+ return d.invoke(pName, pVector);
+ } catch (Exception e) {
+ throw e;
+ } catch (Throwable t) {
+ throw new UndeclaredThrowableException(t);
+ }
+ }
+ });
+ byte[] result = xmlrpc.execute (request.getInputStream ());
+ response.setContentType ("text/xml");
+ response.setContentLength (result.length());
+ OutputStream out = response.getOutputStream();
+ out.write (result);
+ out.flush ();
+</source>
+ </section>
+
+ <section name="Using the generator">
+ <p>The generator is implemented as an Ant task. A typical invocation will
+ most probably look like this:</p>
+<source>
+ <taskdef resource="org/apache/ws/jaxme/js/pattern/ant.properties"
+ classpathref="js.test.path"/>
+ <xmlRpcGenerator
+ targetPackage="com.foo.xmlrpc.client"
+ destDir="build/src">
+ <dispatcher name="com.foo.xmlrpc.server.Dispatcher"/>
+ <serverClasses dir="src" includes="com/foo/xmlrpc/server/XmlRpc*.java"/>
+ </xmlRpcGenerator>
+</source>
+ <p>The Ant task "xmlRpcGenerator" supports the following attributes:</p>
+ <table>
+ <tr><th>Name</th><th>Description</th><th>Required<br/>Default</th></tr>
+ <tr>
+ <td>classpathRef</td>
+ <td>Specifies a reference to a classpath. This classpath is used,
+ for loading the server classes, if they are passed in as
+ compiled classes and not Java sources.</td>
+ <td>No<br/>Ant path</td>
+ </tr>
+ <tr>
+ <td>destDir</td>
+ <td>Specifies the directory, where sources are being generated.
+ A package structure is created below the directory: If the
+ target package is "com.foo.xmlrpc.client", and the destination
+ directory is "src", then the generated classes will appear in
+ "src/com/foo/xmlrpc/client".</td>
+ <td>No<br/>Current directory</td>
+ </tr>
+ <tr>
+ <td>targetPackage</td>
+ <td>Specifies the package, in which the generated sources are
+ being placed.</td>
+ <td>No<br/>Root package</td>
+ </tr>
+ </table>
+ <p>The Ant task also supports the following nested elements:</p>
+ <table>
+ <tr><th>Name</th><th>Description</th><th>Required<br/>Default</th></tr>
+ <tr>
+ <td>classpath</td>
+ <td>An embedded class path, used as a replacement for the
+ 'classpathref' attribute. Using this nested child element
+ is mutually exclusive with the attribute.</td>
+ <td>No<br/>Ant path</td>
+ </tr>
+ <tr>
+ <td>dispatcher</td>
+ <td>Specifies, that a dispatcher is being generated. The
+ 'name' attribute specifies the dispatchers fully qualified
+ class name.<br/>By default, the dispatcher will implement
+ org.apache.xmlrpc.XmlRpcHandler. This may be suppressed
+ by setting the 'implementingXmlRpcHandler' attribute to
+ false. This is mainly usefull for the JaxMeJS test suite.
+ </td>
+ <td>No</td>
+ </tr>
+ <tr>
+ <td>serverClasses</td>
+ <td>One or more file sets specifying the server side classes,
+ for which clients are being generated. These classes may either
+ be specified as sources (in which case the
+ <a href="../apidocs/org/apache/ws/jaxme/js/util/JavaParser.html">
+ Java parser</a> is used for scanning them, or as compiled classes,
+ in which case Java reflection is being used.</td>
+ <td>Yes</td>
+ </tr>
+ </table>
+ </section>
+ </body>
+</document>