summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Campo2008-02-25 08:30:46 (EST)
committerChristian Campo2008-02-25 08:30:46 (EST)
commit70d627c5c31d07370f4953a55b1d0736b0e7704b (patch)
treee7733dd333b45da1018f6d6b86d6d9da6a82aee9
parent5a49dedfcd21cc0d98809d74aab2e1b696d6becc (diff)
downloadorg.eclipse.riena-70d627c5c31d07370f4953a55b1d0736b0e7704b.zip
org.eclipse.riena-70d627c5c31d07370f4953a55b1d0736b0e7704b.tar.gz
org.eclipse.riena-70d627c5c31d07370f4953a55b1d0736b0e7704b.tar.bz2
added some special handlich for interfaces in arraysv20080225_1_0_0_M1
-rw-r--r--org.eclipse.riena.communication.factory.hessian/src/org/eclipse/riena/internal/communication/factory/hessian/RienaHessianProxyFactory.java20
-rw-r--r--org.eclipse.riena.communication.publisher.hessian/src/org/eclipse/riena/communication/publisher/hessian/HessianRienaDispatcherServlet.java20
2 files changed, 40 insertions, 0 deletions
diff --git a/org.eclipse.riena.communication.factory.hessian/src/org/eclipse/riena/internal/communication/factory/hessian/RienaHessianProxyFactory.java b/org.eclipse.riena.communication.factory.hessian/src/org/eclipse/riena/internal/communication/factory/hessian/RienaHessianProxyFactory.java
index 5c3072e..af31eaa 100644
--- a/org.eclipse.riena.communication.factory.hessian/src/org/eclipse/riena/internal/communication/factory/hessian/RienaHessianProxyFactory.java
+++ b/org.eclipse.riena.communication.factory.hessian/src/org/eclipse/riena/internal/communication/factory/hessian/RienaHessianProxyFactory.java
@@ -15,6 +15,7 @@ import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
+import java.security.Principal;
import java.util.Dictionary;
import java.util.List;
import java.util.Map;
@@ -26,6 +27,11 @@ import org.osgi.service.cm.ConfigurationException;
import org.osgi.service.cm.ManagedService;
import com.caucho.hessian.client.HessianProxyFactory;
+import com.caucho.hessian.io.AbstractSerializerFactory;
+import com.caucho.hessian.io.Deserializer;
+import com.caucho.hessian.io.HessianProtocolException;
+import com.caucho.hessian.io.JavaDeserializer;
+import com.caucho.hessian.io.Serializer;
import com.caucho.hessian.io.SerializerFactory;
public class RienaHessianProxyFactory extends HessianProxyFactory implements ManagedService {
@@ -36,6 +42,20 @@ public class RienaHessianProxyFactory extends HessianProxyFactory implements Man
public RienaHessianProxyFactory() {
super();
+ getSerializerFactory().addFactory(new AbstractSerializerFactory() {
+ @Override
+ public Deserializer getDeserializer(Class cl) throws HessianProtocolException {
+ if (cl.isInterface() && (!cl.getPackage().getName().startsWith("java") || cl == Principal.class)) {
+ return new JavaDeserializer(cl);
+ }
+ return null;
+ }
+
+ @Override
+ public Serializer getSerializer(Class cl) throws HessianProtocolException {
+ return null;
+ }
+ });
}
@Override
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 f829f6a..cef416c 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
@@ -12,6 +12,7 @@ package org.eclipse.riena.communication.publisher.hessian;
import java.io.IOException;
import java.io.PrintWriter;
+import java.security.Principal;
import javax.servlet.GenericServlet;
import javax.servlet.ServletConfig;
@@ -28,9 +29,14 @@ import org.eclipse.riena.internal.communication.publisher.hessian.MessageContext
import org.eclipse.riena.internal.communication.publisher.hessian.MessageContextAccessor;
import com.caucho.hessian.io.AbstractHessianOutput;
+import com.caucho.hessian.io.AbstractSerializerFactory;
+import com.caucho.hessian.io.Deserializer;
import com.caucho.hessian.io.Hessian2Input;
import com.caucho.hessian.io.Hessian2Output;
import com.caucho.hessian.io.HessianOutput;
+import com.caucho.hessian.io.HessianProtocolException;
+import com.caucho.hessian.io.JavaDeserializer;
+import com.caucho.hessian.io.Serializer;
import com.caucho.hessian.io.SerializerFactory;
import com.caucho.hessian.server.HessianSkeleton;
@@ -48,6 +54,20 @@ public class HessianRienaDispatcherServlet extends GenericServlet {
super.init(config);
serializerFactory = new SerializerFactory();
serializerFactory.setAllowNonSerializable(true);
+ serializerFactory.addFactory(new AbstractSerializerFactory() {
+ @Override
+ public Deserializer getDeserializer(Class cl) throws HessianProtocolException {
+ if (cl.isInterface() && (!cl.getPackage().getName().startsWith("java") || cl == Principal.class)) {
+ return new JavaDeserializer(cl);
+ }
+ return null;
+ }
+
+ @Override
+ public Serializer getSerializer(Class cl) throws HessianProtocolException {
+ return null;
+ }
+ });
log("HessianRienaDispatcherServlet:: DEBUG initialized");
}