axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prad...@apache.org
Subject svn commit: r582501 [5/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...
Date Sat, 06 Oct 2007 14:53:12 GMT
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/OperationContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/OperationContext.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/OperationContext.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/OperationContext.java Sat Oct  6 07:53:06 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/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ServiceContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ServiceContext.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ServiceContext.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ServiceContext.java Sat Oct  6 07:53:06 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/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ServiceGroupContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ServiceGroupContext.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ServiceGroupContext.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ServiceGroupContext.java Sat Oct  6 07:53:06 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/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/SessionContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/SessionContext.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/SessionContext.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/SessionContext.java Sat Oct  6 07:53:06 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

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/description/Parameter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/description/Parameter.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/description/Parameter.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/description/Parameter.java Sat Oct  6 07:53:06 2007
@@ -18,12 +18,16 @@
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.axis2.util.ObjectStateUtils;
+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.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamReader;
+
 import java.io.ByteArrayInputStream;
 import java.io.Externalizable;
 import java.io.IOException;
@@ -34,7 +38,7 @@
 /**
  * Class Parameter
  */
-public class Parameter implements Externalizable {
+public class Parameter implements Externalizable, SafeSerializable {
 
     /*
      * setup for logging
@@ -62,9 +66,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;
 
 
     /**
@@ -261,7 +265,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
 
         //---------------------------------------------------------
@@ -281,8 +286,7 @@
 
         out.writeInt(type);
         out.writeBoolean(locked);
-
-        ObjectStateUtils.writeString(out, name, "Parameter.name");
+        out.writeObject(name);
 
         //---------------------------------------------------------
         // object fields
@@ -297,13 +301,8 @@
         if (parameterElement != null) {
             tmp = parameterElement.toString();
         }
-
-        // treat as an object, don't do UTF
-        ObjectStateUtils.writeObject(out, tmp, "Parameter.parameterElement");
-
-        // TODO: error handling if this can't be serialized
-        ObjectStateUtils.writeObject(out, value, "Parameter.value");
-
+        out.writeObject(tmp); // parameterElement
+        out.writeObject(value);
     }
 
 
@@ -318,7 +317,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 [" +
@@ -333,12 +333,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);
         }
 
         //---------------------------------------------------------
@@ -347,8 +347,7 @@
 
         type = in.readInt();
         locked = in.readBoolean();
-
-        name = ObjectStateUtils.readString(in, "Parameter.name");
+        name = (String) in.readObject();
 
         //---------------------------------------------------------
         // object fields
@@ -359,7 +358,7 @@
         // to a String but will build the OMTree in the memory
 
         // treat as an object, don't do UTF
-        String tmp = (String) ObjectStateUtils.readObject(in, "Parameter.parameterElement");
+        String tmp = (String) in.readObject();
 
         // convert to an OMElement
         if (tmp != null) {
@@ -389,7 +388,7 @@
         }
 
         // TODO: error handling if this can't be serialized
-        value = ObjectStateUtils.readObject(in, "Parameter.value");
+        value = in.readObject();
 
         //---------------------------------------------------------
         // done

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/description/ParameterIncludeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/description/ParameterIncludeImpl.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/description/ParameterIncludeImpl.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/description/ParameterIncludeImpl.java Sat Oct  6 07:53:06 2007
@@ -23,12 +23,16 @@
 import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMElement;
 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.deployment.DeploymentConstants;
-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;
@@ -41,7 +45,8 @@
 /**
  * Class ParameterIncludeImpl
  */
-public class ParameterIncludeImpl implements ParameterInclude, Externalizable {
+public class ParameterIncludeImpl 
+    implements ParameterInclude, Externalizable, SafeSerializable {
 
     /*
      * setup for logging
@@ -69,9 +74,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;
 
 
     /**
@@ -204,7 +209,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
 
         //---------------------------------------------------------
@@ -221,7 +227,7 @@
         //---------------------------------------------------------
         // collection of parameters
         //---------------------------------------------------------
-        ObjectStateUtils.writeHashMap(out, parameters, "ParameterIncludeImpl.parameters");
+        out.writeMap(parameters);
 
     }
 
@@ -237,7 +243,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 [" +
@@ -252,35 +259,22 @@
 
         // 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);
         }
 
         //---------------------------------------------------------
         // collection of parameters
         //---------------------------------------------------------
-
-        HashMap tmp = ObjectStateUtils.readHashMap(in, "ParameterIncludeImpl.parameters");
-
-        if (tmp != null) {
-            if (parameters != null) {
-                parameters.putAll(tmp);
-            } else {
-                if (log.isTraceEnabled()) {
-                    log.trace(myClassName +
-                            ":readExternal():  WARNING: parameters doesnot have a defined HashMap ");
-                }
-            }
-        }
+        in.readMap(parameters);
 
         //---------------------------------------------------------
         // done
         //---------------------------------------------------------
-
     }
 
 }

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java Sat Oct  6 07:53:06 2007
@@ -858,7 +858,7 @@
             for (Iterator valuesIter = values.iterator(); valuesIter.hasNext();) {
                 wsdlImport = (Import) valuesIter.next();
                 Definition innerDefinition = wsdlImport.getDefinition();
-                if(stack.contains(innerDefinition)){
+                if(!stack.contains(innerDefinition)){
                     // find the binding recursively
                     portType = getPortType(portTypeQName, innerDefinition, stack);
                     if (portType != null) {
@@ -1370,7 +1370,7 @@
         while (faultKeyIterator.hasNext()) {
             Fault fault = (Fault) faults.get(faultKeyIterator.next());
             AxisMessage axisFaultMessage = new AxisMessage();
-
+            addDocumentation(axisFaultMessage,fault.getDocumentationElement());
             Message faultMessage = fault.getMessage();
             if (null != faultMessage) {
                 axisFaultMessage
@@ -2136,19 +2136,6 @@
                         }
                     }
 
-                } else if (AddressingConstants.Final.WSAW_ANONYMOUS
-                        .equals(unknown.getElementType())) {
-                    if (originOfExtensibilityElements.equals(BINDING_OPERATION)) {
-                        AxisOperation axisOperation = (AxisOperation) description;
-                        if (unknown.getElement().getFirstChild() != null
-                            && unknown.getElement().getFirstChild()
-                                .getNodeType() == Node.TEXT_NODE) {
-                            String anonymousValue = unknown.getElement()
-                                    .getFirstChild().getNodeValue();
-                            AddressingHelper.setAnonymousParameterValue(
-                                    axisOperation, anonymousValue);
-                        }
-                    }
                 }    else if (wsdl4jExtensibilityElement.getElementType() != null &&
                         wsdl4jExtensibilityElement.getElementType().getNamespaceURI().equals(
                                 org.apache.axis2.namespace.Constants.FORMAT_BINDING)) {

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java Sat Oct  6 07:53:06 2007
@@ -812,6 +812,17 @@
         return transportsOut;
     }
 
+    /**
+     * This method needs to remain for a few Axis2 releases to support
+     * legacy apps still using it.
+     * 
+     * @param qname
+     * @deprecated Use {@link #isEngaged(String)}
+     */
+    public boolean isEngaged(QName qname) {
+        return isEngaged(qname.getLocalPart());
+    }
+    
     public boolean isEngaged(String moduleId) {
         AxisModule module = getModule(moduleId);
         if (module == null) {

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java Sat Oct  6 07:53:06 2007
@@ -158,13 +158,19 @@
                                 "The incoming MessageContext is removed, " +
                                 "and the OperationContext is marked as incomplete");
                 }
-                String mepURI  = msgContext.getAxisOperation().getMessageExchangePattern();
-                if (WSDL2Constants.MEP_URI_OUT_IN.equals(mepURI)) {
-                    OperationContext opCtx = msgContext.getOperationContext();
-                    if (opCtx != null) {
-                        opCtx.removeMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
-                    }
-                }
+				AxisOperation axisOp = msgContext.getAxisOperation();
+                if(axisOp!=null){
+					String mepURI  = axisOp.getMessageExchangePattern();
+					if (WSDL2Constants.MEP_URI_OUT_IN.equals(mepURI)) {
+						OperationContext opCtx = msgContext.getOperationContext();
+						if (opCtx != null) {
+							opCtx.removeMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+						}
+					}
+				}
+				else{
+					log.debug("Could not clean up op ctx for " + msgContext);
+				}
                 return pi;
             } else {
                 String errorMsg =

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/modules/Module.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/modules/Module.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/modules/Module.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/modules/Module.java Sat Oct  6 07:53:06 2007
@@ -49,7 +49,7 @@
     /**
      * When engaging this module to some service or operation , module will be notify by calling this
      * method there module author can validate , add policy and do any thing that he want , and he can
-     * refuce the engage as well
+     * refuse the engage as well
      *
      * @param axisDescription
      * @throws AxisFault
@@ -57,7 +57,7 @@
     void engageNotify(AxisDescription axisDescription) throws AxisFault;
 
     /**
-     * Evalute whether it can support the specified assertion and returns true if the assertion can
+     * Evaluate whether it can support the specified assertion and returns true if the assertion can
      * be supported.
      *
      * @param assertion the assertion that the module must decide whether it can support or not.

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/HTTPWorker.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/HTTPWorker.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/HTTPWorker.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/HTTPWorker.java Sat Oct  6 07:53:06 2007
@@ -98,7 +98,8 @@
                             Iterator i = services.values().iterator();
                             while (i.hasNext()) {
                                 AxisService service = (AxisService) i.next();
-                                InputStream stream = service.getClassLoader().getResourceAsStream("META-INF/" + file);
+                                InputStream stream = service.getClassLoader().
+                                getResourceAsStream("META-INF/" + file);
                                 if (stream != null) {
                                     OutputStream out = response.getOutputStream();
                                     response.setContentType("text/xml");
@@ -300,20 +301,23 @@
         
         // Finalize response
         RequestResponseTransport requestResponseTransportControl =
-            (RequestResponseTransport) msgContext.getProperty(RequestResponseTransport.TRANSPORT_CONTROL);
+            (RequestResponseTransport) msgContext.
+            getProperty(RequestResponseTransport.TRANSPORT_CONTROL);
 
-        if (TransportUtils.isResponseWritten(msgContext)) {
-            if ((requestResponseTransportControl != null) 
-                    && 
-                    (requestResponseTransportControl.getStatus().equals(RequestResponseTransport.RequestResponseTransportStatus.SIGNALLED))) {
-                    response.setStatus(HttpStatus.SC_OK);
-            } 
+        if (TransportUtils.isResponseWritten(msgContext) ||
+            ((requestResponseTransportControl != null) &&
+             requestResponseTransportControl.getStatus().equals(
+                RequestResponseTransport.RequestResponseTransportStatus.SIGNALLED))) {
+            // The response is written or signalled.  The current status is used (probably SC_OK).
         } else {
+            // The response may be ack'd, mark the status as accepted.
             response.setStatus(HttpStatus.SC_ACCEPTED);
         }
     }
 
-    private boolean processInternalWSDL(String uri, ConfigurationContext configurationContext, String serviceName, AxisHttpResponse response) throws IOException {
+    private boolean processInternalWSDL(String uri, ConfigurationContext configurationContext, 
+                                        String serviceName, AxisHttpResponse response) 
+    throws IOException {
         String wsdlName = uri.substring(uri.lastIndexOf("=") + 1);
 
         HashMap services = configurationContext.getAxisConfiguration().getServices();

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/MetaDataEntry.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/MetaDataEntry.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/MetaDataEntry.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/MetaDataEntry.java Sat Oct  6 07:53:06 2007
@@ -19,6 +19,10 @@
 
 package org.apache.axis2.util;
 
+import org.apache.axis2.context.externalize.SafeObjectInputStream;
+import org.apache.axis2.context.externalize.SafeObjectOutputStream;
+import org.apache.axis2.context.externalize.SafeSerializable;
+
 import javax.xml.namespace.QName;
 import java.io.Externalizable;
 import java.io.IOException;
@@ -31,14 +35,14 @@
  * An internal class for holding a set of information
  * about an object.
  */
-public class MetaDataEntry implements Externalizable {
+public class MetaDataEntry implements Externalizable, SafeSerializable {
     // serialization identifier
     private static final long serialVersionUID = 8978361069526299875L;
 
     // 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;
 
     // data to keep on an object
 
@@ -252,7 +256,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
 
         //---------------------------------------------------------
@@ -269,10 +274,10 @@
         //---------------------------------------------------------
         // various simple fields
         //---------------------------------------------------------
-        ObjectStateUtils.writeString(out, className, "MetaDataEntry.className");
-        ObjectStateUtils.writeString(out, qnameAsString, "MetaDataEntry.qnameAsString");
-        ObjectStateUtils.writeString(out, extraName, "MetaDataEntry.extraName");
-        ObjectStateUtils.writeArrayList(out, children, "MetaDataEntry.list");
+        out.writeObject(className);
+        out.writeObject(qnameAsString);
+        out.writeObject(extraName);
+        out.writeList(children);
 
     }
 
@@ -288,7 +293,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);
 
         // serialization version ID
         long suid = in.readLong();
@@ -302,7 +308,7 @@
         }
 
         // make sure the object data is in a revision level we can handle
-        if (revID != REVISION_1) {
+        if (revID != REVISION_2) {
             throw new ClassNotFoundException(UNSUPPORTED_REVID);
         }
 
@@ -310,10 +316,10 @@
         // various simple fields
         //---------------------------------------------------------
 
-        className = ObjectStateUtils.readString(in, "MetaDataEntry.className");
-        qnameAsString = ObjectStateUtils.readString(in, "MetaDataEntry.qnameAsString");
-        extraName = ObjectStateUtils.readString(in, "MetaDataEntry.extraName");
-        children = ObjectStateUtils.readArrayList(in, "MetaDataEntry.list");
+        className = (String) in.readObject();
+        qnameAsString = (String) in.readObject();
+        extraName = (String) in.readObject();
+        children = in.readArrayList();
 
     }
 



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


Mime
View raw message