summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Campo2008-01-17 09:32:29 (EST)
committerChristian Campo2008-01-17 09:32:29 (EST)
commit15b5b44a7f04944c324ebc656dcafde080a28af3 (patch)
tree075cd3ea0bf617dfa2d7078eb42ddbbf3baea17e
parent2a2e069a19022ee182a2537571093e2b80497ab4 (diff)
downloadorg.eclipse.riena-15b5b44a7f04944c324ebc656dcafde080a28af3.zip
org.eclipse.riena-15b5b44a7f04944c324ebc656dcafde080a28af3.tar.gz
org.eclipse.riena-15b5b44a7f04944c324ebc656dcafde080a28af3.tar.bz2
changes to make hessian-3.1.3 work again disabling the check for Serializable in the SerializerFactory of hessian
-rw-r--r--org.eclipse.riena.communication.publisher.hessian/about.html24
-rw-r--r--org.eclipse.riena.communication.publisher.hessian/src/org/eclipse/riena/communication/publisher/hessian/HessianRienaDispatcherServlet.java210
2 files changed, 130 insertions, 104 deletions
diff --git a/org.eclipse.riena.communication.publisher.hessian/about.html b/org.eclipse.riena.communication.publisher.hessian/about.html
new file mode 100644
index 0000000..fc81119
--- /dev/null
+++ b/org.eclipse.riena.communication.publisher.hessian/about.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+
+
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>About</title></head><body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2006</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+<div style="position: absolute; width: 28px; height: 28px; z-index: 1000; display: none;"></div><img style="position: absolute; width: 35px; height: 29px; z-index: 1000; display: none;" src="about-Dateien/launch.png"></body></html> \ No newline at end of file
diff --git a/org.eclipse.riena.communication.publisher.hessian/src/org/eclipse/riena/communication/publisher/hessian/HessianRienaDispatcherServlet.java b/org.eclipse.riena.communication.publisher.hessian/src/org/eclipse/riena/communication/publisher/hessian/HessianRienaDispatcherServlet.java
index ae1cf53..1147be4 100644
--- a/org.eclipse.riena.communication.publisher.hessian/src/org/eclipse/riena/communication/publisher/hessian/HessianRienaDispatcherServlet.java
+++ b/org.eclipse.riena.communication.publisher.hessian/src/org/eclipse/riena/communication/publisher/hessian/HessianRienaDispatcherServlet.java
@@ -41,109 +41,111 @@ import com.caucho.hessian.server.HessianSkeleton;
@SuppressWarnings("serial")
public class HessianRienaDispatcherServlet extends GenericServlet {
- private SerializerFactory serializerFactory = new SerializerFactory();
-
- @Override
- public void init(ServletConfig config) throws ServletException {
- super.init(config);
- log("HessianRienaDispatcherServlet:: DEBUG initialized");
- }
-
- @Override
- public void log(String message) {
- System.out.println(message);
- }
-
- public void log(String message, Exception e) {
- System.out.println(message + "(" + e.getMessage() + ")");
- }
-
- @Override
- public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
-
- HttpServletRequest httpReq = (HttpServletRequest) req;
- HttpServletResponse httpRes = (HttpServletResponse) res;
-
- // set the message context
- MessageContextAccessor.setMessageContext(new MessageContext(httpReq, httpRes));
-
- HessianRemoteServicePublisher publisher = getPublisher();
- if (publisher == null) {
- if (httpReq.getMethod().equals("GET")) {
- if (httpReq.getRemoteHost().equals("127.0.0.1")) {
- PrintWriter pw = new PrintWriter(res.getOutputStream());
- pw.write(new String("no webservices available"));
- pw.flush();
- return;
- } else {
- httpRes.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, "Hessian requires POST");
- return;
- }
- } else {
- httpRes.sendError(HttpServletResponse.SC_NOT_FOUND, "webservice not found");
- return;
- }
- }
- String requestURI = httpReq.getRequestURI();
- String contextPath = httpReq.getContextPath();
- if (contextPath.length()>1) {
- requestURI = requestURI.substring(contextPath.length());
- }
- RemoteServiceDescription rsd = publisher.findService(requestURI);
- log("call " + rsd);
- if (httpReq.getMethod().equals("GET")) {
- if (httpReq.getRemoteHost().equals("127.0.0.1")) {
- PrintWriter pw = new PrintWriter(res.getOutputStream());
- if (rsd == null) {
- pw.write("call received from browser, no remote service registered with this URL");
- } else {
- pw.write(new String("calls ") + rsd);
- }
- pw.flush();
- return;
- } else {
- httpRes.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, "Hessian requires POST");
- return;
- }
- }
- if (rsd==null) {
- httpRes.sendError(HttpServletResponse.SC_NOT_FOUND,"unknown url :"+httpReq.getRequestURI());
- return;
- }
- Object instance = rsd.getService();
- HessianSkeleton sk = new HessianSkeleton(instance, rsd.getServiceInterfaceClass());
- Hessian2Input inp = new Hessian2Input(httpReq.getInputStream());
- AbstractHessianOutput out;
- inp.setSerializerFactory(serializerFactory);
-
- int code = inp.read();
- if (code != 'c') {
- throw new IOException("expected 'c' in hessian input at " + code);
- }
- int major = inp.read();
- // int minor = inp.read();
- inp.read(); // TODO obsolete?? (replaced line above)
- if (major >= 2) {
- out = new Hessian2Output(httpRes.getOutputStream());
- } else {
- out = new HessianOutput(httpRes.getOutputStream());
- }
-
- out.setSerializerFactory(serializerFactory);
-
- try {
- sk.invoke(inp, out);
- } catch (Throwable t) {
- throw new ServletException(t);
- }
- }
-
- /**
- *
- * @return the publisher
- */
- protected HessianRemoteServicePublisher getPublisher() {
- return Activator.getPublisher();
- }
+ private SerializerFactory serializerFactory = null;
+
+ @Override
+ public void init(ServletConfig config) throws ServletException {
+ super.init(config);
+ serializerFactory = new SerializerFactory();
+ serializerFactory.setAllowNonSerializable(true);
+ log("HessianRienaDispatcherServlet:: DEBUG initialized");
+ }
+
+ @Override
+ public void log(String message) {
+ System.out.println(message);
+ }
+
+ public void log(String message, Exception e) {
+ System.out.println(message + "(" + e.getMessage() + ")");
+ }
+
+ @Override
+ public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
+
+ HttpServletRequest httpReq = (HttpServletRequest) req;
+ HttpServletResponse httpRes = (HttpServletResponse) res;
+
+ // set the message context
+ MessageContextAccessor.setMessageContext(new MessageContext(httpReq, httpRes));
+
+ HessianRemoteServicePublisher publisher = getPublisher();
+ if (publisher == null) {
+ if (httpReq.getMethod().equals("GET")) {
+ if (httpReq.getRemoteHost().equals("127.0.0.1")) {
+ PrintWriter pw = new PrintWriter(res.getOutputStream());
+ pw.write(new String("no webservices available"));
+ pw.flush();
+ return;
+ } else {
+ httpRes.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, "Hessian requires POST");
+ return;
+ }
+ } else {
+ httpRes.sendError(HttpServletResponse.SC_NOT_FOUND, "webservice not found");
+ return;
+ }
+ }
+ String requestURI = httpReq.getRequestURI();
+ String contextPath = httpReq.getContextPath();
+ if (contextPath.length() > 1) {
+ requestURI = requestURI.substring(contextPath.length());
+ }
+ RemoteServiceDescription rsd = publisher.findService(requestURI);
+ log("call " + rsd);
+ if (httpReq.getMethod().equals("GET")) {
+ if (httpReq.getRemoteHost().equals("127.0.0.1")) {
+ PrintWriter pw = new PrintWriter(res.getOutputStream());
+ if (rsd == null) {
+ pw.write("call received from browser, no remote service registered with this URL");
+ } else {
+ pw.write(new String("calls ") + rsd);
+ }
+ pw.flush();
+ return;
+ } else {
+ httpRes.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, "Hessian requires POST");
+ return;
+ }
+ }
+ if (rsd == null) {
+ httpRes.sendError(HttpServletResponse.SC_NOT_FOUND, "unknown url :" + httpReq.getRequestURI());
+ return;
+ }
+ Object instance = rsd.getService();
+ HessianSkeleton sk = new HessianSkeleton(instance, rsd.getServiceInterfaceClass());
+ Hessian2Input inp = new Hessian2Input(httpReq.getInputStream());
+ AbstractHessianOutput out;
+ inp.setSerializerFactory(serializerFactory);
+
+ int code = inp.read();
+ if (code != 'c') {
+ throw new IOException("expected 'c' in hessian input at " + code);
+ }
+ int major = inp.read();
+ // int minor = inp.read();
+ inp.read(); // TODO obsolete?? (replaced line above)
+ if (major >= 2) {
+ out = new Hessian2Output(httpRes.getOutputStream());
+ } else {
+ out = new HessianOutput(httpRes.getOutputStream());
+ }
+
+ out.setSerializerFactory(serializerFactory);
+
+ try {
+ sk.invoke(inp, out);
+ } catch (Throwable t) {
+ throw new ServletException(t);
+ }
+ }
+
+ /**
+ *
+ * @return the publisher
+ */
+ protected HessianRemoteServicePublisher getPublisher() {
+ return Activator.getPublisher();
+ }
}