diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org')
5 files changed, 12 insertions, 57 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPDefaultServiceOperationSelectorInterceptor.java b/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPDefaultServiceOperationSelectorInterceptor.java index dc4f37dbad..d45401bd7f 100644 --- a/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPDefaultServiceOperationSelectorInterceptor.java +++ b/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPDefaultServiceOperationSelectorInterceptor.java @@ -23,7 +23,7 @@ import java.util.List; import javax.servlet.http.HttpServletRequest;
-import org.apache.tuscany.sca.binding.http.provider.HTTPContext;
+import org.apache.tuscany.sca.common.http.HTTPContext;
import org.apache.tuscany.sca.interfacedef.Interface;
import org.apache.tuscany.sca.interfacedef.Operation;
import org.apache.tuscany.sca.invocation.Interceptor;
@@ -56,7 +56,7 @@ public class HTTPDefaultServiceOperationSelectorInterceptor implements Intercept @Override
public Message invoke(Message msg) {
HTTPContext context = msg.getBindingContext();
- HttpServletRequest request = context.getRequest();
+ HttpServletRequest request = context.getHttpRequest();
String path = request.getPathInfo();
if (path.startsWith("/")) {
path = path.substring(1);
diff --git a/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPDefaultWireFormatServiceInterceptor.java b/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPDefaultWireFormatServiceInterceptor.java index fcbf8015f8..e2ac99bfb8 100644 --- a/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPDefaultWireFormatServiceInterceptor.java +++ b/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPDefaultWireFormatServiceInterceptor.java @@ -35,7 +35,7 @@ import javax.servlet.ServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.tuscany.sca.binding.http.provider.HTTPContext;
+import org.apache.tuscany.sca.common.http.HTTPContext;
import org.apache.tuscany.sca.interfacedef.DataType;
import org.apache.tuscany.sca.interfacedef.Operation;
import org.apache.tuscany.sca.invocation.Interceptor;
@@ -87,7 +87,7 @@ public class HTTPDefaultWireFormatServiceInterceptor implements Interceptor { private Message invokeRequest(Message msg) throws IOException {
HTTPContext context = msg.getBindingContext();
- HttpServletRequest servletRequest = context.getRequest();
+ HttpServletRequest servletRequest = context.getHttpRequest();
if ("GET".equals(servletRequest.getMethod())) {
msg.setBody(getRequestFromQueryString(msg.getOperation(), servletRequest));
} else {
@@ -120,8 +120,8 @@ public class HTTPDefaultWireFormatServiceInterceptor implements Interceptor { private Message invokeResponse(Message msg) throws IOException {
HTTPContext context = msg.getBindingContext();
- HttpServletRequest servletRequest = context.getRequest();
- HttpServletResponse servletResponse = context.getResponse();
+ HttpServletRequest servletRequest = context.getHttpRequest();
+ HttpServletResponse servletResponse = context.getHttpResponse();
if (msg.isFault()) {
servletResponse.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, String.valueOf(msg.getBody()));
diff --git a/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPXMLWireFormatServiceInterceptor.java b/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPXMLWireFormatServiceInterceptor.java index 8bd8b8b9f0..bfc22ec78f 100644 --- a/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPXMLWireFormatServiceInterceptor.java +++ b/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPXMLWireFormatServiceInterceptor.java @@ -34,7 +34,7 @@ import javax.servlet.ServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.tuscany.sca.binding.http.provider.HTTPContext;
+import org.apache.tuscany.sca.common.http.HTTPContext;
import org.apache.tuscany.sca.common.xml.dom.DOMHelper;
import org.apache.tuscany.sca.interfacedef.Operation;
import org.apache.tuscany.sca.interfacedef.util.FaultException;
@@ -80,7 +80,7 @@ public class HTTPXMLWireFormatServiceInterceptor implements Interceptor { private Message invokeRequest(Message msg) throws IOException, SAXException {
HTTPContext context = msg.getBindingContext();
- HttpServletRequest servletRequest = context.getRequest();
+ HttpServletRequest servletRequest = context.getHttpRequest();
if ("GET".equals(servletRequest.getMethod())) {
msg.setBody(getRequestFromQueryString(msg.getOperation(), servletRequest));
} else {
@@ -91,7 +91,7 @@ public class HTTPXMLWireFormatServiceInterceptor implements Interceptor { private Message invokeResponse(Message msg) throws IOException {
HTTPContext context = msg.getBindingContext();
- HttpServletResponse servletResponse = context.getResponse();
+ HttpServletResponse servletResponse = context.getHttpResponse();
servletResponse.setContentType("text/xml");
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 686032571e..4d1f655577 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 @@ -26,6 +26,7 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.tuscany.sca.common.http.HTTPContext; import org.apache.tuscany.sca.invocation.Message; import org.apache.tuscany.sca.invocation.MessageFactory; import org.apache.tuscany.sca.runtime.RuntimeEndpoint; @@ -44,8 +45,8 @@ public class HTTPBindingServiceServlet extends HttpServlet { @Override protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { HTTPContext bindingContext = new HTTPContext(); - bindingContext.setRequest(request); - bindingContext.setResponse(response); + bindingContext.setHttpRequest(request); + bindingContext.setHttpResponse(response); Message msg = messageFactory.createMessage(); msg.setBindingContext(bindingContext); wire.invoke(msg); diff --git a/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPContext.java b/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPContext.java deleted file mode 100644 index 0a49823f06..0000000000 --- a/sca-java-2.x/trunk/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPContext.java +++ /dev/null @@ -1,46 +0,0 @@ -/*
- * 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.provider;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * Holder to pass servlet request and response between the Inteceptors
- */
-public class HTTPContext {
-
- private HttpServletRequest request;
- private HttpServletResponse response;
-
- public HttpServletRequest getRequest() {
- return request;
- }
- public void setRequest(HttpServletRequest request) {
- this.request = request;
- }
- public HttpServletResponse getResponse() {
- return response;
- }
- public void setResponse(HttpServletResponse response) {
- this.response = response;
- }
-
-}
|