You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2010/09/04 07:57:18 UTC

svn commit: r992546 - in /tuscany/sca-java-2.x/trunk/modules/binding-jsonp: ./ src/main/java/org/apache/tuscany/sca/binding/jsonp/ src/main/java/org/apache/tuscany/sca/binding/jsonp/impl/ src/main/resources/META-INF/services/

Author: antelder
Date: Sat Sep  4 05:57:17 2010
New Revision: 992546

URL: http://svn.apache.org/viewvc?rev=992546&view=rev
Log:
Change the jsonp binding so that it uses the http binding to do the work, ie using <binding.jsonp/> under the covers does <binding.http><wireFormat.jsonp/></binding.http>

Added:
    tuscany/sca-java-2.x/trunk/modules/binding-jsonp/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
Removed:
    tuscany/sca-java-2.x/trunk/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/impl/
Modified:
    tuscany/sca-java-2.x/trunk/modules/binding-jsonp/pom.xml
    tuscany/sca-java-2.x/trunk/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/JSONPBinding.java
    tuscany/sca-java-2.x/trunk/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/JSONPBindingFactory.java
    tuscany/sca-java-2.x/trunk/modules/binding-jsonp/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.jsonp.JSONPBindingFactory

Modified: tuscany/sca-java-2.x/trunk/modules/binding-jsonp/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-jsonp/pom.xml?rev=992546&r1=992545&r2=992546&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-jsonp/pom.xml (original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-jsonp/pom.xml Sat Sep  4 05:57:17 2010
@@ -32,7 +32,7 @@
 
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-assembly</artifactId>
+            <artifactId>tuscany-binding-http</artifactId>
             <version>2.0-SNAPSHOT</version>
         </dependency>
 

Modified: tuscany/sca-java-2.x/trunk/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/JSONPBinding.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/JSONPBinding.java?rev=992546&r1=992545&r2=992546&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/JSONPBinding.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/JSONPBinding.java Sat Sep  4 05:57:17 2010
@@ -19,13 +19,20 @@
 
 package org.apache.tuscany.sca.binding.jsonp;
 
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.binding.http.HTTPDefaultOperationSelector;
+import org.apache.tuscany.sca.binding.http.HTTPDefaultWireFormat;
+import org.apache.tuscany.sca.binding.http.impl.HTTPBindingImpl;
 
 /**
  * JSONP Binding model
  */
-public interface JSONPBinding extends Binding {
-    QName TYPE = new QName(SCA11_TUSCANY_NS, "binding.jsonp");
+public class JSONPBinding extends HTTPBindingImpl {
+    public JSONPBinding() {
+        super();
+
+        // configure the HTTP binding for JSONP (which for the moment is the default wireFormat)
+        setOperationSelector(new HTTPDefaultOperationSelector());
+        setRequestWireFormat(new HTTPDefaultWireFormat());
+        setResponseWireFormat(new HTTPDefaultWireFormat());
+    }
 }

Modified: tuscany/sca-java-2.x/trunk/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/JSONPBindingFactory.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/JSONPBindingFactory.java?rev=992546&r1=992545&r2=992546&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/JSONPBindingFactory.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/JSONPBindingFactory.java Sat Sep  4 05:57:17 2010
@@ -19,13 +19,13 @@
 
 package org.apache.tuscany.sca.binding.jsonp;
 
+
 /**
  * Factory to create JSONPBinding instances
  */
-public interface JSONPBindingFactory {
+public class JSONPBindingFactory {
 
-    /**
-     * Create JSONPBinding model
-     */
-    JSONPBinding createJSONPBinding();
+    public JSONPBinding createJSONPBinding() {
+        return new JSONPBinding();
+    }
 }

Modified: tuscany/sca-java-2.x/trunk/modules/binding-jsonp/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.jsonp.JSONPBindingFactory
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-jsonp/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.jsonp.JSONPBindingFactory?rev=992546&r1=992545&r2=992546&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-jsonp/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.jsonp.JSONPBindingFactory (original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-jsonp/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.jsonp.JSONPBindingFactory Sat Sep  4 05:57:17 2010
@@ -16,5 +16,6 @@
 # under the License. 
 
 # Implementation class for model factory
-org.apache.tuscany.sca.binding.jsonp.impl.JSONPBindingFactoryImpl
+org.apache.tuscany.sca.binding.jsonp.JSONPBindingFactory
+
 

Added: tuscany/sca-java-2.x/trunk/modules/binding-jsonp/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-jsonp/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory?rev=992546&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-jsonp/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory (added)
+++ tuscany/sca-java-2.x/trunk/modules/binding-jsonp/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory Sat Sep  4 05:57:17 2010
@@ -0,0 +1,20 @@
+# 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. 
+
+# Implementation class for the binding extension
+org.apache.tuscany.sca.binding.http.provider.HTTPBindingProviderFactory;model=org.apache.tuscany.sca.binding.jsonp.JSONPBinding
+