From 644d1e212af0c1026588c0f670ee12d57696c3c5 Mon Sep 17 00:00:00 2001 From: lresende Date: Fri, 11 Nov 2011 00:53:34 +0000 Subject: Tidying up comments and javadocs git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1200674 13f79535-47bb-0310-9956-ffa450edef68 --- .../HTTPDefaultOperationSelectorProviderFactory.java | 4 ++++ ...TTPDefaultServiceOperationSelectorInterceptor.java | 13 +++++-------- .../HTTPRPCOperationSelectorProviderFactory.java | 4 ++++ .../http/provider/HTTPBindingServiceServlet.java | 10 ++++++++++ .../HTTPDefaultWireFormatProviderFactory.java | 4 ++++ .../HTTPDefaultWireFormatServiceInterceptor.java | 19 +++---------------- .../provider/HTTPJSONWireFormatProviderFactory.java | 4 ++++ .../provider/HTTPXMLWireFormatProviderFactory.java | 4 ++++ 8 files changed, 38 insertions(+), 24 deletions(-) (limited to 'sca-java-2.x/trunk/modules') diff --git a/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/operationselector/provider/HTTPDefaultOperationSelectorProviderFactory.java b/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/operationselector/provider/HTTPDefaultOperationSelectorProviderFactory.java index f027424ff0..f1a9767374 100644 --- a/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/operationselector/provider/HTTPDefaultOperationSelectorProviderFactory.java +++ b/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/operationselector/provider/HTTPDefaultOperationSelectorProviderFactory.java @@ -28,6 +28,10 @@ import org.apache.tuscany.sca.provider.OperationSelectorProviderFactory; import org.apache.tuscany.sca.runtime.RuntimeEndpoint; import org.apache.tuscany.sca.runtime.RuntimeEndpointReference; +/** + * + * @version $Rev$ $Date$ +*/ public class HTTPDefaultOperationSelectorProviderFactory implements OperationSelectorProviderFactory{ public HTTPDefaultOperationSelectorProviderFactory(ExtensionPointRegistry extensionPoints) { diff --git a/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/operationselector/provider/HTTPDefaultServiceOperationSelectorInterceptor.java b/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/operationselector/provider/HTTPDefaultServiceOperationSelectorInterceptor.java index e9cb0fd1da..4950ea2563 100644 --- a/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/operationselector/provider/HTTPDefaultServiceOperationSelectorInterceptor.java +++ b/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/operationselector/provider/HTTPDefaultServiceOperationSelectorInterceptor.java @@ -33,15 +33,12 @@ import org.apache.tuscany.sca.runtime.RuntimeEndpoint; import org.oasisopen.sca.ServiceRuntimeException; /** - * Sets the operation based on the request path. + * HTTP Binding Default operation selector, which would map + * http method (GET, PUT, POST, DELETE) to operations matching + * those name. It also supports plain servlet using 'service' + * to provide the component functionality. * - * From a url: http://localhost:8080/HelloworldComponent/Helloworld/sayHello?name=Petra - * where the component is HelloworldComponent and the service is Helloworld - * the path will be "/sayHello" so the operation is "sayHello". - * - * TODO: we could also do something similar to how the JMS binding supports - * a single "onMessage" method to get all requests, so perhaps this could - * also support impls with method: service(HttpServletRequest, HttpServletResponse) + * @version $Rev$ $Date$ */ public class HTTPDefaultServiceOperationSelectorInterceptor implements Interceptor { diff --git a/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/operationselector/provider/HTTPRPCOperationSelectorProviderFactory.java b/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/operationselector/provider/HTTPRPCOperationSelectorProviderFactory.java index a82e8cf9f1..08766e33ea 100644 --- a/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/operationselector/provider/HTTPRPCOperationSelectorProviderFactory.java +++ b/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/operationselector/provider/HTTPRPCOperationSelectorProviderFactory.java @@ -28,6 +28,10 @@ import org.apache.tuscany.sca.provider.OperationSelectorProviderFactory; import org.apache.tuscany.sca.runtime.RuntimeEndpoint; import org.apache.tuscany.sca.runtime.RuntimeEndpointReference; +/** + * + * @version $Rev$ $Date$ +*/ public class HTTPRPCOperationSelectorProviderFactory implements OperationSelectorProviderFactory{ public HTTPRPCOperationSelectorProviderFactory(ExtensionPointRegistry extensionPoints) { diff --git a/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPBindingServiceServlet.java b/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPBindingServiceServlet.java index 13872f87bc..c345177146 100644 --- a/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPBindingServiceServlet.java +++ b/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPBindingServiceServlet.java @@ -31,6 +31,16 @@ import org.apache.tuscany.sca.invocation.Message; import org.apache.tuscany.sca.invocation.MessageFactory; import org.apache.tuscany.sca.runtime.RuntimeEndpoint; +/** + * HTTP Binding service servlet, that listens to HTTP + * requests and dispatch to the invocation chain. + * + * The proper invocation chains and/or wireformat interceptors + * will properly handle selecting the right operation and + * handling data + * + * @version $Rev$ $Date$ + */ public class HTTPBindingServiceServlet extends HttpServlet { private static final long serialVersionUID = 6496710199406616194L; diff --git a/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/wireformat/provider/HTTPDefaultWireFormatProviderFactory.java b/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/wireformat/provider/HTTPDefaultWireFormatProviderFactory.java index f3be0c27bf..4c605a62be 100644 --- a/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/wireformat/provider/HTTPDefaultWireFormatProviderFactory.java +++ b/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/wireformat/provider/HTTPDefaultWireFormatProviderFactory.java @@ -29,6 +29,10 @@ import org.apache.tuscany.sca.provider.WireFormatProviderFactory; import org.apache.tuscany.sca.runtime.RuntimeEndpoint; import org.apache.tuscany.sca.runtime.RuntimeEndpointReference; +/** + * + * @version $Rev$ $Date$ + */ public class HTTPDefaultWireFormatProviderFactory implements WireFormatProviderFactory { public HTTPDefaultWireFormatProviderFactory(ExtensionPointRegistry extensionPoints) { diff --git a/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/wireformat/provider/HTTPDefaultWireFormatServiceInterceptor.java b/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/wireformat/provider/HTTPDefaultWireFormatServiceInterceptor.java index d1c2c61242..0b6771e5bc 100644 --- a/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/wireformat/provider/HTTPDefaultWireFormatServiceInterceptor.java +++ b/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/wireformat/provider/HTTPDefaultWireFormatServiceInterceptor.java @@ -19,7 +19,6 @@ package org.apache.tuscany.sca.binding.http.wireformat.provider; -import org.apache.tuscany.sca.binding.http.HTTPBinding; import org.apache.tuscany.sca.common.http.HTTPContext; import org.apache.tuscany.sca.invocation.Interceptor; import org.apache.tuscany.sca.invocation.Invoker; @@ -28,27 +27,15 @@ import org.apache.tuscany.sca.runtime.RuntimeEndpoint; /** * Handles the default wire format for the http binding - * - * 1- determine the request and response format (xml, json, etc) from the - * binding config or content type header and accept headers - * - TODO: need a way to configure the databinding framework based on that format - * 2- get the request contents from the HttpServletRequest - * - for a post its just the request body - * - for a get need to convert the query string into a body based on the format (xml, json, etc) - * 3- send the request on down the wire - * 4- set the response contents in the HttpServletResponse - * (the databinding should already have put it in the correct format) + * by passing the HTTP request and response down to the + * actual component implementation that is a servlet. * */ public class HTTPDefaultWireFormatServiceInterceptor implements Interceptor { - - private RuntimeEndpoint endpoint; - private HTTPBinding binding; private Invoker next; public HTTPDefaultWireFormatServiceInterceptor(RuntimeEndpoint endpoint) { - this.endpoint = endpoint; - this.binding = (HTTPBinding) endpoint.getBinding(); + } @Override diff --git a/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/wireformat/provider/HTTPJSONWireFormatProviderFactory.java b/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/wireformat/provider/HTTPJSONWireFormatProviderFactory.java index c9ef568402..004941fdf5 100644 --- a/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/wireformat/provider/HTTPJSONWireFormatProviderFactory.java +++ b/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/wireformat/provider/HTTPJSONWireFormatProviderFactory.java @@ -29,6 +29,10 @@ import org.apache.tuscany.sca.provider.WireFormatProviderFactory; import org.apache.tuscany.sca.runtime.RuntimeEndpoint; import org.apache.tuscany.sca.runtime.RuntimeEndpointReference; +/** + * + * @version $Rev$ $Date$ + */ public class HTTPJSONWireFormatProviderFactory implements WireFormatProviderFactory { public HTTPJSONWireFormatProviderFactory(ExtensionPointRegistry extensionPoints) { diff --git a/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/wireformat/provider/HTTPXMLWireFormatProviderFactory.java b/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/wireformat/provider/HTTPXMLWireFormatProviderFactory.java index 3a670bd299..d09ddc0ea5 100644 --- a/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/wireformat/provider/HTTPXMLWireFormatProviderFactory.java +++ b/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/wireformat/provider/HTTPXMLWireFormatProviderFactory.java @@ -31,6 +31,10 @@ import org.apache.tuscany.sca.provider.WireFormatProviderFactory; import org.apache.tuscany.sca.runtime.RuntimeEndpoint; import org.apache.tuscany.sca.runtime.RuntimeEndpointReference; +/** + * + * @version $Rev$ $Date$ + */ public class HTTPXMLWireFormatProviderFactory implements WireFormatProviderFactory { private DOMHelper domHelper; -- cgit v1.2.3