diff options
author | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-05-04 07:04:07 +0000 |
---|---|---|
committer | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-05-04 07:04:07 +0000 |
commit | 69342b0efcd4e7631e20cab07f624b4907aad6d8 (patch) | |
tree | 3a1f60fd9f16bac49bfb2276f771c9915abc7e49 /branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/http/wireformat/jsonrpc/provider/JSONRPCWireFormatServiceProvider.java | |
parent | 4989a995d0a9b221c2f7515c39c6c570db940ae9 (diff) |
TUSCANY-2968 - Further changes trying to add the json-rpc wireformat and operation selector interceptors to the invocation chain
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@771209 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/http/wireformat/jsonrpc/provider/JSONRPCWireFormatServiceProvider.java')
-rw-r--r-- | branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/http/wireformat/jsonrpc/provider/JSONRPCWireFormatServiceProvider.java | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/http/wireformat/jsonrpc/provider/JSONRPCWireFormatServiceProvider.java b/branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/http/wireformat/jsonrpc/provider/JSONRPCWireFormatServiceProvider.java index 983e54c1a7..91d35546ae 100644 --- a/branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/http/wireformat/jsonrpc/provider/JSONRPCWireFormatServiceProvider.java +++ b/branches/sca-java-1.x/modules/binding-http-new-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/http/wireformat/jsonrpc/provider/JSONRPCWireFormatServiceProvider.java @@ -20,6 +20,10 @@ package org.apache.tuscany.sca.binding.http.wireformat.jsonrpc.provider; import org.apache.tuscany.sca.assembly.Binding; +import org.apache.tuscany.sca.assembly.BindingRRB; +import org.apache.tuscany.sca.assembly.WireFormat; +import org.apache.tuscany.sca.binding.http.HTTPBinding; +import org.apache.tuscany.sca.binding.http.wireformat.jsonrpc.JSONRPCWireFormat; import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.interfacedef.InterfaceContract; import org.apache.tuscany.sca.invocation.Interceptor; @@ -32,12 +36,19 @@ import org.apache.tuscany.sca.runtime.RuntimeComponentService; * @version $Rev$ $Date$ */ public class JSONRPCWireFormatServiceProvider implements WireFormatProvider { + private RuntimeComponent component; + private RuntimeComponentService service; + private Binding binding; public JSONRPCWireFormatServiceProvider(ExtensionPointRegistry extensionPoints, RuntimeComponent component, RuntimeComponentService service, Binding binding) { + super(); + this.component = component; + this.service = service; + this.binding = binding; } public InterfaceContract configureWireFormatInterfaceContract(InterfaceContract interfaceContract) { @@ -46,7 +57,14 @@ public class JSONRPCWireFormatServiceProvider implements WireFormatProvider { } public Interceptor createInterceptor() { - // TODO Auto-generated method stub + if(binding instanceof BindingRRB) { + BindingRRB rrbBinding = (BindingRRB) binding; + WireFormat wireFormat = rrbBinding.getRequestWireFormat(); + if(wireFormat != null && wireFormat instanceof JSONRPCWireFormat) { + return new JSONRPCWireFormatInterceptor((HTTPBinding) binding, service.getRuntimeWire(binding)); + } + } + return null; } |