diff options
author | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-11 23:11:48 +0000 |
---|---|---|
committer | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-11 23:11:48 +0000 |
commit | ece4fd35da7b7fc76264776f81705e6b5b52d3e0 (patch) | |
tree | 962794e2a2b1ab91a02c41e4927a527cade83959 /branches/java-post-M1/sca/bindings/binding.jsonrpc/src/main/java/org/apache/tuscany/binding/jsonrpc/handler | |
parent | 76e9f96ca7f494088fe3af5a46ad0d153e961008 (diff) |
Moving 1.x branches
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835140 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/java-post-M1/sca/bindings/binding.jsonrpc/src/main/java/org/apache/tuscany/binding/jsonrpc/handler')
2 files changed, 0 insertions, 127 deletions
diff --git a/branches/java-post-M1/sca/bindings/binding.jsonrpc/src/main/java/org/apache/tuscany/binding/jsonrpc/handler/JSONRPCEntryPointServlet.java b/branches/java-post-M1/sca/bindings/binding.jsonrpc/src/main/java/org/apache/tuscany/binding/jsonrpc/handler/JSONRPCEntryPointServlet.java deleted file mode 100644 index f59867b725..0000000000 --- a/branches/java-post-M1/sca/bindings/binding.jsonrpc/src/main/java/org/apache/tuscany/binding/jsonrpc/handler/JSONRPCEntryPointServlet.java +++ /dev/null @@ -1,76 +0,0 @@ -/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed 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.binding.jsonrpc.handler;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import org.apache.tuscany.core.context.EntryPointContext;
-
-import com.metaparadigm.jsonrpc.JSONRPCBridge;
-import com.metaparadigm.jsonrpc.JSONRPCServlet;
-
-/**
- *
- *
- */
-public class JSONRPCEntryPointServlet extends JSONRPCServlet {
- private static final long serialVersionUID = 1L;
-
- private transient List<EntryPointContext> entryPoints;
-
- public JSONRPCEntryPointServlet() {
- entryPoints = new ArrayList<EntryPointContext>();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.metaparadigm.jsonrpc.JSONRPCServlet#service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
- */
- @Override
- public void service(HttpServletRequest request, HttpServletResponse response) throws IOException, ClassCastException {
-
- /*
- * Create a new bridge for every request to aviod all the problems with JSON-RPC-Java storing the bridge in the session
- */
- HttpSession session = request.getSession();
- try {
-
- JSONRPCBridge jsonrpcBridge = new JSONRPCBridge();
- for (EntryPointContext epc : entryPoints) {
- jsonrpcBridge.registerObject(epc.getName(), epc.getInstance(null));
- }
- session.setAttribute("JSONRPCBridge", jsonrpcBridge);
-
- super.service(request, response);
-
- } finally {
- session.removeAttribute("JSONRPCBridge");
- }
- }
-
- public void addEntryPoint(EntryPointContext epc) {
- entryPoints.add(epc);
- }
-}
diff --git a/branches/java-post-M1/sca/bindings/binding.jsonrpc/src/main/java/org/apache/tuscany/binding/jsonrpc/handler/ScriptGetterServlet.java b/branches/java-post-M1/sca/bindings/binding.jsonrpc/src/main/java/org/apache/tuscany/binding/jsonrpc/handler/ScriptGetterServlet.java deleted file mode 100644 index 9177462de0..0000000000 --- a/branches/java-post-M1/sca/bindings/binding.jsonrpc/src/main/java/org/apache/tuscany/binding/jsonrpc/handler/ScriptGetterServlet.java +++ /dev/null @@ -1,51 +0,0 @@ -/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed 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.binding.jsonrpc.handler;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-public class ScriptGetterServlet extends HttpServlet {
-
- private static final long serialVersionUID = 1L;
-
- private static final String SCA_INIT_JS = "SCA = new JSONRpcClient(\"SCA/jsonrpc\");";
-
- public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
- URL url = getClass().getResource("jsonrpc.js");
- InputStream is = url.openStream();
- writeToStream(response, is);
-
- writeToStream(response, new ByteArrayInputStream(SCA_INIT_JS.getBytes()));
- }
-
- private void writeToStream(HttpServletResponse response, InputStream is) throws IOException {
- ServletOutputStream os = response.getOutputStream();
- int i;
- while ((i = is.read()) != -1) {
- os.write(i);
- }
- }
-
-}
|