Actually, that's a really good point. ;-) Hadn't thought about that.
- James Snell
IBM Emerging Technologies
[EMAIL PROTECTED]
(559) 587-1233 (office)
(700) 544-9035 (t/l)
Programming Web Services With SOAP
O'Reilly & Associates, ISBN 0596000952
Have I not commanded you? Be strong and courageous.
Do not be terrified, do not be discouraged, for the Lord your
God will be with you whereever you go. - Joshua 1:9
Glen Daniels <[EMAIL PROTECTED]>
02/21/2003 07:30 AM
Please respond to axis-dev
To
"'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
cc
bcc
Subject
RE: cvs commit: xml-axis/java/src/org/apache/axis/encoding/ser Ba
seDeserializerFactory.java BaseSerializerFactory.java
One wonders (at least I do) just exactly why this whole hierarchy is
Serializable in the first place....
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 20, 2003 6:00 PM
> To: [EMAIL PROTECTED]
> Subject: cvs commit: xml-axis/java/src/org/apache/axis/encoding/ser
> BaseDeserializerFactory.java BaseSerializerFactory.java
>
>
> jmsnell 2003/02/20 14:59:43
>
> Modified: java/src/org/apache/axis/encoding/ser
> BaseDeserializerFactory.java
> BaseSerializerFactory.java
> Log:
> FIX http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16486
>
> Applied Anthony Elder's patch.
>
> Revision Changes Path
> 1.11 +37 -12
> xml-axis/java/src/org/apache/axis/encoding/ser/BaseDeserialize
> rFactory.java
>
> Index: BaseDeserializerFactory.java
> ===================================================================
> RCS file:
> /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/BaseD
> eserializerFactory.java,v
> retrieving revision 1.10
> retrieving revision 1.11
> diff -u -r1.10 -r1.11
> --- BaseDeserializerFactory.java 26 Sep 2002 00:24:50
> -0000 1.10
> +++ BaseDeserializerFactory.java 20 Feb 2003 22:59:43
> -0000 1.11
> @@ -55,19 +55,21 @@
>
> package org.apache.axis.encoding.ser;
>
> -import org.apache.axis.Constants;
> -import org.apache.axis.encoding.Deserializer;
> -import org.apache.axis.encoding.DeserializerFactory;
> -import org.apache.axis.utils.ClassUtils;
> -
> -import javax.xml.namespace.QName;
> -import javax.xml.rpc.JAXRPCException;
> +import java.io.Serializable;
> import java.lang.reflect.Constructor;
> import java.lang.reflect.InvocationTargetException;
> import java.lang.reflect.Method;
> import java.util.Iterator;
> import java.util.Vector;
>
> +import javax.xml.namespace.QName;
> +import javax.xml.rpc.JAXRPCException;
> +
> +import org.apache.axis.Constants;
> +import org.apache.axis.encoding.Deserializer;
> +import org.apache.axis.encoding.DeserializerFactory;
> +import org.apache.axis.utils.ClassUtils;
> +
> /**
> * Base class for Axis Deserialization Factory classes for
> code reuse
> *
> @@ -76,13 +78,14 @@
> public abstract class BaseDeserializerFactory
> implements DeserializerFactory {
>
> - static Vector mechanisms = null;
> + transient static Vector mechanisms = null;
>
> protected Class deserClass = null;
> protected QName xmlType = null;
> protected Class javaType = null;
> - protected Constructor deserClassConstructor = null;
> - protected Method getDeserializer = null;
> +
> + transient protected Constructor deserClassConstructor = null;
> + transient protected Method getDeserializer = null;
>
> /**
> * Constructor
> @@ -99,8 +102,6 @@
> this(deserClass);
> this.xmlType = xmlType;
> this.javaType = javaType;
> - this.deserClassConstructor = getConstructor(deserClass);
> - this.getDeserializer = getDeserializerMethod(javaType);
> }
>
> public javax.xml.rpc.encoding.Deserializer
> @@ -136,6 +137,7 @@
> */
> protected Deserializer getGeneralPurpose(String
> mechanismType) {
> if (javaType != null && xmlType != null) {
> + Constructor deserClassConstructor =
> getDeserClassConstructor();
> if (deserClassConstructor != null) {
> try {
> return (Deserializer)
> @@ -166,6 +168,7 @@
> */
> protected Deserializer getSpecialized(String mechanismType) {
> if (javaType != null && xmlType != null) {
> + Method getDeserializer = getGetDeserializer();
> if (getDeserializer != null) {
> try {
> return (Deserializer)
> @@ -266,4 +269,26 @@
> }
> return df;
> }
> + /**
> + * Returns the deserClassConstructor.
> + * @return Constructor
> + */
> + protected Constructor getDeserClassConstructor() {
> + if (deserClassConstructor == null) {
> + deserClassConstructor = getConstructor(deserClass);
> + }
> + return deserClassConstructor;
> + }
> +
> + /**
> + * Returns the getDeserializer.
> + * @return Method
> + */
> + protected Method getGetDeserializer() {
> + if (getDeserializer == null) {
> + getDeserializer = getDeserializerMethod(javaType);
> + }
> + return getDeserializer;
> + }
> +
> }
>
>
>
> 1.21 +29 -6
> xml-axis/java/src/org/apache/axis/encoding/ser/BaseSerializerF
> actory.java
>
> Index: BaseSerializerFactory.java
> ===================================================================
> RCS file:
> /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/BaseS
> erializerFactory.java,v
> retrieving revision 1.20
> retrieving revision 1.21
> diff -u -r1.20 -r1.21
> --- BaseSerializerFactory.java 11 Dec 2002 22:38:15
> -0000 1.20
> +++ BaseSerializerFactory.java 20 Feb 2003 22:59:43
> -0000 1.21
> @@ -68,6 +68,7 @@
> import java.lang.reflect.Method;
> import java.util.Iterator;
> import java.util.Vector;
> +import java.io.Serializable;
>
> /**
> * Base class for Axis Serialization Factory classes for code reuse
> @@ -77,14 +78,15 @@
> public abstract class BaseSerializerFactory
> implements SerializerFactory {
>
> - static Vector mechanisms = null;
> + transient static Vector mechanisms = null;
>
> protected Class serClass = null;
> - protected Serializer ser = null;
> protected QName xmlType = null;
> protected Class javaType = null;
> - protected Constructor serClassConstructor = null;
> - protected Method getSerializer = null;
> +
> + transient protected Serializer ser = null;
> + transient protected Constructor serClassConstructor = null;
> + transient protected Method getSerializer = null;
>
> /**
> * Constructor
> @@ -99,8 +101,6 @@
> this(serClass);
> this.xmlType = xmlType;
> this.javaType = javaType;
> - this.serClassConstructor = getConstructor(serClass);
> - this.getSerializer = getSerializerMethod(javaType);
> }
>
> public javax.xml.rpc.encoding.Serializer
> @@ -145,6 +145,7 @@
> */
> protected Serializer getGeneralPurpose(String mechanismType) {
> if (javaType != null && xmlType != null) {
> + Constructor serClassConstructor =
> getSerClassConstructor();
> if (serClassConstructor != null) {
> try {
> return (Serializer)
> @@ -298,4 +299,26 @@
> }
> return sf;
> }
> + /**
> + * Returns the getSerializer.
> + * @return Method
> + */
> + protected Method getGetSerializer() {
> + if (getSerializer == null) {
> + getSerializer = getSerializerMethod(javaType);
> + }
> + return getSerializer;
> + }
> +
> + /**
> + * Returns the serClassConstructor.
> + * @return Constructor
> + */
> + protected Constructor getSerClassConstructor() {
> + if (serClassConstructor == null) {
> + serClassConstructor = getConstructor(serClass);
> + }
> + return serClassConstructor;
> + }
> +
> }
>
>
>
>