Return-Path: Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 51523 invoked by uid 500); 21 Feb 2003 16:31:11 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 51447 invoked from network); 21 Feb 2003 16:31:10 -0000 Importance: Normal Sensitivity: Subject: RE: cvs commit: xml-axis/java/src/org/apache/axis/encoding/ser Ba seDeserializerFactory.java BaseSerializerFactory.java To: axis-dev@ws.apache.org X-Mailer: Lotus Notes Release 5.0.7 March 21, 2001 Message-ID: From: "Anthony Elder" Date: Fri, 21 Feb 2003 16:31:05 +0000 X-MIMETrack: Serialize by Router on D06ML038/06/M/IBM(Release 5.0.9a |January 7, 2002) at 21/02/2003 16:31:09 MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I this case its for WSIF asynchronous operation where JROM is being used. I need to be able to store the serializer factories in a correlation service so they're available to when processing the response, which requires them to be serializable. I guess this could change when/if WSIF can use the AXIS async model. ...ant Anthony Elder ant.elder@uk.ibm.com Web Services Development IBM UK Laboratories, Hursley Park (+44) 01962 818320, x248320, MP208. James M Snell/Fresno/IBM@IBMUS on 21/02/2003 15:58:14 Please respond to axis-dev@ws.apache.org To: axis-dev@ws.apache.org cc: Subject: RE: cvs commit: xml-axis/java/src/org/apache/axis/encoding/ser Ba seDeserializerFactory.java BaseSerializerFactory.java Actually, that's a really good point. ;-) Hadn't thought about that. - James Snell IBM Emerging Technologies jasnell@us.ibm.com (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 02/21/2003 07:30 AM Please respond to axis-dev To "'axis-dev@ws.apache.org'" 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: jmsnell@apache.org [mailto:jmsnell@apache.org] > Sent: Thursday, February 20, 2003 6:00 PM > To: xml-axis-cvs@apache.org > 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; > + } > + > } > > > >