From a7aa9b95cdff3fd2b0124a4845c0c1cccc29bafe Mon Sep 17 00:00:00 2001 From: lresende Date: Mon, 4 May 2009 06:56:23 +0000 Subject: TUSCANY-2968 - JSONRPC operation selector git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@771205 13f79535-47bb-0310-9956-ffa450edef68 --- .../binding-http-new-jsonrpc-runtime/pom.xml | 4 +- .../JSONRPCOperationSelectorInterceptor.java | 52 ++++++++++++++++++++++ .../JSONRPCOperationSelectorProviderFactory.java | 47 +++++++++++++++++++ .../JSONRPCOperationSelectorServiceProvider.java | 50 +++++++++++++++++++++ ...y.sca.provider.OperationSelectorProviderFactory | 18 ++++++++ .../src/test/resources/JSONRPCBinding.composite | 9 ++-- .../modules/binding-http-new-jsonrpc/pom.xml | 4 +- .../modules/binding-http-new-runtime/pom.xml | 6 +-- .../sca-java-1.x/modules/binding-http-new/pom.xml | 4 +- 9 files changed, 181 insertions(+), 13 deletions(-) create mode 100644 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 create mode 100644 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 create mode 100644 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 create mode 100644 branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.OperationSelectorProviderFactory (limited to 'branches') 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 @@ ../pom.xml - tuscany-binding-http-oasis-jsonrpc-runtime + tuscany-binding-http-new-jsonrpc-runtime Apache Tuscany SCA HTTP Binding JSON-RPC Runtime @@ -44,7 +44,7 @@ org.apache.tuscany.sca - tuscany-binding-http-oasis-jsonrpc + tuscany-binding-http-new-jsonrpc 1.6-SNAPSHOT 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 { + + 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 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 @@ --> - - - - + + + + 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 @@ ../pom.xml - tuscany-binding-http-oasis-jsonrpc + tuscany-binding-http-new-jsonrpc Apache Tuscany SCA HTTP Binding JSON-RPC Model @@ -44,7 +44,7 @@ org.apache.tuscany.sca - tuscany-binding-http-oasis + tuscany-binding-http-new 1.6-SNAPSHOT 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 @@ ../pom.xml - tuscany-binding-http-oasis-runtime - Apache Tuscany SCA HTTP OASIS Binding Runtime + tuscany-binding-http-new-runtime + Apache Tuscany SCA HTTP Binding Runtime org.apache.tuscany.sca - tuscany-binding-http-oasis + tuscany-binding-http-new 1.6-SNAPSHOT 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 @@ ../pom.xml - tuscany-binding-http-oasis - Apache Tuscany SCA HTTP OASIS Binding Model + tuscany-binding-http-new + Apache Tuscany SCA HTTP Binding Model -- cgit v1.2.3