summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src
diff options
context:
space:
mode:
Diffstat (limited to 'branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src')
-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
5 files changed, 172 insertions, 4 deletions
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">