summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.x/modules
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-05-04 06:56:23 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-05-04 06:56:23 +0000
commita7aa9b95cdff3fd2b0124a4845c0c1cccc29bafe (patch)
treebe8cdc784199cf62c450a935e567176b34dc2414 /branches/sca-java-1.x/modules
parent3221e52e05a023d6a51592607925d06be7efdd11 (diff)
TUSCANY-2968 - JSONRPC operation selector
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@771205 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/modules')
-rw-r--r--branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/pom.xml4
-rw-r--r--branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/http/operationselector/jsonrpc/provider/JSONRPCOperationSelectorInterceptor.java52
-rw-r--r--branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/http/operationselector/jsonrpc/provider/JSONRPCOperationSelectorProviderFactory.java47
-rw-r--r--branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/http/operationselector/jsonrpc/provider/JSONRPCOperationSelectorServiceProvider.java50
-rw-r--r--branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.OperationSelectorProviderFactory18
-rw-r--r--branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src/test/resources/JSONRPCBinding.composite9
-rw-r--r--branches/sca-java-1.x/modules/binding-http-new-jsonrpc/pom.xml4
-rw-r--r--branches/sca-java-1.x/modules/binding-http-new-runtime/pom.xml6
-rw-r--r--branches/sca-java-1.x/modules/binding-http-new/pom.xml4
9 files changed, 181 insertions, 13 deletions
diff --git a/branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/pom.xml b/branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/pom.xml
index fd862f918d..ce514223d3 100644
--- a/branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/pom.xml
+++ b/branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/pom.xml
@@ -26,7 +26,7 @@
<relativePath>../pom.xml</relativePath>
</parent>
- <artifactId>tuscany-binding-http-oasis-jsonrpc-runtime</artifactId>
+ <artifactId>tuscany-binding-http-new-jsonrpc-runtime</artifactId>
<name>Apache Tuscany SCA HTTP Binding JSON-RPC Runtime</name>
<dependencies>
@@ -44,7 +44,7 @@
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-http-oasis-jsonrpc</artifactId>
+ <artifactId>tuscany-binding-http-new-jsonrpc</artifactId>
<version>1.6-SNAPSHOT</version>
</dependency>
diff --git a/branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/http/operationselector/jsonrpc/provider/JSONRPCOperationSelectorInterceptor.java b/branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/http/operationselector/jsonrpc/provider/JSONRPCOperationSelectorInterceptor.java
new file mode 100644
index 0000000000..f189b940ad
--- /dev/null
+++ b/branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/http/operationselector/jsonrpc/provider/JSONRPCOperationSelectorInterceptor.java
@@ -0,0 +1,52 @@
+/*
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.http.operationselector.jsonrpc.provider;
+
+import org.apache.tuscany.sca.binding.http.HTTPBinding;
+import org.apache.tuscany.sca.invocation.Interceptor;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.invocation.Message;
+import org.apache.tuscany.sca.runtime.RuntimeWire;
+
+public class JSONRPCOperationSelectorInterceptor implements Interceptor {
+ private Invoker next;
+
+ private RuntimeWire runtimeWire;
+ private HTTPBinding binding;
+
+ public JSONRPCOperationSelectorInterceptor(HTTPBinding binding, RuntimeWire runtimeWire) {
+ this.binding = binding;
+ this.runtimeWire = runtimeWire;
+
+ }
+
+ public Invoker getNext() {
+ return null;
+ }
+
+ public void setNext(Invoker next) {
+
+ }
+
+ public Message invoke(Message msg) {
+ return null;
+ }
+
+}
diff --git a/branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/http/operationselector/jsonrpc/provider/JSONRPCOperationSelectorProviderFactory.java b/branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/http/operationselector/jsonrpc/provider/JSONRPCOperationSelectorProviderFactory.java
new file mode 100644
index 0000000000..786e8f8855
--- /dev/null
+++ b/branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/http/operationselector/jsonrpc/provider/JSONRPCOperationSelectorProviderFactory.java
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.http.operationselector.jsonrpc.provider;
+
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.binding.http.operationselector.jsonrpc.JSONRPCOperationSelector;
+import org.apache.tuscany.sca.provider.OperationSelectorProvider;
+import org.apache.tuscany.sca.provider.OperationSelectorProviderFactory;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
+import org.apache.tuscany.sca.runtime.RuntimeComponentService;
+
+public class JSONRPCOperationSelectorProviderFactory implements OperationSelectorProviderFactory<JSONRPCOperationSelector> {
+
+ public OperationSelectorProvider createReferenceOperationSelectorProvider(RuntimeComponent component,
+ RuntimeComponentReference reference,
+ Binding binding) {
+ return null;
+ }
+
+ public OperationSelectorProvider createServiceOperationSelectorProvider(RuntimeComponent component,
+ RuntimeComponentService service,
+ Binding binding) {
+ return new JSONRPCOperationSelectorServiceProvider(component, service, binding);
+ }
+
+ public Class<JSONRPCOperationSelector> getModelType() {
+ return JSONRPCOperationSelector.class;
+ }
+}
diff --git a/branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/http/operationselector/jsonrpc/provider/JSONRPCOperationSelectorServiceProvider.java b/branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/http/operationselector/jsonrpc/provider/JSONRPCOperationSelectorServiceProvider.java
new file mode 100644
index 0000000000..a57105ed3f
--- /dev/null
+++ b/branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/http/operationselector/jsonrpc/provider/JSONRPCOperationSelectorServiceProvider.java
@@ -0,0 +1,50 @@
+/*
+ * 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.
+ */
+
+package org.apache.tuscany.sca.binding.http.operationselector.jsonrpc.provider;
+
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.binding.http.HTTPBinding;
+import org.apache.tuscany.sca.invocation.Interceptor;
+import org.apache.tuscany.sca.invocation.Phase;
+import org.apache.tuscany.sca.provider.OperationSelectorProvider;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.apache.tuscany.sca.runtime.RuntimeComponentService;
+
+public class JSONRPCOperationSelectorServiceProvider implements OperationSelectorProvider {
+ private RuntimeComponent component;
+ private RuntimeComponentService service;
+ private Binding binding;
+
+ public JSONRPCOperationSelectorServiceProvider(RuntimeComponent component, RuntimeComponentService service, Binding binding) {
+ super();
+ this.component = component;
+ this.service = service;
+ this.binding = binding;
+ }
+
+ public Interceptor createInterceptor() {
+ return new JSONRPCOperationSelectorInterceptor((HTTPBinding) binding, service.getRuntimeWire(binding));
+ }
+
+ public String getPhase() {
+ return Phase.SERVICE_BINDING_OPERATION_SELECTOR;
+ }
+
+}
diff --git a/branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.OperationSelectorProviderFactory b/branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.OperationSelectorProviderFactory
new file mode 100644
index 0000000000..9bf5fe9ad7
--- /dev/null
+++ b/branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.OperationSelectorProviderFactory
@@ -0,0 +1,18 @@
+# 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.
+
+org.apache.tuscany.sca.binding.http.operationselector.jsonrpc.provider.JSONRPCOperationSelectorPropProviderFactory;model=org.apache.tuscany.sca.binding.http.operationselector.jsonrpc.JSONRPCOperationSelector
diff --git a/branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src/test/resources/JSONRPCBinding.composite b/branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src/test/resources/JSONRPCBinding.composite
index 692918fa69..ddbd9d1fc3 100644
--- a/branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src/test/resources/JSONRPCBinding.composite
+++ b/branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src/test/resources/JSONRPCBinding.composite
@@ -19,15 +19,16 @@
-->
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
targetNamespace="http://jsonrpc"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
xmlns:jsonrpc="http://jsonrpc"
name="JSONRPCBinding">
<service name="EchoService" promote="EchoComponent">
<interface.java interface="echo.Echo"/>
- <binding.http uri="http://localhost:8085/SCADomain/EchoService">
- <wireFormat.jsonrpc/>
- <operationSelector.jsonrpc/>
- </binding.http>
+ <tuscany:binding.http uri="http://localhost:8085/SCADomain/EchoService">
+ <tuscany:wireFormat.jsonrpc/>
+ <tuscany:operationSelector.jsonrpc/>
+ </tuscany:binding.http>
</service>
<component name="EchoComponent">
diff --git a/branches/sca-java-1.x/modules/binding-http-new-jsonrpc/pom.xml b/branches/sca-java-1.x/modules/binding-http-new-jsonrpc/pom.xml
index 8841f56a86..bed0fd5eb9 100644
--- a/branches/sca-java-1.x/modules/binding-http-new-jsonrpc/pom.xml
+++ b/branches/sca-java-1.x/modules/binding-http-new-jsonrpc/pom.xml
@@ -26,7 +26,7 @@
<relativePath>../pom.xml</relativePath>
</parent>
- <artifactId>tuscany-binding-http-oasis-jsonrpc</artifactId>
+ <artifactId>tuscany-binding-http-new-jsonrpc</artifactId>
<name>Apache Tuscany SCA HTTP Binding JSON-RPC Model</name>
<dependencies>
@@ -44,7 +44,7 @@
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-http-oasis</artifactId>
+ <artifactId>tuscany-binding-http-new</artifactId>
<version>1.6-SNAPSHOT</version>
</dependency>
diff --git a/branches/sca-java-1.x/modules/binding-http-new-runtime/pom.xml b/branches/sca-java-1.x/modules/binding-http-new-runtime/pom.xml
index f2d66847ea..1f0c76b1ae 100644
--- a/branches/sca-java-1.x/modules/binding-http-new-runtime/pom.xml
+++ b/branches/sca-java-1.x/modules/binding-http-new-runtime/pom.xml
@@ -26,13 +26,13 @@
<relativePath>../pom.xml</relativePath>
</parent>
- <artifactId>tuscany-binding-http-oasis-runtime</artifactId>
- <name>Apache Tuscany SCA HTTP OASIS Binding Runtime</name>
+ <artifactId>tuscany-binding-http-new-runtime</artifactId>
+ <name>Apache Tuscany SCA HTTP Binding Runtime</name>
<dependencies>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-http-oasis</artifactId>
+ <artifactId>tuscany-binding-http-new</artifactId>
<version>1.6-SNAPSHOT</version>
</dependency>
diff --git a/branches/sca-java-1.x/modules/binding-http-new/pom.xml b/branches/sca-java-1.x/modules/binding-http-new/pom.xml
index 4b067656b8..7ae4ed91bf 100644
--- a/branches/sca-java-1.x/modules/binding-http-new/pom.xml
+++ b/branches/sca-java-1.x/modules/binding-http-new/pom.xml
@@ -26,8 +26,8 @@
<relativePath>../pom.xml</relativePath>
</parent>
- <artifactId>tuscany-binding-http-oasis</artifactId>
- <name>Apache Tuscany SCA HTTP OASIS Binding Model</name>
+ <artifactId>tuscany-binding-http-new</artifactId>
+ <name>Apache Tuscany SCA HTTP Binding Model</name>
<dependencies>
<dependency>