Author: pferraro
Date: 2009-05-16 16:35:41 -0400 (Sat, 16 May 2009)
New Revision: 2425
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/rpc/DefaultRpcResponse.java
Log:
Use custom serialization
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/rpc/DefaultRpcResponse.java
===================================================================
---
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/rpc/DefaultRpcResponse.java 2009-05-15
21:20:41 UTC (rev 2424)
+++
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/rpc/DefaultRpcResponse.java 2009-05-16
20:35:41 UTC (rev 2425)
@@ -21,6 +21,8 @@
*/
package org.jboss.modcluster.ha.rpc;
+import java.io.IOException;
+
import org.jboss.ha.framework.interfaces.ClusterNode;
import org.jboss.modcluster.Utils;
@@ -33,7 +35,7 @@
/** The serialVersionUID */
private static final long serialVersionUID = -6410563421870835482L;
- private final ClusterNode sender;
+ private ClusterNode sender;
private Throwable exception;
private T result;
@@ -70,4 +72,31 @@
{
this.exception = exception;
}
+
+ private void writeObject(java.io.ObjectOutputStream out) throws IOException
+ {
+ out.writeObject(this.sender);
+
+ boolean exists = this.result != null;
+ out.writeBoolean(exists);
+ if (exists)
+ {
+ out.writeObject(this.result);
+ }
+
+ exists = this.exception != null;
+ out.writeBoolean(exists);
+ if (exists)
+ {
+ out.writeObject(this.exception);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private void readObject(java.io.ObjectInputStream in) throws IOException,
ClassNotFoundException
+ {
+ this.sender = (ClusterNode) in.readObject();
+ this.result = in.readBoolean() ? (T) in.readObject() : null;
+ this.exception = in.readBoolean() ? (Throwable) in.readObject() : null;
+ }
}
Show replies by date