summaryrefslogtreecommitdiff
path: root/java/src/Ice/ObjectPrxHelperBase.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/Ice/ObjectPrxHelperBase.java')
-rw-r--r--java/src/Ice/ObjectPrxHelperBase.java39
1 files changed, 37 insertions, 2 deletions
diff --git a/java/src/Ice/ObjectPrxHelperBase.java b/java/src/Ice/ObjectPrxHelperBase.java
index f44b22ad66e..302ec582abd 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()
@@ -716,7 +716,7 @@ public class ObjectPrxHelperBase implements ObjectPrx
// Don't wait for the connection to be established.
return __del.__getRequestHandler().getConnection(false);
}
- catch(CollocationOptimizationException ex)
+ catch(LocalException ex)
{
}
}
@@ -1052,6 +1052,41 @@ 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
+ {
+ Communicator communicator = ((Ice.ObjectInputStream)in).getCommunicator();
+ if(communicator == null)
+ {
+ throw new java.io.IOException("Cannot deserialize proxy: no communicator provided");
+ }
+ ObjectPrxHelperBase proxy = (ObjectPrxHelperBase)communicator.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;