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 sc...@apache.org on 2007/09/19 18:56:49 UTC

svn commit: r577367 [2/5] - in /webservices/axis2/trunk/java/modules: jaxws/src/org/apache/axis2/jaxws/client/ jaxws/src/org/apache/axis2/jaxws/message/util/ kernel/src/org/apache/axis2/addressing/ kernel/src/org/apache/axis2/client/ kernel/src/org/apa...

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/OperationContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/OperationContext.java?rev=577367&r1=577366&r2=577367&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/OperationContext.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/OperationContext.java Wed Sep 19 09:56:47 2007
@@ -22,24 +22,28 @@
 
 import org.apache.axiom.om.util.UUIDGenerator;
 import org.apache.axis2.AxisFault;
+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.context.externalize.SafeSerializable;
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.util.MetaDataEntry;
-import org.apache.axis2.util.ObjectStateUtils;
 import org.apache.axis2.wsdl.WSDLConstants.WSDL20_2004_Constants;
 import org.apache.axis2.wsdl.WSDLConstants.WSDL20_2006Constants;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 import javax.xml.namespace.QName;
+
 import java.io.Externalizable;
 import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import java.util.HashMap;
 import java.util.Iterator;
-import java.util.Map;
 import java.util.Set;
 
 /**
@@ -56,7 +60,8 @@
  * order to support another MEP one must extend this class and register its
  * creation in the OperationContexFactory.
  */
-public class OperationContext extends AbstractContext implements Externalizable {
+public class OperationContext extends AbstractContext 
+    implements Externalizable, SafeSerializable {
 
     /*
      * setup for logging
@@ -71,7 +76,7 @@
      * An ID which can be used to correlate operations on an instance of
      * this object in the log files
      */
-    private String logCorrelationIDString = myClassName + "@" + UUIDGenerator.getUUID();
+    private String logCorrelationIDString = null;
 
 
     /**
@@ -93,9 +98,9 @@
      * Refer to the writeExternal() and readExternal() methods.
      */
     // supported revision levels, add a new level to manage compatible changes
-    private static final int REVISION_1 = 1;
+    private static final int REVISION_2 = 2;
     // current revision level of this object
-    private static final int revisionID = REVISION_1;
+    private static final int revisionID = REVISION_2;
 
 
     /**
@@ -240,7 +245,7 @@
      */
     public AxisOperation getAxisOperation() {
         if (needsToBeReconciled && !suppressWarnings && debugEnabled) {
-            log.debug(logCorrelationIDString +
+            log.debug(getLogCorrelationIDString() +
                     ":getAxisOperation(): ****WARNING**** OperationContext.activate(configurationContext) needs to be invoked.");
         }
 
@@ -341,7 +346,8 @@
      * @param out The stream to write the object contents to
      * @throws IOException
      */
-    public void writeExternal(ObjectOutput out) throws IOException {
+    public void writeExternal(ObjectOutput o) throws IOException {
+        SafeObjectOutputStream out = SafeObjectOutputStream.install(o);
         //---------------------------------------------------------
         // in order to handle future changes to the message
         // context definition, be sure to maintain the
@@ -360,66 +366,46 @@
         out.writeLong(getLastTouchedTime());
 
         out.writeBoolean(isComplete);
-
-        ObjectStateUtils.writeString(out, key, logCorrelationIDString + ".key");
-
-        ObjectStateUtils.writeString(out, logCorrelationIDString,
-                                     logCorrelationIDString + ".logCorrelationIDString");
+        out.writeObject(key);
+        out.writeObject(logCorrelationIDString);
 
         //---------------------------------------------------------
         // properties
         //---------------------------------------------------------
-        Map tmpMap = getProperties();
-
-        HashMap tmpHashMap = null;
-
-        if ((tmpMap != null) && (!tmpMap.isEmpty())) {
-            tmpHashMap = new HashMap(tmpMap);
-        }
-
-        ObjectStateUtils.writeHashMap(out, tmpHashMap, logCorrelationIDString + ".properties");
+        out.writeUTF("properties");  // write marker
+        out.writeMap(getProperties());
 
         //---------------------------------------------------------
         // AxisOperation axisOperation
         //---------------------------------------------------------
-        String axisOpMarker = logCorrelationIDString + ".axisOperation";
-        ObjectStateUtils.writeString(out, axisOpMarker, axisOpMarker);
-
-        if (axisOperation == null) {
-            out.writeBoolean(ObjectStateUtils.EMPTY_OBJECT);
-        } else {
-            out.writeBoolean(ObjectStateUtils.ACTIVE_OBJECT);
+        out.writeUTF("metaAxisOperation"); // write marker
+        metaAxisOperation = null;
+        if (axisOperation != null) {
             metaAxisOperation = new MetaDataEntry(axisOperation.getClass().getName(),
                                                   axisOperation.getName().toString());
-            ObjectStateUtils.writeObject(out, metaAxisOperation,
-                                         logCorrelationIDString + ".metaAxisOperation");
         }
+        out.writeObject(metaAxisOperation);
 
+        //---------------------------------------------------------
+        // AxisOperation axisService
+        //---------------------------------------------------------
         // save the meta data for the corresponding axis service to better
         // match up the axis operation
-
-        String axisServMarker = logCorrelationIDString + ".metaAxisService";
-        ObjectStateUtils.writeString(out, axisServMarker, axisServMarker);
-
+        out.writeUTF("metaAxisService"); // write marker
+        metaAxisService = null;
         AxisService axisService = axisOperation.getAxisService();
 
-        if (axisService == null) {
-            out.writeBoolean(ObjectStateUtils.EMPTY_OBJECT);
-        } else {
-            out.writeBoolean(ObjectStateUtils.ACTIVE_OBJECT);
+        if (axisService != null) {
             metaAxisService =
                     new MetaDataEntry(axisService.getClass().getName(), axisService.getName());
-            ObjectStateUtils
-                    .writeObject(out, metaAxisService, logCorrelationIDString + ".metaAxisService");
         }
+        out.writeObject(metaAxisService);
 
         //---------------------------------------------------------
         // parent
         //---------------------------------------------------------
-        ServiceContext myParent = this.getServiceContext();
-
-        ObjectStateUtils
-                .writeObject(out, myParent, logCorrelationIDString + ".parent ServiceContext");
+        out.writeUTF("parent"); // write marker
+        out.writeObject(this.getServiceContext());
 
         //---------------------------------------------------------
         // HashMap messageContexts table
@@ -490,29 +476,32 @@
                 String keyObj2 = (String) itKeys2.next();
 
                 // get the message context associated with that label
-                MessageContext value2 = (MessageContext) workingSet.get(keyObj2);
+                MessageContext mc = (MessageContext) workingSet.get(keyObj2);
 
                 // construct a copy of the message context
                 // that has been extracted from the object hierarchy
-                MessageContext modifiedValue2 = value2.extractCopyMessageContext();
+                MessageContext copyMC = mc.extractCopyMessageContext();
+                
+                // Don't persist the message of the other message contexts
+                copyMC.setEnvelope(null);
 
                 // put the modified entry in the list
-                tmpMsgCtxMap.put(keyObj2, modifiedValue2);
+                tmpMsgCtxMap.put(keyObj2, copyMC);
 
                 // trace point
-                log.trace(logCorrelationIDString +
-                        ":writeExternal():  getting working set entry  key [" + keyObj2 +
-                        "]   message context ID[" + modifiedValue2.getMessageID() + "]");
+                if (log.isTraceEnabled()) {
+                    log.trace(getLogCorrelationIDString() +
+                              ":writeExternal():  getting working set entry  key [" + keyObj2 +
+                              "]   message context ID[" + copyMC.getMessageID() + "]");
+                }
             }
 
         }
 
-        ObjectStateUtils.writeHashMap(out, tmpMsgCtxMap,
-                                      logCorrelationIDString + ".messageContexts working set");
-
-        // next, deal with the metadata table of messageContexts
-        ObjectStateUtils.writeHashMap(out, metaMessageContextMap, logCorrelationIDString +
-                ".metaMessageContextMap metadata table");
+        out.writeUTF("messagecontexts"); // write marker
+        out.writeMap(tmpMsgCtxMap);
+        out.writeUTF("metaMessageContextMap");
+        out.writeMap(metaMessageContextMap);
 
         //---------------------------------------------------------
         // done
@@ -532,7 +521,8 @@
      * @throws IOException
      * @throws ClassNotFoundException
      */
-    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+    public void readExternal(ObjectInput inObject) throws IOException, ClassNotFoundException {
+        SafeObjectInputStream in = SafeObjectInputStream.install(inObject);
         // set the flag to indicate that the message context is being
         // reconstituted and will need to have certain object references
         // to be reconciled with the current engine setup
@@ -554,12 +544,12 @@
 
         // make sure the object data is in a version we can handle
         if (suid != serialVersionUID) {
-            throw new ClassNotFoundException(ObjectStateUtils.UNSUPPORTED_SUID);
+            throw new ClassNotFoundException(ExternalizeConstants.UNSUPPORTED_SUID);
         }
 
         // make sure the object data is in a revision level we can handle
-        if (revID != REVISION_1) {
-            throw new ClassNotFoundException(ObjectStateUtils.UNSUPPORTED_REVID);
+        if (revID != REVISION_2) {
+            throw new ClassNotFoundException(ExternalizeConstants.UNSUPPORTED_REVID);
         }
 
         //---------------------------------------------------------
@@ -570,26 +560,20 @@
         setLastTouchedTime(time);
 
         isComplete = in.readBoolean();
-
-        key = ObjectStateUtils.readString(in, "OperationContext.key");
-
-        logCorrelationIDString =
-                ObjectStateUtils.readString(in, "OperationContext.logCorrelationIDString");
-
+        key = (String) in.readObject();
+        logCorrelationIDString = (String) in.readObject();
+       
         // trace point
-        log.trace(myClassName + ":readExternal():  reading input stream for [" +
-                logCorrelationIDString + "]  ");
+        if (log.isTraceEnabled()) {
+            log.trace(myClassName + ":readExternal():  reading input stream for [" +
+                      getLogCorrelationIDString() + "]  ");
+        }
 
         //---------------------------------------------------------
         // properties
         //---------------------------------------------------------
-
-        HashMap tmpHashMap = ObjectStateUtils.readHashMap(in, "OperationContext.properties");
-
-        properties = new HashMap();
-        if (tmpHashMap != null) {
-            setProperties(tmpHashMap);
-        }
+        in.readUTF(); // read marker
+        properties = in.readHashMap();
 
         //---------------------------------------------------------
         // axis operation meta data
@@ -597,39 +581,22 @@
 
         // axisOperation is not usable until the meta data has been reconciled
         axisOperation = null;
+        in.readUTF(); // read marker
+        metaAxisOperation = (MetaDataEntry) in.readObject();
 
-        ObjectStateUtils.readString(in, "OperationContext.axisOperation");
-
-        boolean metaAxisOperationIsActive = in.readBoolean();
-
-        if (metaAxisOperationIsActive == ObjectStateUtils.ACTIVE_OBJECT) {
-            metaAxisOperation = (MetaDataEntry) ObjectStateUtils
-                    .readObject(in, "OperationContext.metaAxisOperation");
-        } else {
-            metaAxisOperation = null;
-        }
-
+        //---------------------------------------------------------
+        // axis service meta data
+        //---------------------------------------------------------
         // axisService is not usable until the meta data has been reconciled
-
-        ObjectStateUtils.readString(in, "OperationContext.axisService");
-
-        boolean metaAxisServiceIsActive = in.readBoolean();
-
-        if (metaAxisServiceIsActive == ObjectStateUtils.ACTIVE_OBJECT) {
-            metaAxisService = (MetaDataEntry) ObjectStateUtils
-                    .readObject(in, "OperationContext.metaAxisService");
-        } else {
-            metaAxisService = null;
-        }
+        in.readUTF(); // read marker
+        metaAxisService = (MetaDataEntry) in.readObject();
 
         //---------------------------------------------------------
         // parent
         //---------------------------------------------------------
-
         // ServiceContext is not usable until it has been activated
-
-        metaParent = (ServiceContext) ObjectStateUtils
-                .readObject(in, "OperationContext.parent ServiceContext");
+        in.readUTF(); // read marker
+        metaParent = (ServiceContext) in.readObject();
 
         //---------------------------------------------------------
         // HashMap messageContexts table
@@ -637,18 +604,14 @@
 
         // set to empty until this can be activiated
         messageContexts = new HashMap();
-
-        workingSet = ObjectStateUtils
-                .readHashMap(in, logCorrelationIDString + ".messageContexts working set");
-
-        metaMessageContextMap = ObjectStateUtils
-                .readHashMap(in, logCorrelationIDString + ".metaMessageContextMap metadata table");
-
+        in.readUTF(); // read marker
+        workingSet = in.readHashMap();
+        in.readUTF(); // read marker
+        metaMessageContextMap = in.readHashMap();
+        
         //---------------------------------------------------------
         // done
         //---------------------------------------------------------
-
-
     }
 
 
@@ -677,18 +640,18 @@
         AxisService axisService = null;
 
         if (metaAxisService != null) {
-            axisService = ObjectStateUtils.findService(axisConfig, metaAxisService.getClassName(),
+            axisService = ActivateUtils.findService(axisConfig, metaAxisService.getClassName(),
                                                        metaAxisService.getQNameAsString());
         }
 
         // We previously saved metaAxisOperation; restore it
         if (metaAxisOperation != null) {
             if (axisService != null) {
-                this.axisOperation = ObjectStateUtils.findOperation(axisService,
+                this.axisOperation = ActivateUtils.findOperation(axisService,
                                                                     metaAxisOperation.getClassName(),
                                                                     metaAxisOperation.getQName());
             } else {
-                this.axisOperation = ObjectStateUtils.findOperation(axisConfig,
+                this.axisOperation = ActivateUtils.findOperation(axisConfig,
                                                                     metaAxisOperation.getClassName(),
                                                                     metaAxisOperation.getQName());
             }
@@ -776,9 +739,13 @@
                 boolean registrationSuceeded = activeCC.registerOperationContext(key, this, true);
                 if (!registrationSuceeded) {
                     // trace point
-                    log.trace(logCorrelationIDString + ":activate():  OperationContext key [" + key
-                              + "] already exists in ConfigurationContext map.  This OperationContext ["
+                    if (log.isTraceEnabled()) {
+                        log.trace(getLogCorrelationIDString()+ ":activate():  " +
+                                        "OperationContext key [" + key
+                              + "] already exists in ConfigurationContext map.  " +
+                                        "This OperationContext ["
                               + this.toString() + "] was not added to the table.");
+                    }
                 }
             }
         }
@@ -805,8 +772,10 @@
                 // activate that object
                 if (value != null) {
                     // trace point
-                    log.trace(logCorrelationIDString + ":activate():  key [" + keyObj +
+                    if (log.isTraceEnabled()) {
+                        log.trace(getLogCorrelationIDString() + ":activate():  key [" + keyObj +
                             "]  message id [" + value.getMessageID() + "]");
+                    }
 
                     suppressWarnings = true;
                     value.activateWithOperationContext(this);
@@ -910,10 +879,12 @@
                     isolatedMessageContexts.put(keyObj, value);
 
                     // trace point
-                    log.trace(logCorrelationIDString +
+                    if (log.isTraceEnabled()) {
+                        log.trace(getLogCorrelationIDString() +
                             ":isolateMessageContext():  set up message context id[" + valueID +
                             "]  with key [" + keyObj.toString() +
                             "] from messageContexts table to prepare for serialization.");
+                    }
 
                     break;
                 }
@@ -934,7 +905,7 @@
         if (needsToBeReconciled) {
             // nope, need to do the activation first
             if (debugEnabled) {
-                log.debug(logCorrelationIDString +
+                log.debug(getLogCorrelationIDString() +
                           ":restoreMessageContext(): *** WARNING : need to invoke activate() prior to restoring the MessageContext to the list.");
             }
 
@@ -950,7 +921,7 @@
         if (msgID == null) {
             if (debugEnabled) {
                 // can't identify message context
-                log.debug(logCorrelationIDString +
+                log.debug(getLogCorrelationIDString() +
                         ":restoreMessageContext(): *** WARNING : MessageContext does not have a message ID.");
             }
             return;
@@ -985,9 +956,11 @@
                         // remove the metadata from the metadata table
                         metaMessageContextMap.remove(keyM);
 
-                        log.trace(logCorrelationIDString +
+                        if (log.isTraceEnabled()) {
+                            log.trace(getLogCorrelationIDString() +
                                 ":restoreMessageContext():  restored   label [" + label +
                                 "]    message ID [" + msg.getMessageID() + "]");
+                        }
 
                         break;
                     }
@@ -1121,6 +1094,9 @@
      *         entries.
      */
     public String getLogCorrelationIDString() {
+        if (logCorrelationIDString == null) {
+            logCorrelationIDString = myClassName + "@" + UUIDGenerator.getUUID();
+        }
         return logCorrelationIDString;
     }
 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ServiceContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ServiceContext.java?rev=577367&r1=577366&r2=577367&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ServiceContext.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ServiceContext.java Wed Sep 19 09:56:47 2007
@@ -23,6 +23,11 @@
 import org.apache.axiom.om.util.UUIDGenerator;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.addressing.EndpointReference;
+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.context.externalize.SafeSerializable;
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.TransportInDescription;
@@ -31,23 +36,23 @@
 import org.apache.axis2.i18n.Messages;
 import org.apache.axis2.util.LoggingControl;
 import org.apache.axis2.util.MetaDataEntry;
-import org.apache.axis2.util.ObjectStateUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 import javax.xml.namespace.QName;
+
 import java.io.Externalizable;
 import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
-import java.util.HashMap;
 import java.util.Map;
 
 /**
  * Well this is never clearly defined, what it does or the life-cycle.
  * So do NOT use this as it might not live up to your expectation.
  */
-public class ServiceContext extends AbstractContext implements Externalizable {
+public class ServiceContext extends AbstractContext 
+    implements Externalizable, SafeSerializable {
 
     /*
      * setup for logging
@@ -60,7 +65,7 @@
      * An ID which can be used to correlate operations on an instance of
      * this object in the log files
      */
-    private String logCorrelationIDString = myClassName + "@" + UUIDGenerator.getUUID();
+    private String logCorrelationIDString = null;
 
 
     /**
@@ -82,9 +87,9 @@
      * Refer to the writeExternal() and readExternal() methods.
      */
     // supported revision levels, add a new level to manage compatible changes
-    private static final int REVISION_1 = 1;
+    private static final int REVISION_2 = 2;
     // current revision level of this object
-    private static final int revisionID = REVISION_1;
+    private static final int revisionID = REVISION_2;
 
 
     public static final String SERVICE_OBJECT = "serviceObject";
@@ -313,7 +318,8 @@
      * @param out The stream to write the object contents to
      * @throws IOException
      */
-    public void writeExternal(ObjectOutput out) throws IOException {
+    public void writeExternal(ObjectOutput o) throws IOException {
+        SafeObjectOutputStream out = SafeObjectOutputStream.install(o);
         //---------------------------------------------------------
         // in order to handle future changes to the message 
         // context definition, be sure to maintain the 
@@ -330,75 +336,34 @@
         //---------------------------------------------------------
 
         out.writeLong(getLastTouchedTime());
-
         out.writeBoolean(cachingOperationContext);
+        out.writeObject(getLogCorrelationIDString());
 
-        ObjectStateUtils.writeString(out, logCorrelationIDString,
-                                     logCorrelationIDString + ".logCorrelationIDString");
-
-        // put some try..catch blocks around the following objects
-        // so that the writing to the output stream continues
-        // even if one of the objects can't be serialized
-
-        try {
-            // EndpointReference targetEPR
-            ObjectStateUtils.writeObject(out, targetEPR, "ServiceContext.targetEPR");
-        }
-        catch (Exception e1) {
-            // note that the utility class will provide the trace for the 
-            // exception so we won't have to
-            // so just consume the exception for now
-        }
-
-
-        try {
-            // EndpointReference myEPR
-            ObjectStateUtils.writeObject(out, myEPR, "ServiceContext.myEPR");
-        }
-        catch (Exception e2) {
-            // note that the utility class will provide the trace for the 
-            // exception so we won't have to
-            // so just consume the exception for now
-        }
-
+        // EndpointReference targetEPR
+        out.writeObject(targetEPR);
+       
+        // EndpointReference myEPR
+        out.writeObject(myEPR);
+        
         //---------------------------------------------------------
         // properties
         //---------------------------------------------------------
-        Map tmpMap = getProperties();
-
-        HashMap tmpHashMap = null;
-
-        if ((tmpMap != null) && (!tmpMap.isEmpty())) {
-            tmpHashMap = new HashMap(tmpMap);
-        }
-
-        ObjectStateUtils.writeHashMap(out, tmpHashMap, "ServiceContext.properties");
-
+        out.writeMap(getProperties());
+        
         //---------------------------------------------------------
         // AxisService
         //---------------------------------------------------------
-
-        String axisServMarker = "ServiceContext.metaAxisService";
-        ObjectStateUtils.writeString(out, axisServMarker, axisServMarker);
-
-        if (axisService == null) {
-            out.writeBoolean(ObjectStateUtils.EMPTY_OBJECT);
-        } else {
-            out.writeBoolean(ObjectStateUtils.ACTIVE_OBJECT);
+        metaAxisService = null;
+        if (axisService != null) {
             metaAxisService =
                     new MetaDataEntry(axisService.getClass().getName(), axisService.getName());
-            ObjectStateUtils.writeObject(out, metaAxisService, "ServiceContext.metaAxisService");
         }
+        out.writeObject(metaAxisService);
 
         //---------------------------------------------------------
         // parent 
         //---------------------------------------------------------
-        // ServiceGroupContext serviceGroupContext;
-
-        ServiceGroupContext myParent = (ServiceGroupContext) getParent();
-
-        ObjectStateUtils.writeObject(out, myParent, "ServiceContext.parent ServiceGroupContext");
-
+        out.writeObject(getParent());
     }
 
 
@@ -413,7 +378,8 @@
      * @throws IOException
      * @throws ClassNotFoundException
      */
-    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+    public void readExternal(ObjectInput inObject) throws IOException, ClassNotFoundException {
+        SafeObjectInputStream in = SafeObjectInputStream.install(inObject);
         // set the flag to indicate that the message context is being
         // reconstituted and will need to have certain object references 
         // to be reconciled with the current engine setup
@@ -437,12 +403,12 @@
 
         // make sure the object data is in a version we can handle
         if (suid != serialVersionUID) {
-            throw new ClassNotFoundException(ObjectStateUtils.UNSUPPORTED_SUID);
+            throw new ClassNotFoundException(ExternalizeConstants.UNSUPPORTED_SUID);
         }
 
         // make sure the object data is in a revision level we can handle
-        if (revID != REVISION_1) {
-            throw new ClassNotFoundException(ObjectStateUtils.UNSUPPORTED_REVID);
+        if (revID != REVISION_2) {
+            throw new ClassNotFoundException(ExternalizeConstants.UNSUPPORTED_REVID);
         }
 
         //---------------------------------------------------------
@@ -451,60 +417,39 @@
 
         long time = in.readLong();
         setLastTouchedTime(time);
-
         cachingOperationContext = in.readBoolean();
-
-        logCorrelationIDString =
-                ObjectStateUtils.readString(in, myClassName + ".logCorrelationIDString");
+        logCorrelationIDString = (String) in.readObject();
 
         // trace point
         if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
             log.trace(myClassName + ":readExternal():  reading input stream for [" +
-                logCorrelationIDString + "]  ");
+                      getLogCorrelationIDString()+ "]  ");
         }
 
         // EndpointReference targetEPR
-        targetEPR = (EndpointReference) ObjectStateUtils.readObject(in, "ServiceContext.targetEPR");
+        targetEPR = (EndpointReference) in.readObject();
 
         // EndpointReference myEPR
-        myEPR = (EndpointReference) ObjectStateUtils.readObject(in, "ServiceContext.myEPR");
+        myEPR = (EndpointReference) in.readObject();
 
         //---------------------------------------------------------
         // properties
         //---------------------------------------------------------
-
-        HashMap tmpHashMap = ObjectStateUtils.readHashMap(in, "ServiceContext.properties");
-
-        properties = new HashMap();
-        if (tmpHashMap != null) {
-            setProperties(tmpHashMap);
-        }
+        properties = in.readHashMap();
 
         //---------------------------------------------------------
         // AxisService
         //---------------------------------------------------------
 
         // axisService is not usable until the meta data has been reconciled
-
-        ObjectStateUtils.readString(in, "ServiceContext.axisService");
-
-        boolean metaAxisServiceIsActive = in.readBoolean();
-
-        if (metaAxisServiceIsActive == ObjectStateUtils.ACTIVE_OBJECT) {
-            metaAxisService = (MetaDataEntry) ObjectStateUtils
-                    .readObject(in, "ServiceContext.metaAxisService");
-        } else {
-            metaAxisService = null;
-        }
+        metaAxisService = (MetaDataEntry) in.readObject();
 
         //---------------------------------------------------------
         // parent 
         //---------------------------------------------------------
 
         // ServiceGroupContext is not usable until it has been activated 
-
-        metaParent = (ServiceGroupContext) ObjectStateUtils
-                .readObject(in, "ServiceContext.parent ServiceGroupContext");
+        metaParent = (ServiceGroupContext) in.readObject();
 
         //---------------------------------------------------------
         // other
@@ -547,7 +492,7 @@
         axisService = null;
 
         if (metaAxisService != null) {
-            axisService = ObjectStateUtils.findService(axisConfig, metaAxisService.getClassName(),
+            axisService = ActivateUtils.findService(axisConfig, metaAxisService.getClassName(),
                                                        metaAxisService.getQNameAsString());
         }
 
@@ -714,6 +659,9 @@
      *         entries.
      */
     public String getLogCorrelationIDString() {
+        if (logCorrelationIDString == null) {
+            logCorrelationIDString = myClassName + "@" + UUIDGenerator.getUUID();
+        }
         return logCorrelationIDString;
     }
 
@@ -727,7 +675,7 @@
     private void checkActivateWarning(String methodname) {
         if (needsToBeReconciled) {
             if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
-                log.debug(logCorrelationIDString + ":" + methodname + "(): ****WARNING**** "
+                log.debug(getLogCorrelationIDString()+ ":" + methodname + "(): ****WARNING**** "
                         + myClassName + ".activate(configurationContext) needs to be invoked.");
             }
         }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ServiceGroupContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ServiceGroupContext.java?rev=577367&r1=577366&r2=577367&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ServiceGroupContext.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ServiceGroupContext.java Wed Sep 19 09:56:47 2007
@@ -22,12 +22,16 @@
 
 import org.apache.axiom.om.util.UUIDGenerator;
 import org.apache.axis2.AxisFault;
+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.context.externalize.SafeSerializable;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.AxisServiceGroup;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.i18n.Messages;
 import org.apache.axis2.util.MetaDataEntry;
-import org.apache.axis2.util.ObjectStateUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -39,7 +43,8 @@
 import java.util.Iterator;
 import java.util.Map;
 
-public class ServiceGroupContext extends AbstractContext implements Externalizable {
+public class ServiceGroupContext extends AbstractContext 
+    implements Externalizable, SafeSerializable {
 
     /*
      * setup for logging
@@ -67,9 +72,9 @@
      * Refer to the writeExternal() and readExternal() methods.
      */
     // supported revision levels, add a new level to manage compatible changes
-    private static final int REVISION_1 = 1;
+    private static final int REVISION_2 = 2;
     // current revision level of this object
-    private static final int revisionID = REVISION_1;
+    private static final int revisionID = REVISION_2;
 
 
     private transient AxisServiceGroup axisServiceGroup;
@@ -267,7 +272,8 @@
      * @param out The stream to write the object contents to
      * @throws IOException
      */
-    public void writeExternal(ObjectOutput out) throws IOException {
+    public void writeExternal(ObjectOutput o) throws IOException {
+        SafeObjectOutputStream out = SafeObjectOutputStream.install(o);
         // write out contents of this object
 
         //---------------------------------------------------------
@@ -291,38 +297,22 @@
             // generate an ID to use when this object is restored
             id = UUIDGenerator.getUUID();
         }
-
-        ObjectStateUtils.writeString(out, id, "ServiceGroupContext.id");
+        out.writeObject(id);
 
         //---------------------------------------------------------
         // properties
         //---------------------------------------------------------
-        Map tmpMap = getProperties();
-
-        HashMap tmpHashMap = null;
-
-        if ((tmpMap != null) && (!tmpMap.isEmpty())) {
-            tmpHashMap = new HashMap(tmpMap);
-        }
-
-        ObjectStateUtils.writeHashMap(out, tmpHashMap, "ServiceGroupContext.properties");
+        out.writeMap(getProperties());
 
         //---------------------------------------------------------
         // AxisServiceGroup
         //---------------------------------------------------------
-
-        String axisServGrpMarker = "ServiceGroupContext.axisServiceGroup";
-        ObjectStateUtils.writeString(out, axisServGrpMarker, axisServGrpMarker);
-
-        if (axisServiceGroup == null) {
-            out.writeBoolean(ObjectStateUtils.EMPTY_OBJECT);
-        } else {
-            out.writeBoolean(ObjectStateUtils.ACTIVE_OBJECT);
+        metaAxisServiceGroup = null;
+        if (axisServiceGroup != null) {
             metaAxisServiceGroup = new MetaDataEntry(axisServiceGroup.getClass().getName(),
                                                      axisServiceGroup.getServiceGroupName());
-            ObjectStateUtils.writeObject(out, metaAxisServiceGroup,
-                                         "ServiceGroupContext.metaAxisServiceGroup");
         }
+        out.writeObject(metaAxisServiceGroup);
 
         //---------------------------------------------------------
         // parent 
@@ -348,7 +338,8 @@
      * @throws IOException
      * @throws ClassNotFoundException
      */
-    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+    public void readExternal(ObjectInput inObject) throws IOException, ClassNotFoundException {
+        SafeObjectInputStream in = SafeObjectInputStream.install(inObject);
         // set the flag to indicate that the message context is being
         // reconstituted and will need to have certain object references 
         // to be reconciled with the current engine setup
@@ -368,12 +359,12 @@
 
         // make sure the object data is in a version we can handle
         if (suid != serialVersionUID) {
-            throw new ClassNotFoundException(ObjectStateUtils.UNSUPPORTED_SUID);
+            throw new ClassNotFoundException(ExternalizeConstants.UNSUPPORTED_SUID);
         }
 
         // make sure the object data is in a revision level we can handle
-        if (revID != REVISION_1) {
-            throw new ClassNotFoundException(ObjectStateUtils.UNSUPPORTED_REVID);
+        if (revID != REVISION_2) {
+            throw new ClassNotFoundException(ExternalizeConstants.UNSUPPORTED_REVID);
         }
 
         //---------------------------------------------------------
@@ -382,19 +373,12 @@
 
         long time = in.readLong();
         setLastTouchedTime(time);
-
-        id = ObjectStateUtils.readString(in, "ServiceGroupContext.id");
+        id = (String) in.readObject();
 
         //---------------------------------------------------------
         // properties
         //---------------------------------------------------------
-
-        HashMap tmpHashMap = ObjectStateUtils.readHashMap(in, "ServiceGroupContext.properties");
-
-        properties = new HashMap();
-        if (tmpHashMap != null) {
-            setProperties(tmpHashMap);
-        }
+        properties = in.readHashMap();
 
         //---------------------------------------------------------
         // AxisServiceGroup
@@ -402,17 +386,7 @@
 
         // axisServiceGroup is not usable until the meta data has been reconciled
         axisServiceGroup = null;
-
-        ObjectStateUtils.readString(in, "ServiceGroupContext.axisServiceGroup");
-
-        boolean metaAxisServiceGrpIsActive = in.readBoolean();
-
-        if (metaAxisServiceGrpIsActive == ObjectStateUtils.ACTIVE_OBJECT) {
-            metaAxisServiceGroup = (MetaDataEntry) ObjectStateUtils
-                    .readObject(in, "ServiceGroupContext.metaAxisServiceGroup");
-        } else {
-            metaAxisServiceGroup = null;
-        }
+        metaAxisServiceGroup = (MetaDataEntry) in.readObject();
 
         //---------------------------------------------------------
         // parent 
@@ -457,9 +431,10 @@
 
         // We previously saved metaAxisServiceGroup; restore it
         if (metaAxisServiceGroup != null) {
-            axisServiceGroup = ObjectStateUtils.findServiceGroup(axisConfig,
-                                                                 metaAxisServiceGroup.getClassName(),
-                                                                 metaAxisServiceGroup.getQNameAsString());
+            axisServiceGroup = 
+                ActivateUtils.findServiceGroup(axisConfig,
+                                               metaAxisServiceGroup.getClassName(),
+                                               metaAxisServiceGroup.getQNameAsString());
         } else {
             axisServiceGroup = null;
         }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/SessionContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/SessionContext.java?rev=577367&r1=577366&r2=577367&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/SessionContext.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/SessionContext.java Wed Sep 19 09:56:47 2007
@@ -21,10 +21,13 @@
 package org.apache.axis2.context;
 
 import org.apache.axis2.AxisFault;
+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.context.externalize.SafeSerializable;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.engine.DependencyManager;
-import org.apache.axis2.util.ObjectStateUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -35,13 +38,13 @@
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Iterator;
-import java.util.Map;
 
 /**
  * All the engine components are stateless across the executions and all the states should be kept in the
  * Contexts, there are three context Global, Session and Message.
  */
-public class SessionContext extends AbstractContext implements Externalizable {
+public class SessionContext extends AbstractContext 
+    implements Externalizable, SafeSerializable {
 
     /**
      * @serial The serialization version ID tracks the version of the class.
@@ -62,9 +65,9 @@
      * Refer to the writeExternal() and readExternal() methods.
      */
     // supported revision levels, add a new level to manage compatible changes
-    private static final int REVISION_1 = 1;
+    private static final int REVISION_2 = 2;
     // current revision level of this object
-    private static final int revisionID = REVISION_1;
+    private static final int revisionID = REVISION_2;
 
 
     // TODO: investigate whether these collections need to be saved
@@ -180,7 +183,8 @@
      * @param out The stream to write the object contents to
      * @throws IOException
      */
-    public void writeExternal(ObjectOutput out) throws IOException {
+    public void writeExternal(ObjectOutput o) throws IOException {
+        SafeObjectOutputStream out = SafeObjectOutputStream.install(o);
         // write out contents of this object
 
         // NOTES: For each item, where appropriate,
@@ -207,29 +211,17 @@
         out.writeLong(getLastTouchedTime());
 
         out.writeLong(sessionContextTimeoutInterval);
-
-        ObjectStateUtils.writeString(out, cookieID, "SessionContext.cookieID");
+        out.writeObject(cookieID);
 
         //---------------------------------------------------------
         // properties
         //---------------------------------------------------------
-        Map tmpMap = getProperties();
-
-        HashMap tmpHashMap = null;
-
-        if ((tmpMap != null) && (!tmpMap.isEmpty())) {
-            tmpHashMap = new HashMap(tmpMap);
-        }
-
-        ObjectStateUtils.writeHashMap(out, tmpHashMap, "SessionContext.properties");
+        out.writeMap(getProperties());
 
         //---------------------------------------------------------
         // "nested"
         //---------------------------------------------------------
-
-        // Options parent
-        ObjectStateUtils.writeObject(out, parent, "SessionContext.parent");
-
+        out.writeObject(parent);
 
     }
 
@@ -246,7 +238,8 @@
      * @throws IOException
      * @throws ClassNotFoundException
      */
-    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+    public void readExternal(ObjectInput inObject) throws IOException, ClassNotFoundException {
+        SafeObjectInputStream in = SafeObjectInputStream.install(inObject);
         // trace point
         if (log.isTraceEnabled()) {
             log.trace(myClassName + ":readExternal():  BEGIN  bytes available in stream [" +
@@ -261,12 +254,12 @@
 
         // make sure the object data is in a version we can handle
         if (suid != serialVersionUID) {
-            throw new ClassNotFoundException(ObjectStateUtils.UNSUPPORTED_SUID);
+            throw new ClassNotFoundException(ExternalizeConstants.UNSUPPORTED_SUID);
         }
 
         // make sure the object data is in a revision level we can handle
-        if (revID != REVISION_1) {
-            throw new ClassNotFoundException(ObjectStateUtils.UNSUPPORTED_REVID);
+        if (revID != REVISION_2) {
+            throw new ClassNotFoundException(ExternalizeConstants.UNSUPPORTED_REVID);
         }
 
         //---------------------------------------------------------
@@ -276,32 +269,19 @@
         setLastTouchedTime(time);
 
         sessionContextTimeoutInterval = in.readLong();
-
-        cookieID = ObjectStateUtils.readString(in, "SessionContext.cookieID");
+        cookieID = (String) in.readObject();
 
         //---------------------------------------------------------
         // properties
         //---------------------------------------------------------
-
-        HashMap tmpHashMap = ObjectStateUtils.readHashMap(in, "SessionContext.properties");
-
-        properties = new HashMap();
-        if (tmpHashMap != null) {
-            setProperties(tmpHashMap);
-        }
+        properties = in.readHashMap();
 
         //---------------------------------------------------------
         // "nested"
         //---------------------------------------------------------
 
         // parent
-        Object tmpParent = ObjectStateUtils.readObject(in, "SessionContext.parent");
-
-        if (tmpParent != null) {
-            parent = (AbstractContext) tmpParent;
-        } else {
-            parent = null;
-        }
+        parent = (AbstractContext) in.readObject();
 
         //---------------------------------------------------------
         // done

Added: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/externalize/ActivateUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/externalize/ActivateUtils.java?rev=577367&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/externalize/ActivateUtils.java (added)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/externalize/ActivateUtils.java Wed Sep 19 09:56:47 2007
@@ -0,0 +1,645 @@
+/*
+ * Copyright 2004,2007 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      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 "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.context.externalize;
+
+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.util.MetaDataEntry;
+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.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.Map;
+
+
+/**
+ * Some Externalize objects must be "activated" after they are read.
+ * Activation normally involves associating the object with objects in the current
+ * runtime.
+ * 
+ * ActivateUtils provides activation related utilities
+ */
+public class ActivateUtils {
+    
+    private static final Log log = LogFactory.getLog(ActivateUtils.class);
+    
+    /**
+     * Private Constructor
+     * All methods in ActivateUtils are static.
+     */
+    private ActivateUtils() {}
+
+    /**
+     * 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 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 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 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;
+    }
+    
+    /**
+     * 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;
+        }
+    }
+    
+    /**
+     * 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;
+        }
+    }
+
+}

Added: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/externalize/DebugObjectInput.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/externalize/DebugObjectInput.java?rev=577367&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/externalize/DebugObjectInput.java (added)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/externalize/DebugObjectInput.java Wed Sep 19 09:56:47 2007
@@ -0,0 +1,198 @@
+/*
+ * Copyright 2004,2007 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      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 "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.context.externalize;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectStreamConstants;
+
+/**
+ * DebugObjectInput delegates to an ObjectInput object.
+ * Each method logs in/out trace information.
+ */
+public class DebugObjectInput implements ObjectInput, ObjectStreamConstants {
+    
+    private static final Log log = LogFactory.getLog(DebugObjectInput.class);
+    private static final boolean isDebug = log.isDebugEnabled();
+    ObjectInput oi; // delegate
+
+    public DebugObjectInput(ObjectInput oi) {
+        super();
+        this.oi = oi;
+    }
+
+    public int available() throws IOException {
+        trace("start available()");
+        int value = oi.available();
+        trace("end available() =" + value);
+        return value;
+    }
+
+    public void close() throws IOException {
+        trace("start close()");
+        oi.close();
+        trace("end close()");
+    }
+
+    public int read() throws IOException {
+        trace("start read()");
+        int value = oi.read();
+        trace("end read()=" + value);
+        return value;
+    }
+
+    public int read(byte[] b, int off, int len) throws IOException {
+        trace("start read(b, off, len) off=" + off + " len="+len);
+        int value = oi.read(b, off, len);
+        trace("end read(b,off,len)=" + value);
+        return value;
+    }
+
+    public int read(byte[] b) throws IOException {
+        trace("start read(b) b.length=" + b.length);
+        int value = oi.read(b);
+        trace("end read(b)=" + value);
+        return value;
+    }
+
+    public boolean readBoolean() throws IOException {
+        trace("start readBoolean()");
+        boolean value = oi.readBoolean();
+        trace("end readBoolean()=" + value);
+        return value;
+    }
+
+    public byte readByte() throws IOException {
+        trace("start readByte");
+        byte value = oi.readByte();
+        trace("end readByte()=" + value);
+        return value;
+    }
+
+    public char readChar() throws IOException {
+        trace("start readChar");
+        char value = oi.readChar();
+        trace("end readChar()=" + value);
+        return value;
+    }
+
+    public double readDouble() throws IOException {
+        trace("start readDouble");
+        double value = oi.readDouble();
+        trace("end readDouble()=" + value);
+        return value;
+    }
+
+    public float readFloat() throws IOException {
+        trace("start readFloat");
+        float value = oi.readFloat();
+        trace("end readFloat()=" + value);
+        return value;
+    }
+
+    public void readFully(byte[] b, int off, int len) throws IOException {
+        trace("start readFully(b,off,len) off=" + off + " len="+len);
+        oi.readFully(b, off, len);
+        trace("end readFully(b,off,len)");
+    }
+
+    public void readFully(byte[] b) throws IOException {
+        trace("start readFully(b) b.length="+ b.length);
+        oi.readFully(b);
+        trace("end readFully(b)");
+    }
+
+    public int readInt() throws IOException {
+        trace("start readInt()");
+        int value = oi.readInt();
+        trace("end readInt()="+ value);
+        return value;
+    }
+
+    public String readLine() throws IOException {
+        trace("start readLine()");
+        String value = oi.readLine();
+        trace("end readLine()="+ value);
+        return value;
+    }
+
+    public long readLong() throws IOException {
+        trace("start readLong()");
+        long value = oi.readLong();
+        trace("end readLong()="+ value);
+        return value;
+    }
+
+    public Object readObject() throws ClassNotFoundException, IOException {
+        trace("start readObject()");
+        Object value = oi.readObject();
+        
+        trace("end readObject()="+ value);
+        return value;
+    }
+
+    public short readShort() throws IOException {
+        trace("start readShort()");
+        short value = oi.readShort();
+        trace("end readShort()="+ value);
+        return value;
+    }
+
+    public int readUnsignedByte() throws IOException {
+        trace("start readLong()");
+        int value = oi.readUnsignedByte();
+        trace("end readUnsignedByte()="+ value);
+        return value;
+    }
+
+    public int readUnsignedShort() throws IOException {
+        trace("start readShort()");
+        int value = oi.readUnsignedShort();
+        trace("end readShort()="+ value);
+        return value;
+    }
+
+    public String readUTF() throws IOException {
+        trace("start readUTF()");
+        String value = oi.readUTF();
+        trace("end readUTF()="+ value);
+        return value;
+    }
+
+    public long skip(long n) throws IOException {
+        trace("start skip(n) n="+n);
+        long value = oi.skip(n);
+        trace("end skip(n)="+ value);
+        return value;
+    }
+
+    public int skipBytes(int n) throws IOException {
+        trace("start skipBytes(n) n="+n);
+        int value = oi.skipBytes(n);
+        trace("end skipBytes(n)="+ value);
+        return value;
+    }
+    
+    public void trace(String str) {
+        if (isDebug) {
+            log.debug(str);
+        }
+    }
+    
+}

Added: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/externalize/DebugObjectOutputStream.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/externalize/DebugObjectOutputStream.java?rev=577367&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/externalize/DebugObjectOutputStream.java (added)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/externalize/DebugObjectOutputStream.java Wed Sep 19 09:56:47 2007
@@ -0,0 +1,156 @@
+/*
+ * Copyright 2004,2007 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      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 "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.context.externalize;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.io.Closeable;
+import java.io.Flushable;
+import java.io.IOException;
+import java.io.ObjectOutput;
+import java.io.ObjectStreamConstants;
+
+/**
+ * DebugObjectOutputStream delegates to an ObjectOutput object.
+ * Each method logs in/out trace information
+ */
+public class DebugObjectOutputStream implements ObjectStreamConstants, ObjectOutput, Closeable,
+        Flushable {
+    private static final Log log = LogFactory.getLog(DebugObjectOutputStream.class);
+    private static final boolean isDebug = log.isDebugEnabled();
+    ObjectOutput out;
+    
+    DebugObjectOutputStream(ObjectOutput out) throws IOException {
+        super();
+        trace("--START DebugOutputStream--");
+        this.out = out;
+    }
+
+    public void close() throws IOException {
+        trace("--CLOSE DebugOutputStream--");
+        out.close();
+    }
+
+    public void flush() throws IOException {
+        trace ("start flush()");
+        out.flush();
+        trace ("end flush()");
+    }
+
+    public void write(byte[] b, int off, int len) throws IOException {
+        trace ("start write(b, off, len) off=" + off + " len=" + len);
+        if (len > 4) {
+            trace (" first four bytes = '" + 
+                   b[off] + "' '" + 
+                   b[off+1] + "' '" +
+                   b[off+2] + "' '" +
+                   b[off+3] + "'");
+        }
+        out.write(b, off, len);
+        trace ("end write(b, off, len)");
+    }
+
+    public void write(byte[] b) throws IOException {
+        trace ("start write(byte) byte=" + b);
+        out.write(b);
+        trace ("end write(b)");
+    }
+
+    public void write(int b) throws IOException {
+        trace ("start write(int) int=" + b);
+        out.write(b);
+        trace ("end write(int)");
+    }
+
+    public void writeBoolean(boolean v) throws IOException {
+        trace ("start writeBoolean(v) v=" + v);
+        out.writeBoolean(v);
+        trace ("end writeBoolean(v)");
+    }
+
+    public void writeByte(int v) throws IOException {
+        trace ("start writeByte(v) v=" + v);
+        out.writeByte(v);
+        trace ("end writeByte(v)");
+    }
+
+    public void writeBytes(String s) throws IOException {
+        trace ("start writeBytes(s) s=" + s);
+        out.writeBytes(s);
+        trace ("end writeBytes(s)");
+    }
+
+    public void writeChar(int v) throws IOException {
+        trace ("start writeChar(v) v=" + v);
+        out.writeChar(v);
+        trace ("end writeChar(v)");
+    }
+
+    public void writeChars(String s) throws IOException {
+        trace ("start writeChars(s) s=" + s);
+        out.writeChars(s);
+        trace ("end writeChars(s)");
+    }
+
+    public void writeDouble(double v) throws IOException {
+        trace ("start writeDouble(v) v=" + v);
+        out.writeDouble(v);
+        trace ("end writeDouble(v)");
+    }
+
+    public void writeFloat(float v) throws IOException {
+        trace ("start writeFloat(v) v=" + v);
+        out.writeFloat(v); 
+        trace ("end writeFloat(v)");
+    }
+
+    public void writeInt(int v) throws IOException {
+        trace ("start writeInt(v) v=" + v);
+        out.writeInt(v);
+        trace ("end writeInt(v)");
+    }
+
+    public void writeLong(long v) throws IOException {
+        trace ("start writeLong(v) v=" + v);
+        out.writeLong(v);
+        trace ("end writeLong(v)");
+    }
+
+    public void writeObject(Object obj) throws IOException {
+        trace ("start writeObject(v) v=" + obj);
+        out.writeObject(obj);
+        trace ("end writeObject(v)");
+    }
+
+    public void writeShort(int v) throws IOException {
+        trace ("start writeShort(v) v=" + v);
+        out.writeShort(v);
+        trace ("end writeShort(v)");
+    }
+
+    public void writeUTF(String str) throws IOException {
+        trace ("start writeUTF(v) v=" + str);
+        out.writeUTF(str);
+        trace ("end writeUTF(v)");
+    }
+    
+    public void trace(String str) {
+        if (isDebug) {
+            log.debug(str);
+        }
+    }
+}

Added: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/externalize/ExternalizeConstants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/externalize/ExternalizeConstants.java?rev=577367&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/externalize/ExternalizeConstants.java (added)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/externalize/ExternalizeConstants.java Wed Sep 19 09:56:47 2007
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2004,2007 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      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 "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.context.externalize;
+
+/**
+ * Common Externalize Constants
+ */
+public interface ExternalizeConstants {
+    
+    // Objects are preceeded by a bit indicating if the object is empty or active
+    public static final boolean EMPTY_OBJECT = false;  // null object or empty object
+    public static final boolean ACTIVE_OBJECT = true;  // otherwise it is an active object
+    
+    // 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";
+    
+    //  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.";
+
+}



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