You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by gl...@apache.org on 2002/07/22 14:28:47 UTC
cvs commit: xml-axis/java/src/org/apache/axis/wsdl/symbolTable TypeEntry.java
glyn 2002/07/22 05:28:47
Modified: java/src/org/apache/axis/description ParameterDesc.java
java/src/org/apache/axis/message MessageElement.java
RPCParam.java
java/src/org/apache/axis/wsdl/symbolTable TypeEntry.java
Log:
Further serialization fixes as provided in Beta2-patches branch.
Revision Changes Path
1.13 +44 -3 xml-axis/java/src/org/apache/axis/description/ParameterDesc.java
Index: ParameterDesc.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/description/ParameterDesc.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- ParameterDesc.java 2 Jul 2002 22:54:32 -0000 1.12
+++ ParameterDesc.java 22 Jul 2002 12:28:47 -0000 1.13
@@ -60,6 +60,11 @@
import org.apache.axis.wsdl.symbolTable.TypeEntry;
+import java.io.IOException;
+import java.io.Serializable;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
/**
* A Parameter descriptor, collecting the interesting info about an
* operation parameter.
@@ -68,7 +73,7 @@
*
* @author Glen Daniels (gdaniels@apache.org)
*/
-public class ParameterDesc {
+public class ParameterDesc implements Serializable {
// constant values for the parameter mode.
public static final byte IN = 1;
@@ -76,7 +81,7 @@
public static final byte INOUT = 3;
/** The Parameter's XML QName */
- private QName name;
+ private transient QName name;
/** A TypeEntry corresponding to this parameter */
public TypeEntry typeEntry;
/** The Parameter mode (in, out, inout) */
@@ -243,4 +248,40 @@
public void setIsReturn(boolean value) {
isReturn = value;
}
-} // class Parameter
+
+ private void writeObject(ObjectOutputStream out)
+ throws IOException {
+ if (name == null) {
+ out.writeBoolean(false);
+ } else {
+ out.writeBoolean(true);
+ out.writeObject(name.getNamespaceURI());
+ out.writeObject(name.getLocalPart());
+ }
+ if (typeQName == null) {
+ out.writeBoolean(false);
+ } else {
+ out.writeBoolean(true);
+ out.writeObject(typeQName.getNamespaceURI());
+ out.writeObject(typeQName.getLocalPart());
+ }
+ out.defaultWriteObject();
+ }
+
+ private void readObject(ObjectInputStream in)
+ throws IOException, ClassNotFoundException {
+ if (in.readBoolean()) {
+ name = new QName((String)in.readObject(),
+ (String)in.readObject());
+ } else {
+ name = null;
+ }
+ if (in.readBoolean()) {
+ typeQName = new QName((String)in.readObject(),
+ (String)in.readObject());
+ } else {
+ typeQName = null;
+ }
+ in.defaultReadObject();
+ }
+} // class ParameterDesc
1.116 +22 -3 xml-axis/java/src/org/apache/axis/message/MessageElement.java
Index: MessageElement.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/MessageElement.java,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -r1.115 -r1.116
--- MessageElement.java 20 Jul 2002 00:30:20 -0000 1.115
+++ MessageElement.java 22 Jul 2002 12:28:47 -0000 1.116
@@ -114,14 +114,14 @@
protected SOAPEnvelope message = null;
protected boolean _isDirty = false;
- protected DeserializationContext context;
+ protected transient DeserializationContext context;
- protected QName typeQName = null;
+ protected transient QName typeQName = null;
protected Vector qNameAttrs = null;
// Some message representations - as recorded SAX events...
- protected SAX2EventRecorder recorder = null;
+ protected transient SAX2EventRecorder recorder = null;
protected int startEventIndex = 0;
protected int startContentsIndex = 0;
protected int endEventIndex = -1;
@@ -785,6 +785,17 @@
*/
private void writeObject(ObjectOutputStream out) throws IOException {
+ if (typeQName == null) {
+ out.writeBoolean(false);
+ } else {
+ out.writeBoolean(true);
+ out.writeObject(typeQName.getNamespaceURI());
+ out.writeObject(typeQName.getLocalPart());
+ }
+
+ if (attributes == null) {
+ attributes = new AttributesImpl();
+ }
int n = attributes.getLength();
out.writeInt(n);
for (int i = 0; i < n; i++) {
@@ -799,6 +810,14 @@
private void readObject(ObjectInputStream in)
throws IOException, ClassNotFoundException {
+
+ if (in.readBoolean()) {
+ typeQName = new QName((String)in.readObject(),
+ (String)in.readObject());
+ } else {
+ typeQName = null;
+ }
+
attributes = new AttributesImpl();
int n = in.readInt();
for (int i = 0; i < n; i++) {
1.45 +28 -2 xml-axis/java/src/org/apache/axis/message/RPCParam.java
Index: RPCParam.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/RPCParam.java,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- RPCParam.java 22 Jul 2002 06:23:01 -0000 1.44
+++ RPCParam.java 22 Jul 2002 12:28:47 -0000 1.45
@@ -64,6 +64,9 @@
import javax.xml.namespace.QName;
+import java.io.Serializable;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
import java.io.IOException;
import java.lang.reflect.Method;
import java.util.ArrayList;
@@ -72,7 +75,7 @@
*
* @author Glen Daniels (gdaniels@macromedia.com)
*/
-public class RPCParam
+public class RPCParam implements Serializable
{
protected static Log log =
LogFactory.getLog(RPCParam.class.getName());
@@ -80,7 +83,7 @@
// Who's your daddy?
RPCElement myCall;
- private QName qname;
+ private transient QName qname;
private Object value = null;
private int countSetCalls = 0; // counts number of calls to set
@@ -217,5 +220,28 @@
value, // value
javaType, xmlType, // java/xml type
true, wantXSIType);
+ }
+
+ private void writeObject(ObjectOutputStream out)
+ throws IOException {
+ if (qname == null) {
+ out.writeBoolean(false);
+ } else {
+ out.writeBoolean(true);
+ out.writeObject(qname.getNamespaceURI());
+ out.writeObject(qname.getLocalPart());
+ }
+ out.defaultWriteObject();
+ }
+
+ private void readObject(ObjectInputStream in)
+ throws IOException, ClassNotFoundException {
+ if (in.readBoolean()) {
+ qname = new QName((String)in.readObject(),
+ (String)in.readObject());
+ } else {
+ qname = null;
+ }
+ in.defaultReadObject();
}
}
1.3 +2 -1 xml-axis/java/src/org/apache/axis/wsdl/symbolTable/TypeEntry.java
Index: TypeEntry.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/symbolTable/TypeEntry.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TypeEntry.java 20 Jun 2002 20:35:47 -0000 1.2
+++ TypeEntry.java 22 Jul 2002 12:28:47 -0000 1.3
@@ -55,6 +55,7 @@
package org.apache.axis.wsdl.symbolTable;
import java.io.IOException;
+import java.io.Serializable;
import javax.xml.namespace.QName;
@@ -110,7 +111,7 @@
*
* @author Rich Scheuerle (scheu@us.ibm.com)
*/
-public abstract class TypeEntry extends SymTabEntry {
+public abstract class TypeEntry extends SymTabEntry implements Serializable {
protected Node node; // Node