You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by pr...@apache.org on 2007/10/06 16:53:12 UTC

svn commit: r582501 [6/7] - in /webservices/axis2/branches/java/jaxws21/modules: adb-codegen/src/org/apache/axis2/schema/ adb-codegen/src/org/apache/axis2/schema/template/ adb-codegen/src/org/apache/axis2/schema/writer/ adb-codegen/test-resources/tests...

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/ObjectStateUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/ObjectStateUtils.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/ObjectStateUtils.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/ObjectStateUtils.java Sat Oct  6 07:53:06 2007
@@ -10,1634 +10,366 @@
  * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
+ * software distributed under the License is distributed on a
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied. See the License for the
  * specific language governing permissions and limitations
  * under the License.
  */
-
 package org.apache.axis2.util;
 
+import org.apache.axis2.context.externalize.ActivateUtils;
+import org.apache.axis2.context.externalize.ExternalizeConstants;
+import org.apache.axis2.context.externalize.SafeObjectInputStream;
+import org.apache.axis2.context.externalize.SafeObjectOutputStream;
 import org.apache.axis2.description.AxisMessage;
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.AxisServiceGroup;
-import org.apache.axis2.description.TransportInDescription;
 import org.apache.axis2.engine.AxisConfiguration;
-import org.apache.axis2.engine.Handler;
 import org.apache.axis2.transport.TransportListener;
-import org.apache.axis2.wsdl.WSDLConstants;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 import javax.xml.namespace.QName;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
+
 import java.io.IOException;
-import java.io.NotSerializableException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.Map;
-import java.util.Set;
 
 /**
- * Provides functions for saving and restoring an object's state.
+ * Utility to write, read and activate externalized Objects
  */
-public class ObjectStateUtils {
-	/*
-	 * setup for logging
-	 */
-	private static final Log log = LogFactory.getLog(ObjectStateUtils.class);
-
-	// used as part of the metadata written out
-	// indicating a null or empty object
-	public static boolean EMPTY_OBJECT = false;
-
-	// used as part of the metadata written out
-	// indicating a non-null or live object
-	public static boolean ACTIVE_OBJECT = true;
-
-	// used to indicate the end of a list
-	public static String LAST_ENTRY = "LAST_OBJ";
-
-	// used to indicate an "empty" object
-	public static String EMPTY_MARKER = "EMPTY_OBJ";
-
-	// used to indicate an valid "null" object,
-	// typically used in key-value pairs where a non-null key refers to a null
-	// value
-	public static String NULL_OBJECT = "NULL_OBJ";
-
-	// message/trace/logging strings
-	public static final String UNSUPPORTED_SUID = "Serialization version ID is not supported.";
-
-	public static final String UNSUPPORTED_REVID = "Revision ID is not supported.";
-
-	public static final String OBJ_SAVE_PROBLEM = "The object could not be saved to the output stream.  The object may or may not be important for processing the message when it is restored. Look at how the object is to be used during message processing.";
-
-	public static final String OBJ_RESTORE_PROBLEM = "The object could not be restored from the input stream.  The object may or may not be important for processing the message when it is restored. Look at how the object is to be used during message processing.";
-
-	// as a way to improve performance and reduce trace logging with
-	// extra exceptions, keep a table of classes that are not serializable
-	// and only log the first time it that the class is encountered in
-	// an NotSerializableException
-	// note that the Hashtable is synchronized by Java so we shouldn't need to
-	// do extra control over access to the table
-	public static Hashtable NotSerializableList = new Hashtable();
-
-	// --------------------------------------------------------------------
-	// Save/Restore methods
-	// --------------------------------------------------------------------
-
-	/**
-	 * Write a string to the specified output stream. <p/> The format of the
-	 * information written to the output stream is: <BOLD>Non-Null String</BOLD>
-	 * <LI> UTF - class name string
-	 * <LI> boolean - active flag
-	 * <LI> Object - string data <p/> <BOLD>Null String</BOLD>
-	 * <LI> UTF - description
-	 * <LI> boolean - empty flag <p/>
-	 * 
-	 * @param out
-	 *            The output stream
-	 * @param str
-	 *            The string to write
-	 * @param desc
-	 *            A text description to use for logging
-	 * @throws IOException
-	 *             Exception
-	 */
-	public static void writeString(ObjectOutput out, String str, String desc)
-			throws IOException {
-		// The total number of bytes needed to represent all
-		// the characters of a string is calculated when the string
-		// is serialized. If this number is larger than 65535 (ie, 64 KB)
-		// then a java.io.UTFDataFormatException is thrown
-
-		if (str != null) {
-			String str_desc = str.getClass().getName();
-			// this string is expected to fit the writeUTF limitations
-			out.writeUTF(str_desc);
-
-			out.writeBoolean(ACTIVE_OBJECT);
-			out.writeObject(str);
-			// trace point
-			if (log.isTraceEnabled()) {
-				log
-						.trace("ObjectStateUtils:writeString(): ACTIVE string: str_desc ["
-								+ str_desc
-								+ "]    string ["
-								+ str
-								+ "]   desc [" + desc + "]");
-			}
-
-		} else {
-			// this string is expected to fit the writeUTF limitations
-			out.writeUTF(desc);
-
-			out.writeBoolean(EMPTY_OBJECT);
-
-			// for now, don't trace the EMPTY lines
-			// // trace point
-			// if (log.isTraceEnabled())
-			// {
-			// log.trace("ObjectStateUtils:writeString(): EMPTY String desc
-			// ["+desc+"] ");
-			// }
-		}
-
-	}
-
-	/**
-	 * Read a string from the specified input stream. Returns null if no string
-	 * is available. <p/> The format of the information to be read from the
-	 * input stream should be <BOLD>Non-Null String</BOLD>
-	 * <LI> UTF - class name string
-	 * <LI> boolean - active flag
-	 * <LI> Object - string data <p/> <BOLD>Null String</BOLD>
-	 * <LI> UTF - description
-	 * <LI> boolean - empty flag <p/>
-	 * 
-	 * @param in
-	 *            The input stream
-	 * @param desc
-	 *            A text description to use for logging
-	 * @return The string or null, if not available
-	 * @throws IOException
-	 * @throws ClassNotFoundException
-	 */
-	public static String readString(ObjectInput in, String desc)
-			throws IOException, ClassNotFoundException {
-		String str = null;
-
-		// get the marker
-		String str_desc = in.readUTF();
-
-		// get the flag
-		boolean isActive = in.readBoolean();
-
-		if (isActive == ACTIVE_OBJECT) {
-			str = (String) in.readObject();
-		}
-
-		if (log.isTraceEnabled()) {
-			log.trace("ObjectStateUtils:readString(): [" + desc
-					+ "]  returning  [" + str + "]  for  saved [" + str_desc
-					+ "]");
-		}
-
-		return str;
-	}
-
-	/**
-	 * Write an object to the specified output stream. <p/> The format of the
-	 * information written to the output stream is <p/> <BOLD>Non-Null Object</BOLD>
-	 * <LI> UTF - class name string
-	 * <LI> boolean - active flag
-	 * <LI> object - object if no error in the form of int byte array
-	 * 
-	 * <LI> LAST_ENTRY marker in the form of int object <p/> <BOLD>Null Object</BOLD>
-	 * <LI> UTF - description
-	 * <LI> boolean - empty flag <p/>
-	 * 
-	 * @param out
-	 *            The output stream
-	 * @param obj
-	 *            The object to write
-	 * @param desc
-	 *            A text description to use for logging
-	 * @throws IOException
-	 *             Exception
-	 */
-	public static void writeObject(ObjectOutput out, Object obj, String desc)
-			throws IOException {
-		IOException returned_exception = null;
-
-		if (obj != null) {
-			String objClassName = obj.getClass().getName();
-			String fullDesc = desc + ":" + objClassName;
-			// this string is expected to fit the writeUTF limitations
-			out.writeUTF(fullDesc);
-
-			try {
-				// put the object into a test output buffer to see if it can be
-				// saved
-				// this technique preserves the integrity of the real output
-				// stream in the
-				// event of a serialization error
-				ByteArrayOutputStream test_outBuffer = new ByteArrayOutputStream();
-				ObjectOutputStream test_objOut = new ObjectOutputStream(
-						test_outBuffer);
-
-				// write the object to the test buffer
-				test_objOut.writeObject(obj);
-				test_objOut.close();
-
-				// put the contents of the test buffer into the
-				// real output stream
-				test_outBuffer.close();
-				byte[] data = test_outBuffer.toByteArray();
-				out.writeBoolean(ACTIVE_OBJECT);
-				out.writeObject(data);
-			} catch (NotSerializableException nse2) {
-				returned_exception = nse2;
-				// process this exception
-				traceNotSerializable(obj, nse2, desc,
-						"ObjectStateUtils.writeObject()", OBJ_SAVE_PROBLEM);
-			} catch (IOException exc2) {
-				// use this as a generic point for exceptions for the test
-				// output stream
-				returned_exception = exc2;
-
-				// trace point
-				if (log.isTraceEnabled()) {
-					log.trace("ObjectStateUtils:writeObject(): object["
-							+ obj.getClass().getName()
-							+ "]  ***Exception***  ["
-							+ exc2.getClass().getName() + " : "
-							+ exc2.getMessage() + "]  " + OBJ_SAVE_PROBLEM,
-							exc2);
-					// exc2.printStackTrace();
-				}
-			}
-
-			if (returned_exception != null) {
-				// Write a null object into the stream instead of the data that
-				// failed
-				out.writeBoolean(EMPTY_OBJECT);
-
-				// let the caller know that there was a problem
-				// note the integrity of the real output stream has been
-				// preserved
-				throw returned_exception;
-			}
-		} else {
-			// this string is expected to fit the writeUTF limitations
-			out.writeUTF(desc);
-
-			out.writeBoolean(EMPTY_OBJECT);
-
-			// trace point
-			if (log.isTraceEnabled()) {
-				log.trace("ObjectStateUtils:writeObject(): EMPTY Object ["
-						+ desc + "]  ");
-			}
-		}
-	}
-
-	/**
-	 * Read an object from the specified input stream. Returns null if no object
-	 * is available. <p/> The format of the information to be read from the
-	 * input stream should be <BOLD>Non-Null Object</BOLD>
-	 * <LI> UTF - class name string
-	 * <LI> boolean - active flag
-	 * <LI> object - object if no error
-	 * <LI> LAST_ENTRY marker <p/> <BOLD>Null Object</BOLD>
-	 * <LI> UTF - description
-	 * <LI> boolean - empty flag <p/>
-	 * 
-	 * @param in
-	 *            The input stream
-	 * @param desc
-	 *            A text description to use for logging
-	 * @return The object or null, if not available
-	 * @throws IOException
-	 * @throws ClassNotFoundException
-	 */
-	public static Object readObject(ObjectInput in, String desc)
-			throws IOException, ClassNotFoundException {
-		Object obj = null;
-		byte[] data = null;
-
-		String str_desc = in.readUTF();
-
-		boolean isActive = in.readBoolean();
-
-		if (isActive == ACTIVE_OBJECT) {
-
-			// Read the byte array that contains our object
-			data = (byte[]) in.readObject();
-
-			// convert the byte[] back into the real object
-			ByteArrayInputStream test_inBuffer = new ByteArrayInputStream(data);
-			ObjectInputStream test_objIn = new ObjectInputStream(test_inBuffer);
-			obj = test_objIn.readObject();
-			test_objIn.close();
-			test_inBuffer.close();
-
-		}
-
-		String value = "null";
-
-		if (obj != null) {
-			value = obj.getClass().getName();
-		}
-
-		// trace point
-		if (log.isTraceEnabled()) {
-			log.trace("ObjectStateUtils:readObject(): [" + desc
-					+ "]  returning  [" + value + "]   for saved [" + str_desc
-					+ "]");
-		}
-
-		return obj;
-	}
-
-	/**
-	 * Write an array of objects to the specified output stream. <p/> The format
-	 * of the information written to the output stream is
-	 * <LI> class name of the array
-	 * <LI> active or empty
-	 * <LI> data <p/> NOTE: each object in the array should implement either
-	 * java.io.Serializable or java.io.Externalizable in order to be saved <p/>
-	 * 
-	 * @param out
-	 *            The output stream
-	 * @param al
-	 *            The ArrayList to write
-	 * @param desc
-	 *            A text description to use for logging
-	 * @throws IOException
-	 *             Exception
-	 */
-	public static void writeArrayList(ObjectOutput out, ArrayList al,
-			String desc) throws IOException {
-		// The format of the data is
-		//
-		// Non-null list:
-		// UTF - description string
-		// boolean - active flag
-		// objects - objects from list
-		// - ACTIVE_OBJECT
-		// - data
-		// EMPTY_OBJEXT - end of array marker
-		//    
-		// Null list:
-		// UTF - description string
-		// boolean - empty flag
-		//
-		int savedListSize = 0;
-
-		out.writeUTF(desc);
-		out.writeBoolean(al == null ? EMPTY_OBJECT : ACTIVE_OBJECT);
-
-		if (al != null) {
-			// setup an iterator for the list
-			Iterator i = al.iterator();
-			while (i.hasNext()) {
-
-				Object obj = i.next();
-				try {
-					// put each list entry into a test output buffer to see if
-					// it can be saved
-					// this technique preserves the integrity of the real output
-					// stream in the
-					// event of a serialization error
-					ByteArrayOutputStream test_outBuffer = new ByteArrayOutputStream();
-					ObjectOutputStream test_objOut = new ObjectOutputStream(
-							test_outBuffer);
-
-					// write the object to the test buffer
-					test_objOut.writeObject(obj);
-					test_objOut.flush();
-
-					byte[] data = test_outBuffer.toByteArray();
-					out.writeBoolean(ACTIVE_OBJECT);
-					out.writeObject(data);
-
-					test_objOut.close();
-					test_outBuffer.close();
-					savedListSize++;
-				} catch (NotSerializableException nse2) {
-					// process this exception
-					traceNotSerializable(obj, nse2, desc,
-							"ObjectStateUtils.writeArrayList()",
-							OBJ_SAVE_PROBLEM);
-				} catch (Exception exc) {
-					// use this as a generic point for exceptions
-
-					// trace point
-					if (log.isTraceEnabled()) {
-						log.trace("ObjectStateUtils:writeArrayList(): object["
-								+ obj.getClass().getName()
-								+ "]  ***Exception***  ["
-								+ exc.getClass().getName() + " : "
-								+ exc.getMessage() + "]  " + OBJ_SAVE_PROBLEM,
-								exc);
-						// exc.printStackTrace();
-					}
-				}
-			}
-
-			// put the end-of-marker in the stream
-			out.writeBoolean(EMPTY_OBJECT);
-		}
-		// trace point
-		if (log.isTraceEnabled()) {
-			log.trace("ObjectStateUtils:writeArrayList(): List [" + desc
-					+ "]   members saved [" + savedListSize + "]");
-		}
-	}
-
-	/**
-	 * Reads an array of objects from the specified input stream. Returns null
-	 * if no array is available. <p/> The format of the information to be read
-	 * from the input stream should be
-	 * <LI> class name
-	 * <LI> active or empty
-	 * <LI> data <p/> NOTE: each object in the array should implement either
-	 * java.io.Serializable or java.io.Externalizable in order to be saved <p/>
-	 * 
-	 * @param in
-	 *            The input stream
-	 * @param desc
-	 *            A text description to use for logging
-	 * @return The ArrayList or null, if not available
-	 * @throws IOException
-	 * @throws ClassNotFoundException
-	 */
-	public static ArrayList readArrayList(ObjectInput in, String desc)
-			throws IOException {
-		// The format of the data is
-		//
-		// Non-null list:
-		// UTF - description string
-		// boolean - active flag
-		// objects - objects from list
-		// - ACTIVE_OBJECT
-		// - data
-		// EMPTY_OBJEXT - end of array marker
-		//    
-		// Null list:
-		// UTF - description string
-		// boolean - empty flag
-		//
-
-		ArrayList list = null;
-
-		String str_desc = in.readUTF();
-
-		boolean isActive = in.readBoolean();
-
-		if (isActive == ACTIVE_OBJECT) {
-			list = new ArrayList();
-
-			// stop when we get to the end-of-list marker
-			while (in.readBoolean()) {
-
-				// get the object
-				try {
-					byte[] data = (byte[]) in.readObject();
-
-					// convert the byte[] back into the real object
-					ByteArrayInputStream test_inBuffer = new ByteArrayInputStream(
-							data);
-					ObjectInputStream test_objIn = new ObjectInputStream(
-							test_inBuffer);
-					Object obj = test_objIn.readObject();
-					test_objIn.close();
-					test_inBuffer.close();
-
-					// add the entry to the list
-					list.add(obj);
-
-					// trace point
-					if (log.isTraceEnabled()) {
-						log.trace("ObjectStateUtils:readArrayList(): [" + desc
-								+ "]  index [" + list.size() + "]  for saved ["
-								+ str_desc + "]");
-					}
-				} catch (Exception ex) {
-					// use this as a generic point for all exceptions
-
-					// trace point
-					if (log.isTraceEnabled()) {
-						log.trace(
-								"ObjectStateUtils:readArrayList(): [" + desc
-										+ "]  object index [" + list.size()
-										+ "]   for saved [" + str_desc
-										+ "]  ***Exception***  ["
-										+ ex.getClass().getName() + " : "
-										+ ex.getMessage() + "]  "
-										+ OBJ_RESTORE_PROBLEM, ex);
-						// ex.printStackTrace();
-					}
-				}
-
-			} // end while keep going
-		}
-
-		// trace point
-		if (log.isTraceEnabled()) {
-			int size = (list == null) ? -1 : list.size();
-			log.trace("ObjectStateUtils:readArrayList(): [" + desc
-					+ "]  returning  [listsize=" + size + "]  for saved ["
-					+ str_desc + "]");
-		}
-		return list;
-	}
-
-	/**
-	 * Write a hashmap of objects to the specified output stream. <p/> The
-	 * format of the information written to the output stream is
-	 * <LI> class name of the array
-	 * <LI> active or empty
-	 * <LI> data <p/> NOTE: each object in the map should implement either
-	 * java.io.Serializable or java.io.Externalizable in order to be saved <p/>
-	 * 
-	 * @param out
-	 *            The output stream
-	 * @param map
-	 *            The HashMap to write
-	 * @param desc
-	 *            A text description to use for logging
-	 * @throws IOException
-	 *             Exception
-	 */
-	public static void writeHashMap(ObjectOutput out, HashMap map, String desc)
-			throws IOException {
-		// The format of the data is
-		//
-		// Non-null map:
-		// UTF - description string
-		// boolean - active flag
-		// objects - object,object pairs from list
-		// - active flag
-		// - key
-		// - value
-		// EMPTY OBJECT - end marker
-		//    
-		// Empty list:
-		// UTF - description string
-		// boolean - empty flag
-		//
-		int savedMapSize = 0;
-
-		out.writeUTF(desc);
-		out.writeBoolean(map == null ? EMPTY_OBJECT : ACTIVE_OBJECT);
-
-		if (map != null) {
-			Set keyset = map.keySet();
-			Iterator i = keyset.iterator();
-
-			while (i.hasNext()) {
-				// handle errors when can't access the value for the key
-
-				Object key = i.next();
-				Object value = map.get(key);
-
-				try {
-					// put each pair into a buffer to see if they can be saved
-					ByteArrayOutputStream pair_outBuffer = new ByteArrayOutputStream();
-					ObjectOutputStream pair_objOut = new ObjectOutputStream(
-							pair_outBuffer);
-
-					// write the objects in pairs
-					pair_objOut.writeObject(key);
-					pair_objOut.writeObject(value);
-					pair_objOut.flush();
-
-					byte[] data = pair_outBuffer.toByteArray();
-					out.writeBoolean(ACTIVE_OBJECT);
-					out.writeObject(data);
-
-					pair_objOut.close();
-					pair_outBuffer.close();
-					savedMapSize++;
-				} catch (NotSerializableException nse2) {
-					// only trace the first time a particular class causes this
-					// exception
-					traceNotSerializable(key, nse2, desc,
-							"ObjectStateUtils.writeHashMap() map key",
-							OBJ_SAVE_PROBLEM);
-				} catch (Exception exc) {
-					// use this as a generic point for exceptions
-
-					// trace point
-					if (log.isTraceEnabled()) {
-						log.trace("ObjectStateUtils:writeHashMap(): map key ["
-								+ key.getClass().getName()
-								+ "]  ***Exception***  ["
-								+ exc.getClass().getName() + " : "
-								+ exc.getMessage() + "]  " + OBJ_SAVE_PROBLEM,
-								exc);
-						// exc.printStackTrace();
-					}
-				}
-			}
-
-			// write out a marker for the end of list
-			out.writeBoolean(EMPTY_OBJECT);
-
-		}
-
-		// trace point
-		if (log.isTraceEnabled()) {
-			log.trace("ObjectStateUtils:writeHashMap(): map [" + desc
-					+ "]   members saved [" + savedMapSize + "]");
-		}
-	}
-
-	/**
-	 * Read a hashmap of objects from the specified input stream. Returns null
-	 * if no hashmap is available. <p/> The format of the information to be read
-	 * from the input stream should be
-	 * <LI> class name
-	 * <LI> active or empty
-	 * <LI> data <p/> NOTE: each object in the array should implement either
-	 * java.io.Serializable or java.io.Externalizable in order to be saved <p/>
-	 * 
-	 * @param in
-	 *            The input stream
-	 * @param desc
-	 *            A text description to use for logging
-	 * @return The HashMap or null, if not available
-	 * @throws IOException
-	 * @throws ClassNotFoundException
-	 */
-	public static HashMap readHashMap(ObjectInput in, String desc)
-			throws IOException {
-		// The format of the data is
-		//
-		// Non-null map:
-		// UTF - description string
-		// boolean - active flag
-		// objects - object,object pairs from list
-		// - active flag
-		// - key
-		// - value
-		// EMPTY OBJECT - end marker
-		//    
-		// Empty list:
-		// UTF - description string
-		// boolean - empty flag
-		//
-		int obtainedMapSize = 0;
-
-		HashMap map = null;
-		String str_desc = in.readUTF();
-		boolean isActive = in.readBoolean();
-
-		if (isActive == ACTIVE_OBJECT) {
-			map = new HashMap();
-
-			while (in.readBoolean()) {
-				Object key = null;
-				Object value = null;
-
-				try {
-					byte[] data = (byte[]) in.readObject();
-
-					// convert the byte[] back into the real objects
-					ByteArrayInputStream test_inBuffer = new ByteArrayInputStream(
-							data);
-					ObjectInputStream test_objIn = new ObjectInputStream(
-							test_inBuffer);
-					key = test_objIn.readObject();
-					value = test_objIn.readObject();
-					test_objIn.close();
-					test_inBuffer.close();
-
-					// add the entry to the map
-					map.put(key, value);
-					obtainedMapSize++;
-
-					// trace point
-					if (log.isTraceEnabled()) {
-						log.trace("ObjectStateUtils:readHashMap(): [" + desc
-								+ "]  object pair index [" + obtainedMapSize
-								+ "]   for saved [" + str_desc + "]");
-					}
-				} catch (Exception ex) {
-					// use this as a generic point for all exceptions
-
-					// trace point
-					if (log.isTraceEnabled()) {
-						log.trace(
-								"ObjectStateUtils:readHashMap(): [" + desc
-										+ "]  object pair index ["
-										+ obtainedMapSize + "]   for saved ["
-										+ str_desc + "] ***Exception***  ["
-										+ ex.getClass().getName() + " : "
-										+ ex.getMessage() + "]  "
-										+ OBJ_RESTORE_PROBLEM, ex);
-						// ex.printStackTrace();
-					}
-				}
-			}
-		}
-
-		int size = (map == null) ? -1 : map.size();
-		if (log.isTraceEnabled()) {
-			log.trace("ObjectStateUtils:readHashMap(): [" + desc
-					+ "]  returning  [mapsize=" + size + "]    for saved ["
-					+ str_desc + "]");
-		}
-
-		return map;
-	}
-
-	/**
-	 * Write a linked list of objects to the specified output stream. <p/> The
-	 * format of the information written to the output stream is
-	 * <LI> class name of the array
-	 * <LI> active or empty
-	 * <LI> data <p/> NOTE: each object in the array should implement either
-	 * java.io.Serializable or java.io.Externalizable in order to be saved <p/>
-	 * 
-	 * @param out
-	 *            The output stream
-	 * @param list
-	 *            The LinkedList to write
-	 * @param desc
-	 *            A text description to use for logging
-	 * @throws IOException
-	 *             Exception
-	 */
-	public static void writeLinkedList(ObjectOutput out, LinkedList objlist,
-			String desc) throws IOException {
-		// The format of the data is
-		//
-		// Non-null list:
-		// UTF - description string
-		// boolean - active flag
-		// objects - objects from list
-		// - ACTIVE_OBJECT
-		// - data
-		// EMPTY_OBJEXT - end of array marker
-		//    
-		// Null list:
-		// UTF - description string
-		// boolean - empty flag
-		//
-		int savedListSize = 0;
-
-		out.writeUTF(desc);
-		out.writeBoolean(objlist == null ? EMPTY_OBJECT : ACTIVE_OBJECT);
-
-		if (objlist != null) {
-			// setup an iterator for the list
-			Iterator i = objlist.iterator();
-
-			while (i.hasNext()) {
-				Object obj = i.next();
-
-				try {
-					// put each list entry into a test output buffer to see if
-					// it can be saved
-					// this technique preserves the integrity of the real output
-					// stream in the
-					// event of a serialization error
-					ByteArrayOutputStream test_outBuffer = new ByteArrayOutputStream();
-					ObjectOutputStream test_objOut = new ObjectOutputStream(
-							test_outBuffer);
-
-					// write the object to the test buffer
-					test_objOut.writeObject(obj);
-					test_objOut.flush();
-
-					byte[] data = test_outBuffer.toByteArray();
-					out.writeBoolean(ACTIVE_OBJECT);
-					out.writeObject(data);
-
-					test_objOut.close();
-					test_outBuffer.close();
-					savedListSize++;
-				} catch (NotSerializableException nse2) {
-					// process this exception
-					traceNotSerializable(obj, nse2, desc,
-							"ObjectStateUtils.writeLinkedList()",
-							OBJ_SAVE_PROBLEM);
-				} catch (Exception exc) {
-					// use this as a generic point for exceptions
-
-					// trace point
-					if (log.isTraceEnabled()) {
-						log.trace("ObjectStateUtils:writeLinkedList(): object["
-								+ obj.getClass().getName()
-								+ "]  ***Exception***  ["
-								+ exc.getClass().getName() + " : "
-								+ exc.getMessage() + "]  " + OBJ_SAVE_PROBLEM,
-								exc);
-						// exc.printStackTrace();
-					}
-				}
-			}
-
-			// put the end-of-marker in the stream
-			out.writeBoolean(EMPTY_OBJECT);
-		}
-		// trace point
-		if (log.isTraceEnabled()) {
-			log.trace("ObjectStateUtils:writeLinkedList(): List [" + desc
-					+ "]   members saved [" + savedListSize + "]");
-		}
-	}
-
-	/**
-	 * Reads a linked list of objects from the specified input stream. Returns
-	 * null if no array is available. <p/> The format of the information to be
-	 * read from the input stream should be
-	 * <LI> class name
-	 * <LI> active or empty
-	 * <LI> data <p/> NOTE: each object in the list should implement either
-	 * java.io.Serializable or java.io.Externalizable in order to be saved <p/>
-	 * 
-	 * @param in
-	 *            The input stream
-	 * @param desc
-	 *            A text description to use for logging
-	 * @return The linked list or null, if not available
-	 * @throws IOException
-	 * @throws ClassNotFoundException
-	 */
-	public static LinkedList readLinkedList(ObjectInput in, String desc)
-			throws IOException {
-		// The format of the data is
-		//
-		// Non-null list:
-		// UTF - description string
-		// boolean - active flag
-		// objects - objects from list
-		// - ACTIVE_OBJECT
-		// - data
-		// EMPTY_OBJEXT - end of array marker
-		//    
-		// Null list:
-		// UTF - description string
-		// boolean - empty flag
-		//
-
-		LinkedList list = null;
-
-		String str_desc = in.readUTF();
-
-		boolean isActive = in.readBoolean();
-
-		if (isActive == ACTIVE_OBJECT) {
-			list = new LinkedList();
-
-			// stop when we get to the end-of-list marker
-			while (in.readBoolean()) {
-
-				// get the object
-				try {
-					byte[] data = (byte[]) in.readObject();
-
-					// convert the byte[] back into the real object
-					ByteArrayInputStream test_inBuffer = new ByteArrayInputStream(
-							data);
-					ObjectInputStream test_objIn = new ObjectInputStream(
-							test_inBuffer);
-					Object obj = test_objIn.readObject();
-					test_objIn.close();
-					test_inBuffer.close();
-
-					// add the entry to the list
-					list.add(obj);
-
-					// trace point
-					if (log.isTraceEnabled()) {
-						log.trace("ObjectStateUtils:readArrayList(): [" + desc
-								+ "]  index [" + list.size() + "]  for saved ["
-								+ str_desc + "]");
-					}
-				} catch (Exception ex) {
-					// use this as a generic point for all exceptions
-
-					// trace point
-					if (log.isTraceEnabled()) {
-						log.trace(
-								"ObjectStateUtils:readArrayList(): [" + desc
-										+ "]  object index [" + list.size()
-										+ "]   for saved [" + str_desc
-										+ "]  ***Exception***  ["
-										+ ex.getClass().getName() + " : "
-										+ ex.getMessage() + "]  "
-										+ OBJ_RESTORE_PROBLEM, ex);
-						// ex.printStackTrace();
-					}
-				}
-
-			} // end while keep going
-		}
-
-		// trace point
-		if (log.isTraceEnabled()) {
-			int size = (list == null) ? -1 : list.size();
-			log.trace("ObjectStateUtils:readArrayList(): [" + desc
-					+ "]  returning  [listsize=" + size + "]  for saved ["
-					+ str_desc + "]");
-		}
-		return list;
-	}
-
-	// --------------------------------------------------------------------
-	// Finder methods
-	// --------------------------------------------------------------------
-
-	/**
-	 * Find the AxisOperation object that matches the criteria
-	 * 
-	 * @param axisConfig
-	 *            The AxisConfiguration object
-	 * @param opClassName
-	 *            the class name string for the target object (could be a
-	 *            derived class)
-	 * @param opQName
-	 *            the name associated with the operation
-	 * @return the AxisOperation object that matches the given criteria
-	 */
-	public static AxisOperation findOperation(AxisConfiguration axisConfig,
-			String opClassName, QName opQName) {
-		HashMap services = axisConfig.getServices();
-
-		Iterator its = services.values().iterator();
-
-		while (its.hasNext()) {
-			AxisService service = (AxisService) its.next();
-
-			Iterator ito = service.getOperations();
-
-			while (ito.hasNext()) {
-				AxisOperation operation = (AxisOperation) ito.next();
-
-				String tmpOpName = operation.getClass().getName();
-				QName tmpOpQName = operation.getName();
-
-				if ((tmpOpName.equals(opClassName))
-						&& (tmpOpQName.equals(opQName))) {
-					// trace point
-					if (log.isTraceEnabled()) {
-						log
-								.trace("ObjectStateUtils:findOperation(axisCfg): returning  ["
-										+ opClassName
-										+ "]   ["
-										+ opQName.toString() + "]");
-					}
-
-					return operation;
-				}
-			}
-		}
-
-		// trace point
-		if (log.isTraceEnabled()) {
-			log.trace("ObjectStateUtils:findOperation(axisCfg): ["
-					+ opClassName + "]   [" + opQName.toString()
-					+ "]  returning  [null]");
-		}
-
-		return null;
-	}
-
-	/**
-	 * Find the AxisOperation object that matches the criteria
-	 * 
-	 * @param service
-	 *            The AxisService object
-	 * @param opClassName
-	 *            The class name string for the target object (could be a
-	 *            derived class)
-	 * @param opQName
-	 *            the name associated with the operation
-	 * @return the AxisOperation object that matches the given criteria
-	 */
-	public static AxisOperation findOperation(AxisService service,
-			String opClassName, QName opQName) {
-		if (service == null) {
-			return null;
-		}
-
-		Iterator ito = service.getOperations();
-
-		while (ito.hasNext()) {
-			AxisOperation operation = (AxisOperation) ito.next();
-
-			String tmpOpName = operation.getClass().getName();
-			QName tmpOpQName = operation.getName();
-
-			if ((tmpOpName.equals(opClassName)) && (tmpOpQName.equals(opQName))) {
-				// trace point
-				if (log.isTraceEnabled()) {
-					log
-							.trace("ObjectStateUtils:findOperation(service): returning  ["
-									+ opClassName
-									+ "]   ["
-									+ opQName.toString() + "]");
-				}
-
-				return operation;
-			}
-		}
-
-		// trace point
-		if (log.isTraceEnabled()) {
-			log.trace("ObjectStateUtils:findOperation(service): ["
-					+ opClassName + "]   [" + opQName.toString()
-					+ "]  returning  [null]");
-		}
-
-		return null;
-	}
-
-	/**
-	 * Find the AxisService object that matches the criteria
-	 * 
-	 * @param axisConfig
-	 *            The AxisConfiguration object
-	 * @param serviceClassName
-	 *            the class name string for the target object (could be a
-	 *            derived class)
-	 * @param serviceName
-	 *            the name associated with the service
-	 * @return the AxisService object that matches the criteria
-	 */
-	public static AxisService findService(AxisConfiguration axisConfig,
-			String serviceClassName, String serviceName) {
-		HashMap services = axisConfig.getServices();
-
-		Iterator its = services.values().iterator();
-
-		while (its.hasNext()) {
-			AxisService service = (AxisService) its.next();
-
-			String tmpServClassName = service.getClass().getName();
-			String tmpServName = service.getName();
-
-			if ((tmpServClassName.equals(serviceClassName))
-					&& (tmpServName.equals(serviceName))) {
-				// trace point
-				if (log.isTraceEnabled()) {
-					log.trace("ObjectStateUtils:findService(): returning  ["
-							+ serviceClassName + "]   [" + serviceName + "]");
-				}
-
-				return service;
-			}
-		}
-
-		// trace point
-		if (log.isTraceEnabled()) {
-			log.trace("ObjectStateUtils:findService(): [" + serviceClassName
-					+ "]   [" + serviceName + "]  returning  [null]");
-		}
-
-		return null;
-	}
-
-	/**
-	 * Find the AxisServiceGroup object that matches the criteria <p/> <B>Note<B>
-	 * the saved service group meta information may not match up with any of the
-	 * serviceGroups that are in the current AxisConfiguration object.
-	 * 
-	 * @param axisConfig
-	 *            The AxisConfiguration object
-	 * @param serviceGrpClassName
-	 *            the class name string for the target object (could be a
-	 *            derived class)
-	 * @param serviceGrpName
-	 *            the name associated with the service group
-	 * @return the AxisServiceGroup object that matches the criteria
-	 */
-	public static AxisServiceGroup findServiceGroup(
-			AxisConfiguration axisConfig, String serviceGrpClassName,
-			String serviceGrpName) {
-		Iterator its = axisConfig.getServiceGroups();
-
-		while (its.hasNext()) {
-			AxisServiceGroup serviceGroup = (AxisServiceGroup) its.next();
-
-			String tmpSGClassName = serviceGroup.getClass().getName();
-			String tmpSGName = serviceGroup.getServiceGroupName();
-
-			if (tmpSGClassName.equals(serviceGrpClassName)) {
-				boolean found = false;
-
-				// the serviceGroupName can be null, so either both the
-				// service group names are null or they match
-				if ((tmpSGName == null) && (serviceGrpName == null)) {
-					found = true;
-				} else if ((tmpSGName != null)
-						&& (tmpSGName.equals(serviceGrpName))) {
-					found = true;
-				}
-
-				if (found) {
-					// trace point
-					if (log.isTraceEnabled()) {
-						log
-								.trace("ObjectStateUtils:findServiceGroup(): returning  ["
-										+ serviceGrpClassName
-										+ "]   ["
-										+ serviceGrpName + "]");
-					}
-
-					return serviceGroup;
-				}
-			}
-		}
-
-		// trace point
-		if (log.isTraceEnabled()) {
-			log.trace("ObjectStateUtils:findServiceGroup(): ["
-					+ serviceGrpClassName + "]   [" + serviceGrpName
-					+ "]  returning  [null]");
-		}
-
-		return null;
-	}
-
-	/**
-	 * Find the AxisMessage object that matches the criteria
-	 * 
-	 * @param op
-	 *            The AxisOperation object
-	 * @param msgName
-	 *            The name associated with the message
-	 * @param msgElementName
-	 *            The name associated with the message element
-	 * @return the AxisMessage object that matches the given criteria
-	 */
-	public static AxisMessage findMessage(AxisOperation op, String msgName,
-			String msgElementName) {
-		// Several kinds of AxisMessages can be associated with a particular
-		// AxisOperation. The kinds of AxisMessages that are typically
-		// accessible are associated with "in" and "out".
-		// There are also different kinds of AxisOperations, and each
-		// type of AxisOperation can have its own mix of AxisMessages
-		// depending on the style of message exchange pattern (mep)
-
-		if (op == null) {
-			// trace point
-			if (log.isTraceEnabled()) {
-				log.trace("ObjectStateUtils:findMessage(): [" + msgName
-						+ "]  [" + msgElementName
-						+ "] returning  [null] - no AxisOperation");
-			}
-
-			return null;
-		}
-
-		if (msgName == null) {
-			// nothing to match with, expect to match against a name
-			// trace point
-			if (log.isTraceEnabled()) {
-				log.trace("ObjectStateUtils:findMessage(): [" + msgName
-						+ "]  [" + msgElementName
-						+ "] returning  [null] - message name is not set");
-			}
-
-			return null;
-		}
-
-		String tmpName = null;
-		String tmpElementName = null;
-
-		// -------------------------------------
-		// first try the "out" message
-		// -------------------------------------
-		AxisMessage out = null;
-		try {
-			out = op.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
-		} catch (Exception ex) {
-			// just absorb the exception
-		}
-
-		if (out != null) {
-			tmpName = out.getName();
-
-			QName tmpQout = out.getElementQName();
-			if (tmpQout != null) {
-				tmpElementName = tmpQout.toString();
-			}
-		}
-
-		// check the criteria for a match
-
-		boolean matching = matchMessageNames(tmpName, tmpElementName, msgName,
-				msgElementName);
-
-		if (matching) {
-			// trace point
-			if (log.isTraceEnabled()) {
-				log
-						.trace("ObjectStateUtils:findMessage(): returning OUT message  ["
-								+ msgName + "]  [" + msgElementName + "] ");
-			}
-
-			return out;
-		}
-
-		// -------------------------------------
-		// next, try the "in" message
-		// -------------------------------------
-		AxisMessage in = null;
-		try {
-			in = op.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
-		} catch (Exception ex) {
-			// just absorb the exception
-		}
-
-		if (in != null) {
-			tmpName = in.getName();
-
-			QName tmpQin = in.getElementQName();
-			if (tmpQin != null) {
-				tmpElementName = tmpQin.toString();
-			}
-		} else {
-			tmpName = null;
-			tmpElementName = null;
-		}
-
-		// check the criteria for a match
-
-		matching = matchMessageNames(tmpName, tmpElementName, msgName,
-				msgElementName);
-
-		if (matching) {
-			// trace point
-			if (log.isTraceEnabled()) {
-				log
-						.trace("ObjectStateUtils:findMessage(): returning IN message ["
-								+ msgName + "]  [" + msgElementName + "] ");
-			}
-
-			return in;
-		}
-
-		// if we got here, then no match was found
-
-		// trace point
-		if (log.isTraceEnabled()) {
-			log.trace("ObjectStateUtils:findMessage(): [" + msgName + "]  ["
-					+ msgElementName + "] returning  [null]");
-		}
-
-		return null;
-	}
-
-	/**
-	 * Check the first set of names for a match against the second set of names.
-	 * These names are associated with AxisMessage objects. Message names are
-	 * expected to be non-null. Element names could be either null or non-null.
-	 * 
-	 * @param name1
-	 *            The name for the first message
-	 * @param elementName1
-	 *            The element name for the first message
-	 * @param name2
-	 *            The name for the second message
-	 * @param elementName2
-	 *            The element name for the second message
-	 * @return TRUE if there's a match, FALSE otherwise
-	 */
-	private static boolean matchMessageNames(String name1, String elementName1,
-			String name2, String elementName2) {
-		// the name for the message must exist
-		if ((name1 != null) && (name2 != null) && (name1.equals(name2))) {
-			// there's a match on the name associated with the message object
-
-			// element names need to match, including being null
-			if ((elementName1 == null) && (elementName2 == null)) {
-				// there's a match for the nulls
-				return true;
-			} else if ((elementName1 != null) && (elementName2 != null)
-					&& (elementName1.equals(elementName2))) {
-				// there's a match for the element names
-				return true;
-			} else {
-				// there's some mismatch
-				return false;
-			}
-		} else {
-			// either a message name is null or the names don't match
-			return false;
-		}
-	}
-
-	/**
-	 * Find the Handler object that matches the criteria
-	 * 
-	 * @param existingHandlers
-	 *            The list of existing handlers and phases
-	 * @param handlerClassName
-	 *            the class name string for the target object (could be a
-	 *            derived class)
-	 * @return the Handler object that matches the criteria
-	 */
-	public static Object findHandler(ArrayList existingHandlers,
-			MetaDataEntry metaDataEntry) // String handlerClassName)
-	{
-
-		String title = "ObjectStateUtils:findHandler(): ";
-
-		String handlerClassName = metaDataEntry.getClassName();
-		String qNameAsString = metaDataEntry.getQNameAsString();
-
-		for (int i = 0; i < existingHandlers.size(); i++) {
-			if (existingHandlers.get(i) != null) {
-				String tmpClassName = existingHandlers.get(i).getClass()
-						.getName();
-				String tmpName = ((Handler) existingHandlers.get(i)).getName()
-						.toString();
-
-				if ((tmpClassName.equals(handlerClassName))
-						&& (tmpName.equals(qNameAsString))) {
-					// trace point
-					if (log.isTraceEnabled()) {
-						log.trace(title + " [" + handlerClassName + "]  name ["
-								+ qNameAsString + "]  returned");
-					}
-
-					return (Handler) (existingHandlers.get(i));
-				}
-			}
-		}
-
-		// trace point
-		if (log.isTraceEnabled()) {
-			log.trace(title + " [" + handlerClassName + "]  name ["
-					+ qNameAsString
-					+ "] was not found in the existingHandlers list");
-		}
-
-		return null;
-	}
-
-	/**
-	 * Find the TransportListener object that matches the criteria <p/> <B>Note<B>
-	 * the saved meta information may not match up with any of the objects that
-	 * are in the current AxisConfiguration object.
-	 * 
-	 * @param axisConfig
-	 *            The AxisConfiguration object
-	 * @param listenerClassName
-	 *            the class name string for the target object (could be a
-	 *            derived class)
-	 * @return the TransportListener object that matches the criteria
-	 */
-	public static TransportListener findTransportListener(
-			AxisConfiguration axisConfig, String listenerClassName) {
-		// TODO: investigate a better technique to match up with a
-		// TransportListener
-
-		HashMap transportsIn = axisConfig.getTransportsIn();
-
-		// get a collection of the values in the map
-		Collection values = transportsIn.values();
-
-		Iterator i = values.iterator();
-
-		while (i.hasNext()) {
-			TransportInDescription ti = (TransportInDescription) i.next();
-
-			TransportListener tl = ti.getReceiver();
-			String tlClassName = tl.getClass().getName();
-
-			if (tlClassName.equals(listenerClassName)) {
-				// trace point
-				if (log.isTraceEnabled()) {
-					log.trace("ObjectStateUtils:findTransportListener():  ["
-							+ listenerClassName + "]  returned");
-				}
-
-				return tl;
-			}
-		}
-
-		// trace point
-		if (log.isTraceEnabled()) {
-			log
-					.trace("ObjectStateUtils:findTransportListener(): returning  [null]");
-		}
-
-		return null;
-	}
-
-	/**
-	 * Compares the two collections to see if they are equivalent.
-	 * 
-	 * @param a1
-	 *            The first collection
-	 * @param a2
-	 *            The second collection
-	 * @param strict
-	 *            Indicates whether strict checking is required. Strict checking
-	 *            means that the two collections must have the same elements in
-	 *            the same order. Non-strict checking means that the two
-	 *            collections must have the same elements, but the order is not
-	 *            significant.
-	 * @return TRUE if the two collections are equivalent FALSE, otherwise
-	 */
-	public static boolean isEquivalent(ArrayList a1, ArrayList a2,
-			boolean strict) {
-		if ((a1 != null) && (a2 != null)) {
-			// check number of elements in lists
-			int size1 = a1.size();
-			int size2 = a2.size();
-
-			if (size1 != size2) {
-				// trace point
-				if (log.isTraceEnabled()) {
-					log
-							.trace("ObjectStateUtils:isEquivalent(ArrayList,ArrayList): FALSE - size mismatch ["
-									+ size1 + "] != [" + size2 + "]");
-				}
-				return false;
-			}
-
-			if (strict) {
-				// Strict checking
-				// The lists must contain the same elements in the same order.
-				return (a1.equals(a2));
-			} else {
-				// Non-strict checking
-				// The lists must contain the same elements but the order is not
-				// required.
-				Iterator i1 = a1.iterator();
-
-				while (i1.hasNext()) {
-					Object obj1 = i1.next();
-
-					if (!a2.contains(obj1)) {
-						// trace point
-						if (log.isTraceEnabled()) {
-							log
-									.trace("ObjectStateUtils:isEquivalent(ArrayList,ArrayList): FALSE - mismatch with element ["
-											+ obj1.getClass().getName() + "] ");
-						}
-						return false;
-					}
-				}
-
-				return true;
-			}
-
-		} else if ((a1 == null) && (a2 == null)) {
-			return true;
-		} else if ((a1 != null) && (a2 == null)) {
-			if (a1.size() == 0) {
-				return true;
-			}
-			return false;
-		} else if ((a1 == null) && (a2 != null)) {
-			if (a2.size() == 0) {
-				return true;
-			}
-			return false;
-		} else {
-			// mismatch
-
-			// trace point
-			if (log.isTraceEnabled()) {
-				log
-						.trace("ObjectStateUtils:isEquivalent(ArrayList,ArrayList): FALSE - mismatch in lists");
-			}
-			return false;
-		}
-	}
-
-	/**
-	 * Compares the two collections to see if they are equivalent.
-	 * 
-	 * @param m1
-	 *            The first collection
-	 * @param m2
-	 *            The second collection
-	 * @param strict
-	 *            Indicates whether strict checking is required. Strict checking
-	 *            means that the two collections must have the same mappings.
-	 *            Non-strict checking means that the two collections must have
-	 *            the same keys. In both cases, the order is not significant.
-	 * @return TRUE if the two collections are equivalent FALSE, otherwise
-	 */
-	public static boolean isEquivalent(Map m1, Map m2, boolean strict) {
-		if ((m1 != null) && (m2 != null)) {
-			if (strict) {
-				// This is a strict test.
-				// Returns true if the given object is also a map and the two
-				// Maps
-				// represent the same mappings.
-				return (m1.equals(m2));
-			} else {
-				int size1 = m1.size();
-				int size2 = m2.size();
-
-				if (size1 != size2) {
-					return false;
-				}
-
-				// check the keys, ordering is not important between the two
-				// maps
-				Iterator it1 = m1.keySet().iterator();
-
-				while (it1.hasNext()) {
-					Object key1 = it1.next();
-
-					if (m2.containsKey(key1) == false) {
-						return false;
-					}
-				}
-
-				return true;
-			}
-		} else if ((m1 == null) && (m2 == null)) {
-			return true;
-		} else {
-			// mismatch
-			return false;
-		}
-	}
-
-	/**
-	 * Compares the two collections to see if they are equivalent.
-	 * 
-	 * @param l1
-	 *            The first collection
-	 * @param l2
-	 *            The second collection
-	 * @return TRUE if the two collections are equivalent FALSE, otherwise
-	 */
-	public static boolean isEquivalent(LinkedList l1, LinkedList l2) {
-		if ((l1 != null) && (l2 != null)) {
-			// This is a strict test.
-			// Returns true if the specified object is also a list,
-			// both lists have the same size, and all corresponding pairs
-			// of elements in the two lists are equal where
-			// they contain the same elements in the same order.
-			return (l1.equals(l2));
-		} else if ((l1 == null) && (l2 == null)) {
-			return true;
-		} else {
-			// mismatch
-			return false;
-		}
-	}
-
-	/**
-	 * Trace the NotSerializable exception for the specified object if this is
-	 * the first time that the specified object has caused the exception.
-	 * 
-	 * @param obj
-	 *            The object being saved or restored
-	 * @param nse
-	 *            The exception object with the details of the error
-	 * @param objDesc
-	 *            The description of the object, eg, like the field name where
-	 *            it is being used
-	 * @param methodName
-	 *            The method name which encountered the exception
-	 * @param desc
-	 *            Text to be used for tracing
-	 */
-	public static void traceNotSerializable(Object obj,
-			NotSerializableException nse, String objDesc, String methodName,
-			String desc) {
-		if (log.isTraceEnabled() == false) {
-			// if no tracing is being done, there's nothing to do
-			// exit quickly
-			return;
-		}
-
-		if (obj != null) {
-			String objName = obj.getClass().getName();
-
-			if (NotSerializableList.get(objName) == null) {
-				// set up some information about the exception
-				// for now, just use an initial counter, which we aren't doing
-				// much with
-				// but takes less space than the original object that caused the
-				// exception
-				// future: consider using a trace information object that would
-				// contain a count of the times that a particular class
-				// caused the exception, the class name of that class,
-				// and the stack trace for the first time - this information
-				// could then be accessed from a utility
-				Integer counter = new Integer(1);
-
-				// add to table
-				NotSerializableList.put(objName, counter);
-
-				// trace point
-				log.trace("ObjectStateUtils: ***NotSerializableException*** ["
-						+ nse.getMessage() + "] in method [" + methodName
-						+ "] for object [" + objName + "]  associated with ["
-						+ objDesc + "].  " + desc);
-			}
-
-		}
-
-	}
-
+public class ObjectStateUtils implements ExternalizeConstants {
+    /*
+     * setup for logging
+     */
+    private static final Log log = LogFactory.getLog(ObjectStateUtils.class);
+
+    // used to indicate an valid "null" object,
+    // typically used in key-value pairs where a non-null key refers to a null
+    // value
+    public static String NULL_OBJECT = "NULL_OBJ";
+
+    // message/trace/logging strings
+    public static final String UNSUPPORTED_SUID = "Serialization version ID is not supported.";
+
+    public static final String UNSUPPORTED_REVID = "Revision ID is not supported.";
+
+    // --------------------------------------------------------------------
+    // Save/Restore methods
+    // --------------------------------------------------------------------
+
+    /**
+     * Write a string to the specified output stream.
+     * 
+     * @param o The output stream
+     * @param str The string to write
+     * @param desc A text description to use for logging
+     * @throws IOException Exception
+     */
+    public static void writeString(ObjectOutput o, String str, String desc) throws IOException {
+        SafeObjectOutputStream out = SafeObjectOutputStream.install(o);
+        out.writeUTF(desc);
+        out.writeObject(str);
+    }
+
+    /**
+     * Read a string from the specified input stream. Returns null if no string is available.
+     * 
+     * @param i The input stream
+     * @param desc A text description to use for logging
+     * @return The string or null, if not available
+     * @throws IOException
+     * @throws ClassNotFoundException
+     */
+    public static String readString(ObjectInput i, String desc) throws IOException,
+                                                               ClassNotFoundException {
+        SafeObjectInputStream in = SafeObjectInputStream.install(i);
+
+        // Get the marker
+        in.readUTF();
+
+        // Get the object
+        return (String) in.readObject();
+    }
+
+    /**
+     * Write an object to the specified output stream.
+     * 
+     * @param o The output stream
+     * @param obj The object to write
+     * @param desc A text description to use for logging
+     * @throws IOException Exception
+     */
+    public static void writeObject(ObjectOutput o, Object obj, String desc) throws IOException {
+        SafeObjectOutputStream out = SafeObjectOutputStream.install(o);
+        out.writeUTF(desc);
+        out.writeObject(obj);
+    }
+
+    /**
+     * Read an object from the specified input stream. Returns null if no object is available.
+     * 
+     * @param i The input stream
+     * @param desc A text description to use for logging
+     * @return The object or null, if not available
+     * @throws IOException
+     * @throws ClassNotFoundException
+     */
+    public static Object readObject(ObjectInput i, String desc) throws IOException,
+                                                               ClassNotFoundException {
+        SafeObjectInputStream in = SafeObjectInputStream.install(i);
+        in.readUTF(); // Read Marker
+        return in.readObject();
+    }
+
+    /**
+     * Write an array of objects to the specified output stream. NOTE: each object in the array
+     * should implement either java.io.Serializable or java.io.Externalizable in order to be saved
+     * 
+     * @param o The output stream
+     * @param al The ArrayList to write
+     * @param desc A text description to use for logging
+     * @throws IOException Exception
+     */
+    public static void writeArrayList(ObjectOutput o, ArrayList al, String desc) 
+      throws IOException {
+        SafeObjectOutputStream out = SafeObjectOutputStream.install(o);
+        out.writeUTF(desc);
+        out.writeList(al);
+    }
+
+    /**
+     * Reads an array of objects from the specified input stream. Returns null if no array is
+     * available. NOTE: each object in the array should implement either java.io.Serializable or
+     * java.io.Externalizable in order to be saved
+     * 
+     * @param i The input stream
+     * @param desc A text description to use for logging
+     * @return The ArrayList or null, if not available
+     * @throws IOException
+     * @throws ClassNotFoundException
+     */
+    public static ArrayList readArrayList(ObjectInput i, String desc) throws IOException {
+        SafeObjectInputStream in = SafeObjectInputStream.install(i);
+        in.readUTF();
+        return in.readArrayList();
+    }
+
+    /**
+     * Write a hashmap of objects to the specified output stream. NOTE: each object in the map
+     * should implement either java.io.Serializable or java.io.Externalizable in order to be saved
+     * 
+     * @param o The output stream
+     * @param map The HashMap to write
+     * @param desc A text description to use for logging
+     * @throws IOException Exception
+     */
+    public static void writeHashMap(ObjectOutput o, HashMap map, String desc) throws IOException {
+        SafeObjectOutputStream out = SafeObjectOutputStream.install(o);
+        out.writeUTF(desc);
+        out.writeMap(map);
+    }
+
+    /**
+     * Read a hashmap of objects from the specified input stream. Returns null if no hashmap is
+     * available.
+     * 
+     * @param in The input stream
+     * @param desc A text description to use for logging
+     * @return The HashMap or null, if not available
+     * @throws IOException
+     * @throws ClassNotFoundException
+     */
+    public static HashMap readHashMap(ObjectInput i, String desc) throws IOException {
+        SafeObjectInputStream in = SafeObjectInputStream.install(i);
+        in.readUTF();
+        return in.readHashMap();
+    }
+
+    /**
+     * Write a linked list of objects to the specified output stream. <NOTE: each object in the
+     * array should implement either java.io.Serializable or java.io.Externalizable in order to be
+     * saved
+     * 
+     * @param o The output stream
+     * @param list The LinkedList to write
+     * @param desc A text description to use for logging
+     * @throws IOException Exception
+     */
+    public static void writeLinkedList(ObjectOutput o, LinkedList objlist, String desc)
+      throws IOException {
+        SafeObjectOutputStream out = SafeObjectOutputStream.install(o);
+        out.writeUTF(desc);
+        out.writeList(objlist);
+
+    }
+
+    /**
+     * Reads a linked list of objects from the specified input stream. Returns null if no array is
+     * available.
+     * 
+     * @param in The input stream
+     * @param desc A text description to use for logging
+     * @return The linked list or null, if not available
+     * @throws IOException
+     * @throws ClassNotFoundException
+     */
+    public static LinkedList readLinkedList(ObjectInput i, String desc) throws IOException {
+        SafeObjectInputStream in = SafeObjectInputStream.install(i);
+        in.readUTF();
+        return in.readLinkedList();
+    }
+
+    // --------------------------------------------------------------------
+    // Finder methods
+    // --------------------------------------------------------------------
+
+    /**
+     * Find the AxisOperation object that matches the criteria
+     * 
+     * @param axisConfig The AxisConfiguration object
+     * @param opClassName the class name string for the target object (could be a derived class)
+     * @param opQName the name associated with the operation
+     * @return the AxisOperation object that matches the given criteria
+     */
+    public static AxisOperation findOperation(AxisConfiguration axisConfig, String opClassName,
+                                              QName opQName) {
+        return ActivateUtils.findOperation(axisConfig, opClassName, opQName);
+    }
+
+    /**
+     * Find the AxisOperation object that matches the criteria
+     * 
+     * @param service The AxisService object
+     * @param opClassName The class name string for the target object (could be a derived class)
+     * @param opQName the name associated with the operation
+     * @return the AxisOperation object that matches the given criteria
+     */
+    public static AxisOperation findOperation(AxisService service, 
+                                              String opClassName, 
+                                              QName opQName) {
+        return ActivateUtils.findOperation(service, opClassName, opQName);
+    }
+
+    /**
+     * Find the AxisService object that matches the criteria
+     * 
+     * @param axisConfig The AxisConfiguration object
+     * @param serviceClassName the class name string for the target object (could be a derived
+     * class)
+     * @param serviceName the name associated with the service
+     * @return the AxisService object that matches the criteria
+     */
+    public static AxisService findService(AxisConfiguration axisConfig, String serviceClassName,
+                                          String serviceName) {
+        return ActivateUtils.findService(axisConfig, serviceClassName, serviceName);
+    }
+
+    /**
+     * Find the AxisServiceGroup object that matches the criteria <p/> <B>Note<B> the saved 
+     * service group meta information may not match up with any of the serviceGroups that 
+     * are in the current AxisConfiguration object.
+     * 
+     * @param axisConfig The AxisConfiguration object
+     * @param serviceGrpClassName the class name string for the target object (could be a derived
+     * class)
+     * @param serviceGrpName the name associated with the service group
+     * @return the AxisServiceGroup object that matches the criteria
+     */
+    public static AxisServiceGroup findServiceGroup(AxisConfiguration axisConfig,
+                                                    String serviceGrpClassName,
+                                                    String serviceGrpName) {
+        return ActivateUtils.findServiceGroup(axisConfig, serviceGrpClassName, serviceGrpName);
+    }
+
+    /**
+     * Find the AxisMessage object that matches the criteria
+     * 
+     * @param op The AxisOperation object
+     * @param msgName The name associated with the message
+     * @param msgElementName The name associated with the message element
+     * @return the AxisMessage object that matches the given criteria
+     */
+    public static AxisMessage findMessage(AxisOperation op, 
+                                          String msgName, 
+                                          String msgElementName) {
+        return ActivateUtils.findMessage(op, msgName, msgElementName);
+    }
+
+    /**
+     * Find the Handler object that matches the criteria
+     * 
+     * @param existingHandlers The list of existing handlers and phases
+     * @param handlerClassName the class name string for the target object (could be a derived
+     * class)
+     * @return the Handler object that matches the criteria
+     */
+    public static Object findHandler(ArrayList existingHandlers, 
+                                     MetaDataEntry metaDataEntry) 
+    {
+        return ActivateUtils.findHandler(existingHandlers, metaDataEntry);
+    }
+
+    /**
+     * Find the TransportListener object that matches the criteria <p/> <B>Note<B> the saved meta
+     * information may not match up with any of the objects that are in the current
+     * AxisConfiguration object.
+     * 
+     * @param axisConfig The AxisConfiguration object
+     * @param listenerClassName the class name string for the target object (could be a derived
+     * class)
+     * @return the TransportListener object that matches the criteria
+     */
+    public static TransportListener findTransportListener(AxisConfiguration axisConfig,
+                                                          String listenerClassName) {
+        return ActivateUtils.findTransportListener(axisConfig, listenerClassName);
+    }
+
+    /**
+     * Compares the two collections to see if they are equivalent.
+     * 
+     * @param a1 The first collection
+     * @param a2 The second collection
+     * @param strict Indicates whether strict checking is required. Strict checking means that the
+     * two collections must have the same elements in the same order. 
+     * Non-strict checking means that the two collections must have the same elements, 
+     * but the order is not significant.
+     * @return TRUE if the two collections are equivalent FALSE, otherwise
+     */
+    public static boolean isEquivalent(ArrayList a1, ArrayList a2, boolean strict) {
+        return ActivateUtils.isEquivalent(a1, a2, strict);
+    }
+
+    /**
+     * Compares the two collections to see if they are equivalent.
+     * 
+     * @param m1 The first collection
+     * @param m2 The second collection
+     * @param strict Indicates whether strict checking is required. Strict checking means that the
+     * two collections must have the same mappings. Non-strict checking means that the two
+     * collections must have the same keys. In both cases, the order is not significant.
+     * @return TRUE if the two collections are equivalent FALSE, otherwise
+     */
+    public static boolean isEquivalent(Map m1, Map m2, boolean strict) {
+        return ActivateUtils.isEquivalent(m1, m2, strict);
+    }
+
+    /**
+     * Compares the two collections to see if they are equivalent.
+     * 
+     * @param l1
+     *            The first collection
+     * @param l2
+     *            The second collection
+     * @return TRUE if the two collections are equivalent FALSE, otherwise
+     */
+    public static boolean isEquivalent(LinkedList l1, LinkedList l2) {
+        return ActivateUtils.isEquivalent(l1, l2);
+    }
 }

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/PrettyPrinter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/PrettyPrinter.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/PrettyPrinter.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/PrettyPrinter.java Sat Oct  6 07:53:06 2007
@@ -47,7 +47,7 @@
         // If the user has set "axis2.jalopy=false" on the system property,
         // then just return back to caller
         String property = System.getProperty("axis2.jalopy");
-        if(property != null && JavaUtils.isFalseExplicitly(property)){
+        if((property == null) || !JavaUtils.isTrueExplicitly(property)){
             return;
         }
         PrintStream backupOutputStream = System.out;

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/test/org/apache/axis2/engine/MessageContextChangeTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/test/org/apache/axis2/engine/MessageContextChangeTest.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/test/org/apache/axis2/engine/MessageContextChangeTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/test/org/apache/axis2/engine/MessageContextChangeTest.java Sat Oct  6 07:53:06 2007
@@ -35,7 +35,7 @@
             new FieldDescription("java.lang.String", "logCorrelationIDString"),
             new FieldDescription("java.lang.String", "myClassName"),
             new FieldDescription("long", "serialVersionUID"),
-            new FieldDescription("int", "REVISION_1"),
+            new FieldDescription("int", "REVISION_2"),
             new FieldDescription("int", "revisionID"),
             new FieldDescription("java.lang.ThreadLocal", "currentMessageContext"),
             new FieldDescription("org.apache.axis2.client.Options", "options"),

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/test/org/apache/axis2/engine/MessageContextSaveATest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/test/org/apache/axis2/engine/MessageContextSaveATest.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/test/org/apache/axis2/engine/MessageContextSaveATest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/test/org/apache/axis2/engine/MessageContextSaveATest.java Sat Oct  6 07:53:06 2007
@@ -19,7 +19,6 @@
 
 package org.apache.axis2.engine;
 
-import junit.framework.TestCase;
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.util.UUIDGenerator;
 import org.apache.axiom.soap.SOAPFactory;
@@ -30,6 +29,7 @@
 import org.apache.axis2.context.OperationContext;
 import org.apache.axis2.context.ServiceContext;
 import org.apache.axis2.context.ServiceGroupContext;
+import org.apache.axis2.context.externalize.ActivateUtils;
 import org.apache.axis2.description.AxisMessage;
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisService;
@@ -47,12 +47,12 @@
 import org.apache.axis2.receivers.RawXMLINOutMessageReceiver;
 import org.apache.axis2.transport.http.CommonsHTTPTransportSender;
 import org.apache.axis2.transport.http.SimpleHTTPServer;
-import org.apache.axis2.util.ObjectStateUtils;
 import org.apache.axis2.wsdl.WSDLConstants;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 import javax.xml.namespace.QName;
+
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
@@ -62,6 +62,8 @@
 import java.util.HashMap;
 import java.util.Iterator;
 
+import junit.framework.TestCase;
+
 public class MessageContextSaveATest extends TestCase {
     protected static final Log log = LogFactory.getLog(MessageContextSaveATest.class);
 
@@ -685,7 +687,7 @@
                 ArrayList orig_execChain = simpleMsg.getExecutionChain();
 
                 comparesOk =
-                        ObjectStateUtils.isEquivalent(restored_execChain, orig_execChain, false);
+                        ActivateUtils.isEquivalent(restored_execChain, orig_execChain, false);
                 log.debug(title + "execution chain equivalency [" + comparesOk + "]");
                 assertTrue(comparesOk);
 
@@ -834,7 +836,7 @@
                 ArrayList orig_execChain = simpleMsg.getExecutionChain();
 
                 comparesOk =
-                        ObjectStateUtils.isEquivalent(restored_execChain, orig_execChain, false);
+                    ActivateUtils.isEquivalent(restored_execChain, orig_execChain, false);
                 log.debug(title + "execution chain equivalency [" + comparesOk + "]");
                 assertTrue(comparesOk);
 
@@ -1241,7 +1243,7 @@
                         ArrayList restored_execChain = msgContext2.getExecutionChain();
                         ArrayList orig_execChain = msgContext.getExecutionChain();
 
-                        comparesOk = ObjectStateUtils
+                        comparesOk = ActivateUtils
                                 .isEquivalent(restored_execChain, orig_execChain, false);
                         log.debug(title + "execution chain equivalency [" + comparesOk + "]");
                         assertTrue(comparesOk);

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/test/org/apache/axis2/engine/MessageContextSaveBTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/test/org/apache/axis2/engine/MessageContextSaveBTest.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/test/org/apache/axis2/engine/MessageContextSaveBTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/test/org/apache/axis2/engine/MessageContextSaveBTest.java Sat Oct  6 07:53:06 2007
@@ -19,7 +19,6 @@
 
 package org.apache.axis2.engine;
 
-import junit.framework.TestCase;
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.util.UUIDGenerator;
 import org.apache.axiom.soap.SOAPFactory;
@@ -30,6 +29,7 @@
 import org.apache.axis2.context.OperationContext;
 import org.apache.axis2.context.ServiceContext;
 import org.apache.axis2.context.ServiceGroupContext;
+import org.apache.axis2.context.externalize.ActivateUtils;
 import org.apache.axis2.description.AxisMessage;
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisService;
@@ -47,12 +47,12 @@
 import org.apache.axis2.receivers.RawXMLINOutMessageReceiver;
 import org.apache.axis2.transport.http.CommonsHTTPTransportSender;
 import org.apache.axis2.transport.http.SimpleHTTPServer;
-import org.apache.axis2.util.ObjectStateUtils;
 import org.apache.axis2.wsdl.WSDLConstants;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 import javax.xml.namespace.QName;
+
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
@@ -63,6 +63,8 @@
 import java.util.Iterator;
 import java.util.Map;
 
+import junit.framework.TestCase;
+
 public class MessageContextSaveBTest extends TestCase {
     protected static final Log log = LogFactory.getLog(MessageContextSaveBTest.class);
 
@@ -590,7 +592,7 @@
         showProperties(properties4, "service properties from other active MsgCtx");
 
         // the service level properties should be the same
-        boolean isOk = ObjectStateUtils.isEquivalent(properties3, properties4, true);
+        boolean isOk = ActivateUtils.isEquivalent(properties3, properties4, true);
         assertTrue(isOk);
 
     }

Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/pom.xml?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/pom.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/pom.xml Sat Oct  6 07:53:06 2007
@@ -131,6 +131,23 @@
 							<goal>run</goal>
 						</goals>
 					</execution>
+					<execution>
+						<id>build-repo</id>
+						<phase>test-compile</phase>
+						<configuration>
+							<tasks>
+								<copy toDir="target/test-classes/">
+									<fileset dir="test-resources/">
+										<include name="**/*.properties"/>
+									</fileset>
+								</copy>
+							</tasks>
+						</configuration>
+						<goals>
+							<goal>run</goal>
+						</goals>
+					</execution>
+					
 				</executions>
 				<dependencies>
 					<!--<dependency>
@@ -169,9 +186,6 @@
 					<includes>
 						<include>**/*Tests.java</include>
 					</includes>
-					<excludes>
-						<exclude>**/AnnotationServiceImplDescriptionTests.java</exclude>
-					</excludes>
 				</configuration>
 			</plugin>
 		</plugins>

Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaClassToDBCConverter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaClassToDBCConverter.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaClassToDBCConverter.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaClassToDBCConverter.java Sat Oct  6 07:53:06 2007
@@ -43,8 +43,11 @@
 import org.apache.axis2.jaxws.description.builder.WebServiceAnnot;
 import org.apache.axis2.jaxws.description.builder.WebServiceProviderAnnot;
 import org.apache.axis2.jaxws.description.builder.WebServiceRefAnnot;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 public class JavaClassToDBCConverter {
+    private static final Log log = LogFactory.getLog(JavaClassToDBCConverter.class);
 
     private Class serviceClass;
 
@@ -85,10 +88,9 @@
                     }
                 }
                 catch (ClassNotFoundException e) {
-                    // TODO: (JLB) Make this an error log?
-                    System.out
-                            .println("Class not found exception caught for class: " + seiClassName);
-                    e.printStackTrace();
+                    if (log.isDebugEnabled()) {
+                        log.debug("Class not found exception caught for class: " + seiClassName, e);
+                    }
                 }
             }
         }

Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java Sat Oct  6 07:53:06 2007
@@ -989,59 +989,77 @@
 
     private void validateImplementation(DescriptionBuilderComposite seic) {
         /*
-           *	Verify that an impl class implements all the methods of the SEI. We
-           *  have to verify this because an impl class is not required to actually use
-           *  the 'implements' clause. So, if it doesn't, the Java compiler won't
-           *	catch it. Don't need to worry about chaining because only one EndpointInterface
-           *  can be specified, and the SEI cannot specify an EndpointInterface, so the Java
-           *	compiler will take care of everything else.
-           */
-
-        HashMap<String, MethodDescriptionComposite> compositeHashMap = 
-            new HashMap<String, MethodDescriptionComposite>();
-        Iterator<MethodDescriptionComposite> compIterator =
-                composite.getMethodDescriptionsList().iterator();
-        while (compIterator.hasNext()) {
-            MethodDescriptionComposite mdc = compIterator.next();
-            compositeHashMap.put(mdc.getMethodName(), mdc);
-        }
+         *  Verify that an impl class implements all the methods of the SEI. We have to verify this 
+         *  because an impl class is not required to actually use the 'implements' clause. So, if 
+         *  it doesn't, the Java compiler won't catch it. Don't need to worry about chaining 
+         *  because only one EndpointInterface can be specified, and the SEI cannot specify an 
+         *  EndpointInterface, so the Java compiler will take care of everything else.
+         *  
+         *  Note, however, that we do need to take overloaded methods into a consideration.  The
+         *  same method name can be specified for multiple methods, but they can have different
+         *  parameters.  Note that methods which differ only in the return type or the exceptions
+         *  thrown are not overloaded (and therefore would cause a compile error).
+         */
+
+        List<MethodDescriptionComposite> implMethods = composite.getMethodDescriptionsList();
         // Add methods declared in the implementation's superclass
-        addSuperClassMethods(compositeHashMap, composite);
+        addSuperClassMethods(implMethods, composite);
 
-        HashMap<String, MethodDescriptionComposite> seiMethodHashMap = 
-            new HashMap<String, MethodDescriptionComposite>();
-        Iterator<MethodDescriptionComposite> seiMethodIterator =
-                seic.getMethodDescriptionsList().iterator();
-        while (seiMethodIterator.hasNext()) {
-            MethodDescriptionComposite mdc = seiMethodIterator.next();
-            seiMethodHashMap.put(mdc.getMethodName(), mdc);
-        }
+        List<MethodDescriptionComposite> seiMethods = seic.getMethodDescriptionsList();
         // Add any methods declared in superinterfaces of the SEI
-        addSuperClassMethods(seiMethodHashMap, seic);
+        addSuperClassMethods(seiMethods, seic);
 
         // Make sure all the methods in the SEI (including any inherited from superinterfaces) are
-        // implemented by the bean (including inherited methods on the bean).
-        Iterator<MethodDescriptionComposite> verifySEIIterator =
-                seiMethodHashMap.values().iterator();
+        // implemented by the bean (including inherited methods on the bean), taking into
+        // account overloaded methods.
+        Iterator<MethodDescriptionComposite> verifySEIIterator = seiMethods.iterator();
         while (verifySEIIterator.hasNext()) {
-            MethodDescriptionComposite mdc = verifySEIIterator.next();
-            // TODO: This does not take into consideration overloaded java methods!
-            MethodDescriptionComposite implMDC = compositeHashMap.get(mdc.getMethodName());
+            MethodDescriptionComposite seiMDC = verifySEIIterator.next();
             
-            if (implMDC == null) {
-                // TODO: RAS/NLS
-                throw ExceptionFactory.makeWebServiceException(
-                        "Validation error: Implementation subclass does not implement method on specified interface.  Implementation class: "
-                                + composite.getClassName() + "; missing method name: " +
-                                mdc.getMethodName() + "; endpointInterface: " +
-                                seic.getClassName());
-            } else {
-                //At least we found it, now make sure that signatures match up
+            // Make sure the implementation implements this SEI method.  Since we have to account
+            // for method overloading, we look for ALL methods with the same name in the 
+            // implementation, then from that collection of methods, we look for one that has the 
+            // same parameters.  If we find one with the same parameters, then we check the return
+            // and exceptions.  Note that in Java, overloaded methods are ones that have the same
+            // name but different parameters; a difference in the return type or thrown exceptions
+            // does not constitute overloading and is a compile error.
+            Iterator<MethodDescriptionComposite> implMDCIterator = implMethods.iterator();
+            boolean methodImplFound = false;
+            while (implMDCIterator.hasNext()) {
+                MethodDescriptionComposite implMDC = implMDCIterator.next();
                 
-                //Check for exception and signature matching
-                validateMethodExceptions(mdc, implMDC, seic.getClassName());
-                validateMethodReturnValue(mdc, implMDC, seic.getClassName());
-                validateMethodParameters(mdc, implMDC, seic.getClassName());
+                if (seiMDC.getMethodName().equals(implMDC.getMethodName())) {
+                    // The method names match, so now check the parameters
+                    try {
+                        validateMethodParameters(seiMDC, implMDC, seic.getClassName());
+                        methodImplFound = true;
+                    }
+                    catch (Exception ex) {
+                        // The parameters didn't match, so we'll check the next 
+                        // implemntation method on the next iteration of the inner loop.
+                    }
+                    
+                    // If the name and the parameters matched, then we've found the method
+                    // implementation, even if it was overloaded. Now check the return value and
+                    // thrown exceptions.  Note these will methods throw exceptions if validation fails.
+                    // If all the validation passes, we can break out of the inner loop since we 
+                    // found the implementation for this sei method.
+                    if (methodImplFound) {
+                        validateMethodExceptions(seiMDC, implMDC, seic.getClassName());
+                        validateMethodReturnValue(seiMDC, implMDC, seic.getClassName());
+                        break;
+                    }
+                }
+            }
+            
+            if (!methodImplFound) {
+                // We didn't find the implementation for this SEI method, so throw a validation
+                // exception.
+                throw ExceptionFactory.makeWebServiceException(
+                    "Validation error: Implementation subclass does not implement method on specified interface.  Implementation class: "
+                    + composite.getClassName() + "; missing method name: " +
+                    seiMDC.getMethodName() + "; endpointInterface: " +
+                    seic.getClassName());
             }
         }
     }
@@ -1201,24 +1219,23 @@
     }
 
     /**
-     * Adds any methods declared in superclasses to the HashMap.  The hierachy starting with the DBC
+     * Adds any methods declared in superclasses to the List.  The hierachy starting with the DBC
      * will be walked up recursively, adding methods from each parent DBC encountered.
      * <p/>
      * Note that this can be used for either classes or interfaces.
      *
-     * @param methodMap
-     * @param dbc
+     * @param methodList The current collection of methods, including overloaded ones
+     * @param dbc The composite to be checked for methods to be added to the collection
      */
-    private void addSuperClassMethods(HashMap methodMap, DescriptionBuilderComposite dbc) {
+    private void addSuperClassMethods(List<MethodDescriptionComposite> methodList, DescriptionBuilderComposite dbc) {
         DescriptionBuilderComposite superDBC = dbcMap.get(dbc.getSuperClassName());
         if (superDBC != null) {
-            Iterator<MethodDescriptionComposite> mIter =
-                    superDBC.getMethodDescriptionsList().iterator();
+            Iterator<MethodDescriptionComposite> mIter = superDBC.getMethodDescriptionsList().iterator();
             while (mIter.hasNext()) {
                 MethodDescriptionComposite mdc = mIter.next();
-                methodMap.put(mdc.getMethodName(), mdc);
+                methodList.add(mdc);
             }
-            addSuperClassMethods(methodMap, superDBC);
+            addSuperClassMethods(methodList, superDBC);
         }
     }
 

Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/test-resources/log4j.properties
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/test-resources/log4j.properties?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/test-resources/log4j.properties (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/test-resources/log4j.properties Sat Oct  6 07:53:06 2007
@@ -20,7 +20,8 @@
 # Set root category priority to INFO and its only appender to CONSOLE.
 #log4j.rootCategory=DEBUG, CONSOLE
 #log4j.rootCategory=INFO, CONSOLE, LOGFILE
-log4j.rootCategory=INFO, CONSOLE
+#log4j.rootCategory=INFO, CONSOLE
+log4j.rootCategory=ERROR, CONSOLE
 
 # Set the enterprise logger priority to FATAL
 log4j.logger.org.apache.axis2.enterprise=FATAL

Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/test/org/apache/axis2/jaxws/description/AnnotationServiceImplDescriptionTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/test/org/apache/axis2/jaxws/description/AnnotationServiceImplDescriptionTests.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/test/org/apache/axis2/jaxws/description/AnnotationServiceImplDescriptionTests.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/test/org/apache/axis2/jaxws/description/AnnotationServiceImplDescriptionTests.java Sat Oct  6 07:53:06 2007
@@ -25,6 +25,7 @@
 import org.apache.axis2.description.Parameter;
 import org.apache.log4j.BasicConfigurator;
 import org.apache.ws.axis2.tests.EchoServiceImplWithSEI;
+import org.apache.ws.axis2.tests.EchoPort;
 
 import javax.jws.Oneway;
 import javax.jws.WebMethod;
@@ -69,8 +70,6 @@
         EndpointInterfaceDescription endpointIntfDesc =
                 endpointDesc[0].getEndpointInterfaceDescription();
         assertNotNull(endpointIntfDesc);
-        // TODO: (JLB) Remove code
-//        assertEquals(EchoPort.class, endpointIntfDesc.getSEIClass());
 
         OperationDescription[] operations =
                 endpointIntfDesc.getOperationForJavaMethod("badMethodName");
@@ -144,8 +143,6 @@
         EndpointInterfaceDescription endpointIntfDesc =
                 endpointDesc[0].getEndpointInterfaceDescription();
         assertNotNull(endpointIntfDesc);
-        // TODO: (JLB) Remove code
-//        assertEquals(endpointIntfDesc.getSEIClass(), DocLitWrappedProxy.class);
 
         // Test for overloaded methods
         // SEI defines two Java methods with this name



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org