summaryrefslogtreecommitdiff
path: root/java/src/Ice/ObjectPrxHelperBase.java
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2009-02-18 14:16:04 -0800
committerMark Spruiell <mes@zeroc.com>2009-02-18 14:16:04 -0800
commit21b8342c6d99d075ab9ae94265edac8582ab59c1 (patch)
tree2ecb1e1c1aa68c54cea2bdb151d5d6ac21cec594 /java/src/Ice/ObjectPrxHelperBase.java
parentBug 3742 - linking wrong sdk to obtain nmake in INSTALL.WINDOWS (diff)
downloadice-21b8342c6d99d075ab9ae94265edac8582ab59c1.tar.bz2
ice-21b8342c6d99d075ab9ae94265edac8582ab59c1.tar.xz
ice-21b8342c6d99d075ab9ae94265edac8582ab59c1.zip
bug 1593 - adding proxy serialization and test
Diffstat (limited to 'java/src/Ice/ObjectPrxHelperBase.java')
-rw-r--r--java/src/Ice/ObjectPrxHelperBase.java33
1 files changed, 32 insertions, 1 deletions
diff --git a/java/src/Ice/ObjectPrxHelperBase.java b/java/src/Ice/ObjectPrxHelperBase.java
index f44b22ad66e..8e2dfdc4fc9 100644
--- a/java/src/Ice/ObjectPrxHelperBase.java
+++ b/java/src/Ice/ObjectPrxHelperBase.java
@@ -9,7 +9,7 @@
package Ice;
-public class ObjectPrxHelperBase implements ObjectPrx
+public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable
{
public final int
hashCode()
@@ -1052,6 +1052,37 @@ public class ObjectPrxHelperBase implements ObjectPrx
}
}
+ private void
+ writeObject(java.io.ObjectOutputStream out)
+ throws java.io.IOException
+ {
+ out.writeUTF(toString());
+ }
+
+ private void
+ readObject(java.io.ObjectInputStream in)
+ throws java.io.IOException, ClassNotFoundException
+ {
+ String s = in.readUTF();
+ try
+ {
+ Ice.ObjectInputStream ois = (Ice.ObjectInputStream)in;
+ Ice.ObjectPrxHelperBase proxy = (Ice.ObjectPrxHelperBase)ois.getCommunicator().stringToProxy(s);
+ _reference = proxy._reference;
+ assert(proxy._delegate == null);
+ }
+ catch(ClassCastException ex)
+ {
+ throw new java.io.IOException("Cannot deserialize proxy: Ice.ObjectInputStream not found");
+ }
+ catch(LocalException ex)
+ {
+ java.io.IOException e = new java.io.IOException("Failure occurred while deserializing proxy");
+ e.initCause(ex);
+ throw e;
+ }
+ }
+
protected static final java.util.Map<String, String> _emptyContext = new java.util.HashMap<String, String>();
private IceInternal.Reference _reference;