From 45bf2db854b01e17efda9fabf048a409917340a1 Mon Sep 17 00:00:00 2001 From: Inderjeet Singh Date: Mon, 28 Dec 2009 09:44:47 +0000 Subject: [PATCH] Created new projects: 1. wsdef: contains classes that are used to define a Gson based JSON web service 2. wsclient: contains classes that are used to write a Gson based web-service client wsf is now only a server-side framework. Moved classes relevant for wsdef and wsclient from it to the individual projects. --- wsclient/pom.xml | 238 ++++++++++++++++++ .../webservice}/client/RequestSender.java | 10 +- .../webservice}/client/ResponseReceiver.java | 14 +- .../webservice}/client/WebServiceClient.java | 8 +- .../webservice}/client/WebServiceConfig.java | 2 +- wsdef/pom.xml | 232 +++++++++++++++++ .../gson/webservice/definition}/CallPath.java | 2 +- .../webservice/definition}/CallPathMap.java | 2 +- .../webservice/definition}/ContentBody.java | 2 +- .../definition}/ContentBodySpec.java | 2 +- .../webservice/definition}/HeaderMap.java | 2 +- .../webservice/definition}/HeaderMapSpec.java | 2 +- .../webservice/definition}/HttpMethod.java | 2 +- .../gson/webservice/definition}/ParamMap.java | 2 +- .../webservice/definition}/ParamMapSpec.java | 2 +- .../webservice/definition}/RequestBody.java | 2 +- .../definition}/RequestBodySpec.java | 2 +- .../webservice/definition}/RequestSpec.java | 2 +- .../webservice/definition}/ResponseBody.java | 2 +- .../definition}/ResponseBodySpec.java | 2 +- .../webservice/definition}/ResponseSpec.java | 2 +- .../webservice/definition}/TypeUtils.java | 5 +- .../gson/webservice/definition}/Util.java | 2 +- .../definition}/WebServiceAppException.java | 2 +- .../definition}/WebServiceCall.java | 2 +- .../definition}/WebServiceCallSpec.java | 2 +- .../definition}/WebServiceRequest.java | 2 +- .../definition}/WebServiceResponse.java | 2 +- .../definition}/WebServiceSpec.java | 2 +- .../WebServiceSystemException.java | 2 +- .../RequestBodyGsonConverter.java | 6 +- .../ResponseBodyGsonConverter.java | 6 +- wsf/pom.xml | 24 +- .../gson/wsf/inject/CallPathProvider.java | 2 +- .../wsf/inject/RequestBodySpecProvider.java | 4 +- .../gson/wsf/inject/RequestSpecProvider.java | 4 +- .../inject/WebServiceCallSpecProvider.java | 6 +- .../server/WebServiceCallServerProvider.java | 8 +- .../gson/wsf/server/RequestReceiver.java | 16 +- .../gson/wsf/server/ResponseSender.java | 8 +- 40 files changed, 562 insertions(+), 77 deletions(-) create mode 100644 wsclient/pom.xml rename {wsf/src/main/java/com/google/gson/wsf => wsclient/src/main/java/com/google/gson/webservice}/client/RequestSender.java (90%) rename {wsf/src/main/java/com/google/gson/wsf => wsclient/src/main/java/com/google/gson/webservice}/client/ResponseReceiver.java (87%) rename {wsf/src/main/java/com/google/gson/wsf => wsclient/src/main/java/com/google/gson/webservice}/client/WebServiceClient.java (90%) rename {wsf/src/main/java/com/google/gson/wsf => wsclient/src/main/java/com/google/gson/webservice}/client/WebServiceConfig.java (95%) create mode 100644 wsdef/pom.xml rename {wsf/src/main/java/com/google/gson/wsf => wsdef/src/main/java/com/google/gson/webservice/definition}/CallPath.java (92%) rename {wsf/src/main/java/com/google/gson/wsf => wsdef/src/main/java/com/google/gson/webservice/definition}/CallPathMap.java (94%) rename {wsf/src/main/java/com/google/gson/wsf => wsdef/src/main/java/com/google/gson/webservice/definition}/ContentBody.java (93%) mode change 100755 => 100644 rename {wsf/src/main/java/com/google/gson/wsf => wsdef/src/main/java/com/google/gson/webservice/definition}/ContentBodySpec.java (94%) mode change 100755 => 100644 rename {wsf/src/main/java/com/google/gson/wsf => wsdef/src/main/java/com/google/gson/webservice/definition}/HeaderMap.java (94%) mode change 100755 => 100644 rename {wsf/src/main/java/com/google/gson/wsf => wsdef/src/main/java/com/google/gson/webservice/definition}/HeaderMapSpec.java (94%) mode change 100755 => 100644 rename {wsf/src/main/java/com/google/gson/wsf => wsdef/src/main/java/com/google/gson/webservice/definition}/HttpMethod.java (94%) rename {wsf/src/main/java/com/google/gson/wsf => wsdef/src/main/java/com/google/gson/webservice/definition}/ParamMap.java (97%) rename {wsf/src/main/java/com/google/gson/wsf => wsdef/src/main/java/com/google/gson/webservice/definition}/ParamMapSpec.java (95%) rename {wsf/src/main/java/com/google/gson/wsf => wsdef/src/main/java/com/google/gson/webservice/definition}/RequestBody.java (97%) rename {wsf/src/main/java/com/google/gson/wsf => wsdef/src/main/java/com/google/gson/webservice/definition}/RequestBodySpec.java (96%) rename {wsf/src/main/java/com/google/gson/wsf => wsdef/src/main/java/com/google/gson/webservice/definition}/RequestSpec.java (96%) rename {wsf/src/main/java/com/google/gson/wsf => wsdef/src/main/java/com/google/gson/webservice/definition}/ResponseBody.java (97%) rename {wsf/src/main/java/com/google/gson/wsf => wsdef/src/main/java/com/google/gson/webservice/definition}/ResponseBodySpec.java (96%) rename {wsf/src/main/java/com/google/gson/wsf => wsdef/src/main/java/com/google/gson/webservice/definition}/ResponseSpec.java (96%) rename {wsf/src/main/java/com/google/gson/wsf => wsdef/src/main/java/com/google/gson/webservice/definition}/TypeUtils.java (95%) rename {wsf/src/main/java/com/google/gson/wsf => wsdef/src/main/java/com/google/gson/webservice/definition}/Util.java (94%) mode change 100755 => 100644 rename {wsf/src/main/java/com/google/gson/wsf => wsdef/src/main/java/com/google/gson/webservice/definition}/WebServiceAppException.java (93%) rename {wsf/src/main/java/com/google/gson/wsf => wsdef/src/main/java/com/google/gson/webservice/definition}/WebServiceCall.java (93%) mode change 100755 => 100644 rename {wsf/src/main/java/com/google/gson/wsf => wsdef/src/main/java/com/google/gson/webservice/definition}/WebServiceCallSpec.java (96%) mode change 100755 => 100644 rename {wsf/src/main/java/com/google/gson/wsf => wsdef/src/main/java/com/google/gson/webservice/definition}/WebServiceRequest.java (94%) rename {wsf/src/main/java/com/google/gson/wsf => wsdef/src/main/java/com/google/gson/webservice/definition}/WebServiceResponse.java (95%) rename {wsf/src/main/java/com/google/gson/wsf => wsdef/src/main/java/com/google/gson/webservice/definition}/WebServiceSpec.java (92%) mode change 100755 => 100644 rename {wsf/src/main/java/com/google/gson/wsf => wsdef/src/main/java/com/google/gson/webservice/definition}/WebServiceSystemException.java (93%) mode change 100755 => 100644 rename {wsf/src/main/java/com/google/gson/wsf => wsdef/src/main/java/com/google/gson/webservice}/typeadapters/RequestBodyGsonConverter.java (93%) rename {wsf/src/main/java/com/google/gson/wsf => wsdef/src/main/java/com/google/gson/webservice}/typeadapters/ResponseBodyGsonConverter.java (93%) diff --git a/wsclient/pom.xml b/wsclient/pom.xml new file mode 100644 index 00000000..e708ad57 --- /dev/null +++ b/wsclient/pom.xml @@ -0,0 +1,238 @@ + + + + + 4.0.0 + com.google.code.gson + wsclient + jar + 0.1 + Gson Web Service Client Framework + A Framework for Writing Clients for JSON based Web-services + + + local.repo + file repository to svn + file://${basedir}/../../mavenrepo + + + + + gson + http://google-gson.googlecode.com/svn/mavenrepo + + true + + + true + + + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + scm:svn:http://google-gson.googlecode.com/svn/trunk/wsf + scm:svn:https://google-gson.googlecode.com/svn/trunk/wsf + http://google-gson.codegoogle.com/svn/trunk/wsf + + + Google Code Issue Tracking + http://code.google.com/p/google-gson/issues/list + + + + + + + com.google.collections + google-collections + 1.0-rc5 + compile + + + + + com.google.code.gson + gson + 1.4 + compile + + + com.google.code.gson + wsdef + 0.1 + compile + + + + + com.google.inject + guice + 2.0 + compile + + + + junit + junit + 3.8.2 + test + + + + + wsclient + + + org.apache.maven.plugins + maven-compiler-plugin + 2.0.2 + + 1.6 + 1.6 + + + + org.apache.maven.plugins + maven-eclipse-plugin + 2.5.1 + + true + true + ../eclipse-ws + file:///${basedir}/../lib/gson-formatting-styles.xml + 1.5 + + + + org.apache.maven.plugins + maven-install-plugin + 2.2 + + + + org.mortbay.jetty + maven-jetty-plugin + 6.0.1 + + 10 + + + + org.apache.maven.plugins + maven-jxr-plugin + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + verify + + jar + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + src/main/resources/javadoc-descriptor.xml + + http://java.sun.com/j2se/1.5.0/docs/api/ + + true + true + public + + + + org.apache.maven.plugins + maven-pmd-plugin + + 1.5 + + /rulesets/basic.xml + /rulesets/imports.xml + /rulesets/unusedcode.xml + /rulesets/finalizers.xml + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + + config/maven_checks.xml + + + + org.codehaus.mojo + taglist-maven-plugin + + + TODO + @todo + FIXME + XXX + + + + + org.codehaus.mojo + cobertura-maven-plugin + + + clean + + clean + + + + + + org.apache.maven.plugins + maven-release-plugin + + -DenableCiProfile=true + + + + maven-assembly-plugin + 2.2-beta-2 + + src/main/resources/assembly-descriptor.xml + wsf-${version} + target/dist + target/assembly/work + + + + + + + Inderjeet Singh + Google Inc. + + + diff --git a/wsf/src/main/java/com/google/gson/wsf/client/RequestSender.java b/wsclient/src/main/java/com/google/gson/webservice/client/RequestSender.java similarity index 90% rename from wsf/src/main/java/com/google/gson/wsf/client/RequestSender.java rename to wsclient/src/main/java/com/google/gson/webservice/client/RequestSender.java index 12d10f69..8b554d90 100644 --- a/wsf/src/main/java/com/google/gson/wsf/client/RequestSender.java +++ b/wsclient/src/main/java/com/google/gson/webservice/client/RequestSender.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.gson.wsf.client; +package com.google.gson.webservice.client; import java.io.IOException; import java.io.PrintWriter; @@ -23,10 +23,10 @@ import java.net.HttpURLConnection; import java.util.Map; import com.google.gson.Gson; -import com.google.gson.wsf.HeaderMap; -import com.google.gson.wsf.HeaderMapSpec; -import com.google.gson.wsf.RequestBody; -import com.google.gson.wsf.WebServiceRequest; +import com.google.gson.webservice.definition.HeaderMap; +import com.google.gson.webservice.definition.HeaderMapSpec; +import com.google.gson.webservice.definition.RequestBody; +import com.google.gson.webservice.definition.WebServiceRequest; /** * Class to send Web service requests on a {@link HttpURLConnection}. diff --git a/wsf/src/main/java/com/google/gson/wsf/client/ResponseReceiver.java b/wsclient/src/main/java/com/google/gson/webservice/client/ResponseReceiver.java similarity index 87% rename from wsf/src/main/java/com/google/gson/wsf/client/ResponseReceiver.java rename to wsclient/src/main/java/com/google/gson/webservice/client/ResponseReceiver.java index 89ff5dd8..a7046aa0 100644 --- a/wsf/src/main/java/com/google/gson/wsf/client/ResponseReceiver.java +++ b/wsclient/src/main/java/com/google/gson/webservice/client/ResponseReceiver.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.gson.wsf.client; +package com.google.gson.webservice.client; import java.io.BufferedReader; import java.io.IOException; @@ -25,12 +25,12 @@ import java.util.Map; import com.google.common.base.Preconditions; import com.google.gson.Gson; -import com.google.gson.wsf.HeaderMap; -import com.google.gson.wsf.HeaderMapSpec; -import com.google.gson.wsf.ResponseBody; -import com.google.gson.wsf.ResponseBodySpec; -import com.google.gson.wsf.ResponseSpec; -import com.google.gson.wsf.WebServiceResponse; +import com.google.gson.webservice.definition.HeaderMap; +import com.google.gson.webservice.definition.HeaderMapSpec; +import com.google.gson.webservice.definition.ResponseBody; +import com.google.gson.webservice.definition.ResponseBodySpec; +import com.google.gson.webservice.definition.ResponseSpec; +import com.google.gson.webservice.definition.WebServiceResponse; /** * Receives a response coming on an {@link HttpURLConnection}. diff --git a/wsf/src/main/java/com/google/gson/wsf/client/WebServiceClient.java b/wsclient/src/main/java/com/google/gson/webservice/client/WebServiceClient.java similarity index 90% rename from wsf/src/main/java/com/google/gson/wsf/client/WebServiceClient.java rename to wsclient/src/main/java/com/google/gson/webservice/client/WebServiceClient.java index 90362e71..515941b3 100644 --- a/wsf/src/main/java/com/google/gson/wsf/client/WebServiceClient.java +++ b/wsclient/src/main/java/com/google/gson/webservice/client/WebServiceClient.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.gson.wsf.client; +package com.google.gson.webservice.client; import java.io.IOException; import java.net.HttpURLConnection; @@ -21,9 +21,9 @@ import java.net.MalformedURLException; import java.net.URL; import com.google.gson.Gson; -import com.google.gson.wsf.WebServiceCallSpec; -import com.google.gson.wsf.WebServiceRequest; -import com.google.gson.wsf.WebServiceResponse; +import com.google.gson.webservice.definition.WebServiceCallSpec; +import com.google.gson.webservice.definition.WebServiceRequest; +import com.google.gson.webservice.definition.WebServiceResponse; /** * Main class used by clients to access a Gson Web service. diff --git a/wsf/src/main/java/com/google/gson/wsf/client/WebServiceConfig.java b/wsclient/src/main/java/com/google/gson/webservice/client/WebServiceConfig.java similarity index 95% rename from wsf/src/main/java/com/google/gson/wsf/client/WebServiceConfig.java rename to wsclient/src/main/java/com/google/gson/webservice/client/WebServiceConfig.java index 9832b232..6024475f 100644 --- a/wsf/src/main/java/com/google/gson/wsf/client/WebServiceConfig.java +++ b/wsclient/src/main/java/com/google/gson/webservice/client/WebServiceConfig.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.gson.wsf.client; +package com.google.gson.webservice.client; /** * Configuration needed to access a Gson web service. diff --git a/wsdef/pom.xml b/wsdef/pom.xml new file mode 100644 index 00000000..8f43abdc --- /dev/null +++ b/wsdef/pom.xml @@ -0,0 +1,232 @@ + + + + + 4.0.0 + com.google.code.gson + wsdef + jar + 0.1 + Gson Web Service Definition Framework + A Framework for Defining JSON based Web-services + + + local.repo + file repository to svn + file://${basedir}/../../mavenrepo + + + + + gson + http://google-gson.googlecode.com/svn/mavenrepo + + true + + + true + + + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + scm:svn:http://google-gson.googlecode.com/svn/trunk/wsf + scm:svn:https://google-gson.googlecode.com/svn/trunk/wsf + http://google-gson.codegoogle.com/svn/trunk/wsf + + + Google Code Issue Tracking + http://code.google.com/p/google-gson/issues/list + + + + + + + com.google.collections + google-collections + 1.0-rc5 + compile + + + + + com.google.code.gson + gson + 1.4 + compile + + + + + com.google.inject + guice + 2.0 + compile + + + + junit + junit + 3.8.2 + test + + + + + wsdef + + + org.apache.maven.plugins + maven-compiler-plugin + 2.0.2 + + 1.6 + 1.6 + + + + org.apache.maven.plugins + maven-eclipse-plugin + 2.5.1 + + true + true + ../eclipse-ws + file:///${basedir}/../lib/gson-formatting-styles.xml + 1.5 + + + + org.apache.maven.plugins + maven-install-plugin + 2.2 + + + + org.mortbay.jetty + maven-jetty-plugin + 6.0.1 + + 10 + + + + org.apache.maven.plugins + maven-jxr-plugin + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + verify + + jar + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + src/main/resources/javadoc-descriptor.xml + + http://java.sun.com/j2se/1.5.0/docs/api/ + + true + true + public + + + + org.apache.maven.plugins + maven-pmd-plugin + + 1.5 + + /rulesets/basic.xml + /rulesets/imports.xml + /rulesets/unusedcode.xml + /rulesets/finalizers.xml + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + + config/maven_checks.xml + + + + org.codehaus.mojo + taglist-maven-plugin + + + TODO + @todo + FIXME + XXX + + + + + org.codehaus.mojo + cobertura-maven-plugin + + + clean + + clean + + + + + + org.apache.maven.plugins + maven-release-plugin + + -DenableCiProfile=true + + + + maven-assembly-plugin + 2.2-beta-2 + + src/main/resources/assembly-descriptor.xml + wsf-${version} + target/dist + target/assembly/work + + + + + + + Inderjeet Singh + Google Inc. + + + diff --git a/wsf/src/main/java/com/google/gson/wsf/CallPath.java b/wsdef/src/main/java/com/google/gson/webservice/definition/CallPath.java similarity index 92% rename from wsf/src/main/java/com/google/gson/wsf/CallPath.java rename to wsdef/src/main/java/com/google/gson/webservice/definition/CallPath.java index dbed5ac9..c5589f75 100644 --- a/wsf/src/main/java/com/google/gson/wsf/CallPath.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/CallPath.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.gson.wsf; +package com.google.gson.webservice.definition; /** * Encapsulation of a Web service path that is sent by the client. diff --git a/wsf/src/main/java/com/google/gson/wsf/CallPathMap.java b/wsdef/src/main/java/com/google/gson/webservice/definition/CallPathMap.java similarity index 94% rename from wsf/src/main/java/com/google/gson/wsf/CallPathMap.java rename to wsdef/src/main/java/com/google/gson/webservice/definition/CallPathMap.java index f7278855..3ddf0524 100644 --- a/wsf/src/main/java/com/google/gson/wsf/CallPathMap.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/CallPathMap.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.gson.wsf; +package com.google.gson.webservice.definition; import java.util.Map; diff --git a/wsf/src/main/java/com/google/gson/wsf/ContentBody.java b/wsdef/src/main/java/com/google/gson/webservice/definition/ContentBody.java old mode 100755 new mode 100644 similarity index 93% rename from wsf/src/main/java/com/google/gson/wsf/ContentBody.java rename to wsdef/src/main/java/com/google/gson/webservice/definition/ContentBody.java index a84dea59..c928f4b4 --- a/wsf/src/main/java/com/google/gson/wsf/ContentBody.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/ContentBody.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.gson.wsf; +package com.google.gson.webservice.definition; import java.util.Map; diff --git a/wsf/src/main/java/com/google/gson/wsf/ContentBodySpec.java b/wsdef/src/main/java/com/google/gson/webservice/definition/ContentBodySpec.java old mode 100755 new mode 100644 similarity index 94% rename from wsf/src/main/java/com/google/gson/wsf/ContentBodySpec.java rename to wsdef/src/main/java/com/google/gson/webservice/definition/ContentBodySpec.java index 53e93a36..06a6b842 --- a/wsf/src/main/java/com/google/gson/wsf/ContentBodySpec.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/ContentBodySpec.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.gson.wsf; +package com.google.gson.webservice.definition; import java.lang.reflect.Type; import java.util.Collections; diff --git a/wsf/src/main/java/com/google/gson/wsf/HeaderMap.java b/wsdef/src/main/java/com/google/gson/webservice/definition/HeaderMap.java old mode 100755 new mode 100644 similarity index 94% rename from wsf/src/main/java/com/google/gson/wsf/HeaderMap.java rename to wsdef/src/main/java/com/google/gson/webservice/definition/HeaderMap.java index 1ad31443..948895c8 --- a/wsf/src/main/java/com/google/gson/wsf/HeaderMap.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/HeaderMap.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.gson.wsf; +package com.google.gson.webservice.definition; import java.lang.reflect.Type; import java.util.Map; diff --git a/wsf/src/main/java/com/google/gson/wsf/HeaderMapSpec.java b/wsdef/src/main/java/com/google/gson/webservice/definition/HeaderMapSpec.java old mode 100755 new mode 100644 similarity index 94% rename from wsf/src/main/java/com/google/gson/wsf/HeaderMapSpec.java rename to wsdef/src/main/java/com/google/gson/webservice/definition/HeaderMapSpec.java index 8234ed81..91bc6e7e --- a/wsf/src/main/java/com/google/gson/wsf/HeaderMapSpec.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/HeaderMapSpec.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.gson.wsf; +package com.google.gson.webservice.definition; import java.lang.reflect.Type; import java.util.Map; diff --git a/wsf/src/main/java/com/google/gson/wsf/HttpMethod.java b/wsdef/src/main/java/com/google/gson/webservice/definition/HttpMethod.java similarity index 94% rename from wsf/src/main/java/com/google/gson/wsf/HttpMethod.java rename to wsdef/src/main/java/com/google/gson/webservice/definition/HttpMethod.java index e3e52c2f..2891239f 100644 --- a/wsf/src/main/java/com/google/gson/wsf/HttpMethod.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/HttpMethod.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.gson.wsf; +package com.google.gson.webservice.definition; /** * An enum of Http methods to provide strongly-typed versions instead of strings. diff --git a/wsf/src/main/java/com/google/gson/wsf/ParamMap.java b/wsdef/src/main/java/com/google/gson/webservice/definition/ParamMap.java similarity index 97% rename from wsf/src/main/java/com/google/gson/wsf/ParamMap.java rename to wsdef/src/main/java/com/google/gson/webservice/definition/ParamMap.java index 7d1c4a01..5e7b141c 100644 --- a/wsf/src/main/java/com/google/gson/wsf/ParamMap.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/ParamMap.java @@ -1,4 +1,4 @@ -package com.google.gson.wsf; +package com.google.gson.webservice.definition; import java.lang.reflect.Type; import java.util.Map; diff --git a/wsf/src/main/java/com/google/gson/wsf/ParamMapSpec.java b/wsdef/src/main/java/com/google/gson/webservice/definition/ParamMapSpec.java similarity index 95% rename from wsf/src/main/java/com/google/gson/wsf/ParamMapSpec.java rename to wsdef/src/main/java/com/google/gson/webservice/definition/ParamMapSpec.java index b2874f78..c85cff7b 100644 --- a/wsf/src/main/java/com/google/gson/wsf/ParamMapSpec.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/ParamMapSpec.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.gson.wsf; +package com.google.gson.webservice.definition; import java.lang.reflect.Type; import java.util.Map; diff --git a/wsf/src/main/java/com/google/gson/wsf/RequestBody.java b/wsdef/src/main/java/com/google/gson/webservice/definition/RequestBody.java similarity index 97% rename from wsf/src/main/java/com/google/gson/wsf/RequestBody.java rename to wsdef/src/main/java/com/google/gson/webservice/definition/RequestBody.java index 3e9f953b..a0939dde 100644 --- a/wsf/src/main/java/com/google/gson/wsf/RequestBody.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/RequestBody.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.gson.wsf; +package com.google.gson.webservice.definition; import java.lang.reflect.Type; import java.util.Map; diff --git a/wsf/src/main/java/com/google/gson/wsf/RequestBodySpec.java b/wsdef/src/main/java/com/google/gson/webservice/definition/RequestBodySpec.java similarity index 96% rename from wsf/src/main/java/com/google/gson/wsf/RequestBodySpec.java rename to wsdef/src/main/java/com/google/gson/webservice/definition/RequestBodySpec.java index fe57f967..78f5232f 100644 --- a/wsf/src/main/java/com/google/gson/wsf/RequestBodySpec.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/RequestBodySpec.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.gson.wsf; +package com.google.gson.webservice.definition; import java.lang.reflect.Type; import java.util.Map; diff --git a/wsf/src/main/java/com/google/gson/wsf/RequestSpec.java b/wsdef/src/main/java/com/google/gson/webservice/definition/RequestSpec.java similarity index 96% rename from wsf/src/main/java/com/google/gson/wsf/RequestSpec.java rename to wsdef/src/main/java/com/google/gson/webservice/definition/RequestSpec.java index 41a2da3b..01cb4463 100644 --- a/wsf/src/main/java/com/google/gson/wsf/RequestSpec.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/RequestSpec.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.gson.wsf; +package com.google.gson.webservice.definition; import com.google.common.base.Preconditions; diff --git a/wsf/src/main/java/com/google/gson/wsf/ResponseBody.java b/wsdef/src/main/java/com/google/gson/webservice/definition/ResponseBody.java similarity index 97% rename from wsf/src/main/java/com/google/gson/wsf/ResponseBody.java rename to wsdef/src/main/java/com/google/gson/webservice/definition/ResponseBody.java index 459100e8..29fe5c0a 100644 --- a/wsf/src/main/java/com/google/gson/wsf/ResponseBody.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/ResponseBody.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.gson.wsf; +package com.google.gson.webservice.definition; import java.lang.reflect.Type; import java.util.Map; diff --git a/wsf/src/main/java/com/google/gson/wsf/ResponseBodySpec.java b/wsdef/src/main/java/com/google/gson/webservice/definition/ResponseBodySpec.java similarity index 96% rename from wsf/src/main/java/com/google/gson/wsf/ResponseBodySpec.java rename to wsdef/src/main/java/com/google/gson/webservice/definition/ResponseBodySpec.java index 742a2733..6b801d69 100644 --- a/wsf/src/main/java/com/google/gson/wsf/ResponseBodySpec.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/ResponseBodySpec.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.gson.wsf; +package com.google.gson.webservice.definition; import java.lang.reflect.Type; import java.util.Map; diff --git a/wsf/src/main/java/com/google/gson/wsf/ResponseSpec.java b/wsdef/src/main/java/com/google/gson/webservice/definition/ResponseSpec.java similarity index 96% rename from wsf/src/main/java/com/google/gson/wsf/ResponseSpec.java rename to wsdef/src/main/java/com/google/gson/webservice/definition/ResponseSpec.java index 2dbe5032..3e0e21b7 100644 --- a/wsf/src/main/java/com/google/gson/wsf/ResponseSpec.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/ResponseSpec.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.gson.wsf; +package com.google.gson.webservice.definition; import com.google.common.base.Preconditions; diff --git a/wsf/src/main/java/com/google/gson/wsf/TypeUtils.java b/wsdef/src/main/java/com/google/gson/webservice/definition/TypeUtils.java similarity index 95% rename from wsf/src/main/java/com/google/gson/wsf/TypeUtils.java rename to wsdef/src/main/java/com/google/gson/webservice/definition/TypeUtils.java index 86660f87..48aa066d 100644 --- a/wsf/src/main/java/com/google/gson/wsf/TypeUtils.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/TypeUtils.java @@ -15,7 +15,7 @@ */ // Copied from com.google.gson.TypeUtils -package com.google.gson.wsf; +package com.google.gson.webservice.definition; import java.lang.reflect.Array; import java.lang.reflect.GenericArrayType; @@ -40,6 +40,7 @@ final class TypeUtils { * * TypeUtils.getActualTypeForFirstTypeVariable(fooType) will return Integer.class. */ + @SuppressWarnings("unchecked") static Type getActualTypeForFirstTypeVariable(Type type) { if (type instanceof Class) { return Object.class; @@ -53,6 +54,7 @@ final class TypeUtils { } } + @SuppressWarnings("unchecked") static boolean isArray(Type type) { if (type instanceof Class) { return ((Class)type).isArray(); @@ -66,6 +68,7 @@ final class TypeUtils { /** * This method returns the actual raw class associated with the specified type. */ + @SuppressWarnings("unchecked") static Class toRawClass(Type type) { if (type instanceof Class) { return (Class) type; diff --git a/wsf/src/main/java/com/google/gson/wsf/Util.java b/wsdef/src/main/java/com/google/gson/webservice/definition/Util.java old mode 100755 new mode 100644 similarity index 94% rename from wsf/src/main/java/com/google/gson/wsf/Util.java rename to wsdef/src/main/java/com/google/gson/webservice/definition/Util.java index ac88bc40..3e989eae --- a/wsf/src/main/java/com/google/gson/wsf/Util.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/Util.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.gson.wsf; +package com.google.gson.webservice.definition; import java.lang.reflect.Type; import java.util.Map; diff --git a/wsf/src/main/java/com/google/gson/wsf/WebServiceAppException.java b/wsdef/src/main/java/com/google/gson/webservice/definition/WebServiceAppException.java similarity index 93% rename from wsf/src/main/java/com/google/gson/wsf/WebServiceAppException.java rename to wsdef/src/main/java/com/google/gson/webservice/definition/WebServiceAppException.java index 44d8d5a8..a6552202 100644 --- a/wsf/src/main/java/com/google/gson/wsf/WebServiceAppException.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/WebServiceAppException.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.gson.wsf; +package com.google.gson.webservice.definition; /** * Base class for exceptions thrown to indicate a Web service external or application error diff --git a/wsf/src/main/java/com/google/gson/wsf/WebServiceCall.java b/wsdef/src/main/java/com/google/gson/webservice/definition/WebServiceCall.java old mode 100755 new mode 100644 similarity index 93% rename from wsf/src/main/java/com/google/gson/wsf/WebServiceCall.java rename to wsdef/src/main/java/com/google/gson/webservice/definition/WebServiceCall.java index 8f258a9f..f8479069 --- a/wsf/src/main/java/com/google/gson/wsf/WebServiceCall.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/WebServiceCall.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.gson.wsf; +package com.google.gson.webservice.definition; /** * The data associated with a Web service call. This includes http request header parameters (form diff --git a/wsf/src/main/java/com/google/gson/wsf/WebServiceCallSpec.java b/wsdef/src/main/java/com/google/gson/webservice/definition/WebServiceCallSpec.java old mode 100755 new mode 100644 similarity index 96% rename from wsf/src/main/java/com/google/gson/wsf/WebServiceCallSpec.java rename to wsdef/src/main/java/com/google/gson/webservice/definition/WebServiceCallSpec.java index bb6e8ac4..76f2bc25 --- a/wsf/src/main/java/com/google/gson/wsf/WebServiceCallSpec.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/WebServiceCallSpec.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.gson.wsf; +package com.google.gson.webservice.definition; import java.lang.reflect.Type; import java.util.Arrays; diff --git a/wsf/src/main/java/com/google/gson/wsf/WebServiceRequest.java b/wsdef/src/main/java/com/google/gson/webservice/definition/WebServiceRequest.java similarity index 94% rename from wsf/src/main/java/com/google/gson/wsf/WebServiceRequest.java rename to wsdef/src/main/java/com/google/gson/webservice/definition/WebServiceRequest.java index 358ec7ed..61be18a4 100644 --- a/wsf/src/main/java/com/google/gson/wsf/WebServiceRequest.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/WebServiceRequest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.gson.wsf; +package com.google.gson.webservice.definition; /** * The data associated with a Web service request. This includes HTTP request header parameters diff --git a/wsf/src/main/java/com/google/gson/wsf/WebServiceResponse.java b/wsdef/src/main/java/com/google/gson/webservice/definition/WebServiceResponse.java similarity index 95% rename from wsf/src/main/java/com/google/gson/wsf/WebServiceResponse.java rename to wsdef/src/main/java/com/google/gson/webservice/definition/WebServiceResponse.java index b6869197..fde198df 100644 --- a/wsf/src/main/java/com/google/gson/wsf/WebServiceResponse.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/WebServiceResponse.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.gson.wsf; +package com.google.gson.webservice.definition; import java.lang.reflect.Type; diff --git a/wsf/src/main/java/com/google/gson/wsf/WebServiceSpec.java b/wsdef/src/main/java/com/google/gson/webservice/definition/WebServiceSpec.java old mode 100755 new mode 100644 similarity index 92% rename from wsf/src/main/java/com/google/gson/wsf/WebServiceSpec.java rename to wsdef/src/main/java/com/google/gson/webservice/definition/WebServiceSpec.java index 414312b8..bf80070a --- a/wsf/src/main/java/com/google/gson/wsf/WebServiceSpec.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/WebServiceSpec.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.gson.wsf; +package com.google.gson.webservice.definition; /** * Specification of the Web service. This contains a specification of all the diff --git a/wsf/src/main/java/com/google/gson/wsf/WebServiceSystemException.java b/wsdef/src/main/java/com/google/gson/webservice/definition/WebServiceSystemException.java old mode 100755 new mode 100644 similarity index 93% rename from wsf/src/main/java/com/google/gson/wsf/WebServiceSystemException.java rename to wsdef/src/main/java/com/google/gson/webservice/definition/WebServiceSystemException.java index d02125a3..76a70d7b --- a/wsf/src/main/java/com/google/gson/wsf/WebServiceSystemException.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/WebServiceSystemException.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.gson.wsf; +package com.google.gson.webservice.definition; /** * Base class for all exceptions thrown by the Web service to indicate a system error condition. diff --git a/wsf/src/main/java/com/google/gson/wsf/typeadapters/RequestBodyGsonConverter.java b/wsdef/src/main/java/com/google/gson/webservice/typeadapters/RequestBodyGsonConverter.java similarity index 93% rename from wsf/src/main/java/com/google/gson/wsf/typeadapters/RequestBodyGsonConverter.java rename to wsdef/src/main/java/com/google/gson/webservice/typeadapters/RequestBodyGsonConverter.java index 8e9ec87b..66ec6d29 100644 --- a/wsf/src/main/java/com/google/gson/wsf/typeadapters/RequestBodyGsonConverter.java +++ b/wsdef/src/main/java/com/google/gson/webservice/typeadapters/RequestBodyGsonConverter.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.gson.wsf.typeadapters; +package com.google.gson.webservice.typeadapters; import java.lang.reflect.Type; import java.util.Map; @@ -26,8 +26,8 @@ import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.JsonSerializationContext; import com.google.gson.JsonSerializer; -import com.google.gson.wsf.RequestBody; -import com.google.gson.wsf.RequestBodySpec; +import com.google.gson.webservice.definition.RequestBody; +import com.google.gson.webservice.definition.RequestBodySpec; /** * Gson type adapter for {@link RequestBody}. diff --git a/wsf/src/main/java/com/google/gson/wsf/typeadapters/ResponseBodyGsonConverter.java b/wsdef/src/main/java/com/google/gson/webservice/typeadapters/ResponseBodyGsonConverter.java similarity index 93% rename from wsf/src/main/java/com/google/gson/wsf/typeadapters/ResponseBodyGsonConverter.java rename to wsdef/src/main/java/com/google/gson/webservice/typeadapters/ResponseBodyGsonConverter.java index a598de63..1540a675 100644 --- a/wsf/src/main/java/com/google/gson/wsf/typeadapters/ResponseBodyGsonConverter.java +++ b/wsdef/src/main/java/com/google/gson/webservice/typeadapters/ResponseBodyGsonConverter.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.gson.wsf.typeadapters; +package com.google.gson.webservice.typeadapters; import java.lang.reflect.Type; import java.util.Map; @@ -26,8 +26,8 @@ import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.JsonSerializationContext; import com.google.gson.JsonSerializer; -import com.google.gson.wsf.ResponseBody; -import com.google.gson.wsf.ResponseBodySpec; +import com.google.gson.webservice.definition.ResponseBody; +import com.google.gson.webservice.definition.ResponseBodySpec; /** * Gson type adapter for {@link ResponseBody}. diff --git a/wsf/pom.xml b/wsf/pom.xml index b4738a0e..1926ac31 100755 --- a/wsf/pom.xml +++ b/wsf/pom.xml @@ -50,9 +50,9 @@ - com.google.code.google-collections - google-collect - snapshot-20080530 + com.google.collections + google-collections + 1.0-rc5 compile @@ -60,15 +60,27 @@ com.google.code.gson gson - 1.2 + 1.4 + compile + + + com.google.code.gson + wsdef + 0.1 + compile + + + com.google.code.gson + wsclient + 0.1 compile - com.google.code.guice + com.google.inject guice - 1.0 + 2.0 compile diff --git a/wsf/src/main/java/com/google/gson/wsf/inject/CallPathProvider.java b/wsf/src/main/java/com/google/gson/wsf/inject/CallPathProvider.java index 875cac88..73d5c99f 100644 --- a/wsf/src/main/java/com/google/gson/wsf/inject/CallPathProvider.java +++ b/wsf/src/main/java/com/google/gson/wsf/inject/CallPathProvider.java @@ -17,7 +17,7 @@ package com.google.gson.wsf.inject; import javax.servlet.http.HttpServletRequest; -import com.google.gson.wsf.CallPath; +import com.google.gson.webservice.definition.CallPath; import com.google.inject.Inject; import com.google.inject.Provider; diff --git a/wsf/src/main/java/com/google/gson/wsf/inject/RequestBodySpecProvider.java b/wsf/src/main/java/com/google/gson/wsf/inject/RequestBodySpecProvider.java index 37300b65..c7e0923f 100644 --- a/wsf/src/main/java/com/google/gson/wsf/inject/RequestBodySpecProvider.java +++ b/wsf/src/main/java/com/google/gson/wsf/inject/RequestBodySpecProvider.java @@ -15,8 +15,8 @@ */ package com.google.gson.wsf.inject; -import com.google.gson.wsf.RequestBodySpec; -import com.google.gson.wsf.RequestSpec; +import com.google.gson.webservice.definition.RequestBodySpec; +import com.google.gson.webservice.definition.RequestSpec; import com.google.inject.Inject; import com.google.inject.Provider; diff --git a/wsf/src/main/java/com/google/gson/wsf/inject/RequestSpecProvider.java b/wsf/src/main/java/com/google/gson/wsf/inject/RequestSpecProvider.java index 20f8dfe5..03a8c682 100644 --- a/wsf/src/main/java/com/google/gson/wsf/inject/RequestSpecProvider.java +++ b/wsf/src/main/java/com/google/gson/wsf/inject/RequestSpecProvider.java @@ -15,8 +15,8 @@ */ package com.google.gson.wsf.inject; -import com.google.gson.wsf.RequestSpec; -import com.google.gson.wsf.WebServiceCallSpec; +import com.google.gson.webservice.definition.RequestSpec; +import com.google.gson.webservice.definition.WebServiceCallSpec; import com.google.inject.Inject; import com.google.inject.Provider; diff --git a/wsf/src/main/java/com/google/gson/wsf/inject/WebServiceCallSpecProvider.java b/wsf/src/main/java/com/google/gson/wsf/inject/WebServiceCallSpecProvider.java index 5f171a26..1fc9e99a 100755 --- a/wsf/src/main/java/com/google/gson/wsf/inject/WebServiceCallSpecProvider.java +++ b/wsf/src/main/java/com/google/gson/wsf/inject/WebServiceCallSpecProvider.java @@ -15,9 +15,9 @@ */ package com.google.gson.wsf.inject; -import com.google.gson.wsf.CallPath; -import com.google.gson.wsf.WebServiceCallSpec; -import com.google.gson.wsf.WebServiceSpec; +import com.google.gson.webservice.definition.CallPath; +import com.google.gson.webservice.definition.WebServiceCallSpec; +import com.google.gson.webservice.definition.WebServiceSpec; import com.google.inject.Inject; import com.google.inject.Provider; diff --git a/wsf/src/main/java/com/google/gson/wsf/inject/server/WebServiceCallServerProvider.java b/wsf/src/main/java/com/google/gson/wsf/inject/server/WebServiceCallServerProvider.java index 379357fa..71966917 100755 --- a/wsf/src/main/java/com/google/gson/wsf/inject/server/WebServiceCallServerProvider.java +++ b/wsf/src/main/java/com/google/gson/wsf/inject/server/WebServiceCallServerProvider.java @@ -18,10 +18,10 @@ package com.google.gson.wsf.inject.server; import javax.servlet.http.HttpServletRequest; import com.google.gson.Gson; -import com.google.gson.wsf.WebServiceCall; -import com.google.gson.wsf.WebServiceCallSpec; -import com.google.gson.wsf.WebServiceRequest; -import com.google.gson.wsf.WebServiceResponse; +import com.google.gson.webservice.definition.WebServiceCall; +import com.google.gson.webservice.definition.WebServiceCallSpec; +import com.google.gson.webservice.definition.WebServiceRequest; +import com.google.gson.webservice.definition.WebServiceResponse; import com.google.gson.wsf.server.RequestReceiver; import com.google.gson.wsf.server.WebServiceCallServerBuilder; import com.google.inject.Inject; diff --git a/wsf/src/main/java/com/google/gson/wsf/server/RequestReceiver.java b/wsf/src/main/java/com/google/gson/wsf/server/RequestReceiver.java index 4ebb83de..a3e0324c 100644 --- a/wsf/src/main/java/com/google/gson/wsf/server/RequestReceiver.java +++ b/wsf/src/main/java/com/google/gson/wsf/server/RequestReceiver.java @@ -26,14 +26,14 @@ import javax.servlet.http.HttpServletRequest; import com.google.gson.Gson; import com.google.gson.JsonParseException; -import com.google.gson.wsf.HeaderMap; -import com.google.gson.wsf.HeaderMapSpec; -import com.google.gson.wsf.HttpMethod; -import com.google.gson.wsf.RequestBody; -import com.google.gson.wsf.RequestBodySpec; -import com.google.gson.wsf.RequestSpec; -import com.google.gson.wsf.WebServiceRequest; -import com.google.gson.wsf.WebServiceSystemException; +import com.google.gson.webservice.definition.HeaderMap; +import com.google.gson.webservice.definition.HeaderMapSpec; +import com.google.gson.webservice.definition.HttpMethod; +import com.google.gson.webservice.definition.RequestBody; +import com.google.gson.webservice.definition.RequestBodySpec; +import com.google.gson.webservice.definition.RequestSpec; +import com.google.gson.webservice.definition.WebServiceRequest; +import com.google.gson.webservice.definition.WebServiceSystemException; /** * Receives and parses a request at the server side on a {@link HttpServletRequest}. diff --git a/wsf/src/main/java/com/google/gson/wsf/server/ResponseSender.java b/wsf/src/main/java/com/google/gson/wsf/server/ResponseSender.java index 92c481a9..2cccf9d4 100644 --- a/wsf/src/main/java/com/google/gson/wsf/server/ResponseSender.java +++ b/wsf/src/main/java/com/google/gson/wsf/server/ResponseSender.java @@ -23,10 +23,10 @@ import java.util.logging.Logger; import javax.servlet.http.HttpServletResponse; import com.google.gson.Gson; -import com.google.gson.wsf.HeaderMap; -import com.google.gson.wsf.HeaderMapSpec; -import com.google.gson.wsf.ResponseBody; -import com.google.gson.wsf.WebServiceResponse; +import com.google.gson.webservice.definition.HeaderMap; +import com.google.gson.webservice.definition.HeaderMapSpec; +import com.google.gson.webservice.definition.ResponseBody; +import com.google.gson.webservice.definition.WebServiceResponse; /** * Sends a JSON web service response on {@link HttpServletResponse}.