Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 38825 invoked from network); 11 Jul 2008 16:09:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Jul 2008 16:09:34 -0000 Received: (qmail 66264 invoked by uid 500); 11 Jul 2008 16:09:34 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 66143 invoked by uid 500); 11 Jul 2008 16:09:33 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 66134 invoked by uid 500); 11 Jul 2008 16:09:33 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 66131 invoked by uid 99); 11 Jul 2008 16:09:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Jul 2008 09:09:33 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Jul 2008 16:08:49 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id CA03923889F1; Fri, 11 Jul 2008 09:09:12 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r676011 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java Date: Fri, 11 Jul 2008 16:09:12 -0000 To: axis2-cvs@ws.apache.org From: barrettj@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080711160912.CA03923889F1@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: barrettj Date: Fri Jul 11 09:09:12 2008 New Revision: 676011 URL: http://svn.apache.org/viewvc?rev=676011&view=rev Log: Add support for reading in streams persisted with inbound and outbound executed phases. Add logging for markers as they are read. Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java?rev=676011&r1=676010&r2=676011&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java (original) +++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java Fri Jul 11 09:09:12 2008 @@ -2839,7 +2839,11 @@ currentPhaseIndex = 0; metaExecutionChain = null; - in.readUTF(); + String marker = in.readUTF(); + if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) { + log.trace(getLogIDString() + + ": readExternal(): About to read executionChain, marker is: " + marker); + } boolean gotChain = in.readBoolean(); if (gotChain == ExternalizeConstants.ACTIVE_OBJECT) { @@ -2923,6 +2927,14 @@ //--------------------------------------------------------- // LinkedList executedPhases + // + // Note that in previous versions of Axis2, this was + // represented by two lists: "inboundExecutedPhases", "outboundExecutedPhases", + // however since the message context itself represents a flow + // direction, one of these lists was always null. This was changed + // around 2007-06-08 revision r545615. For backward compatability + // with streams saved in previous versions of Axis2, we need + // to be able to process both the old style and new style. //--------------------------------------------------------- // Restore the metadata about each member of the list // and the order of the list. @@ -2950,9 +2962,40 @@ executedPhases = null; metaExecuted = null; - in.readUTF(); + marker = in.readUTF(); + if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) { + log.trace(getLogIDString() + + ": readExternal(): About to read executedPhases, marker is: " + marker); + } + + // Previous versions of Axis2 saved two phases in the stream, although one should + // always have been null. The two phases and their associated markers are, in this order: + // "inboundExecutedPhases", "outboundExecutedPhases". boolean gotInExecList = in.readBoolean(); - + boolean oldStyleExecutedPhases = false; + if (marker.equals("inboundExecutedPhases")) { + oldStyleExecutedPhases = true; + } + + if (oldStyleExecutedPhases && (gotInExecList == ExternalizeConstants.EMPTY_OBJECT)) { + // There are an inboundExecutedPhases and an outboundExecutedPhases and this one + // is empty, so skip over it and read the next one + marker = in.readUTF(); + if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) { + log.trace(getLogIDString() + + ": readExternal(): Skipping over oldStyle empty inboundExecutedPhases"); + log.trace(getLogIDString() + + ": readExternal(): About to read executedPhases, marker is: " + marker); + } + gotInExecList = in.readBoolean(); + } + + /* + * At this point, the stream should point to either "executedPhases" if this is the + * new style of serialization. If it is the oldStyle, it should point to whichever + * of "inbound" or "outbound" executed phases contains an active object, since only one + * should + */ if (gotInExecList == ExternalizeConstants.ACTIVE_OBJECT) { int expectedNumberInExecList = in.readInt(); @@ -3022,18 +3065,44 @@ adjustedNumberInExecList + "] "); } } - + if ((metaExecuted == null) || (metaExecuted.isEmpty())) { if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) { log.trace(getLogIDString() + ":readExternal(): meta data for executedPhases list is NULL"); } } + + marker = in.readUTF(); // Read marker + if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) { + log.trace(getLogIDString() + + ": readExternal(): After reading executedPhases, marker is: " + marker); + } + + // If this is an oldStyle that contained both an inbound and outbound executed phases, + // and the outbound phases wasn't read above, then we need to skip over it + if (marker.equals("outboundExecutedPhases")) { + Boolean gotOutExecList = in.readBoolean(); + if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) { + log.trace(getLogIDString() + + ": readExternal(): Skipping over outboundExecutedPhases, marker is: " + marker + + ", is list an active object: " + gotOutExecList); + } + if (gotOutExecList != ExternalizeConstants.EMPTY_OBJECT) { + throw new IOException("Both inboundExecutedPhases and outboundExecutedPhases had active objects"); + } + + marker = in.readUTF(); + if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) { + log.trace(getLogIDString() + + ": readExternal(): After skipping ooutboundExecutePhases, marker is: " + marker); + } + } //--------------------------------------------------------- // options //--------------------------------------------------------- - in.readUTF(); // Read marker + options = (Options) in.readObject(); if (options != null) { @@ -3049,12 +3118,20 @@ // axisOperation is not usable until the meta data has been reconciled axisOperation = null; - in.readUTF(); // Read Marker + marker = in.readUTF(); // Read Marker + if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) { + log.trace(getLogIDString() + + ": readExternal(): About to read axisOperation, marker is: " + marker); + } metaAxisOperation = (MetaDataEntry) in.readObject(); // operation context is not usable until it has been activated // NOTE: expect this to be the parent - in.readUTF(); // Read marker + marker = in.readUTF(); // Read marker + if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) { + log.trace(getLogIDString() + + ": readExternal(): About to read operationContext, marker is: " + marker); + } operationContext = (OperationContext) in.readObject(); if (operationContext != null) { @@ -3070,7 +3147,11 @@ // axisService is not usable until the meta data has been reconciled axisService = null; - in.readUTF(); // Read marker + marker = in.readUTF(); // Read marker + if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) { + log.trace(getLogIDString() + + ": readExternal(): About to read axisService, marker is: " + marker); + } metaAxisService = (MetaDataEntry) in.readObject(); //------------------------- @@ -3081,7 +3162,11 @@ //------------------------- // serviceContext //------------------------- - in.readUTF(); // Read marker + marker = in.readUTF(); // Read marker + if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) { + log.trace(getLogIDString() + + ": readExternal(): About to read serviceContext, marker is: " + marker); + } boolean servCtxActive = in.readBoolean(); @@ -3110,7 +3195,11 @@ // axisServiceGroup is not usable until the meta data has been reconciled axisServiceGroup = null; - in.readUTF(); // Read marker + marker = in.readUTF(); // Read marker + if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) { + log.trace(getLogIDString() + + ": readExternal(): About to read AxisServiceGroup, marker is: " + marker); + } metaAxisServiceGroup = (MetaDataEntry) in.readObject(); //----------------------------- @@ -3121,7 +3210,11 @@ //----------------------------- // serviceGroupContext //----------------------------- - in.readUTF(); + marker = in.readUTF(); + if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) { + log.trace(getLogIDString() + + ": readExternal(): About to read ServiceGroupContext, marker is: " + marker); + } boolean servGrpCtxActive = in.readBoolean(); @@ -3150,7 +3243,11 @@ // axisMessage is not usable until the meta data has been reconciled axisMessage = null; - in.readUTF(); // Read marker + marker = in.readUTF(); // Read marker + if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) { + log.trace(getLogIDString() + + ": readExternal(): About to read AxisMessage, marker is: " + marker); + } metaAxisMessage = (MetaDataEntry) in.readObject(); reconcileAxisMessage = (metaAxisMessage != null); @@ -3193,14 +3290,22 @@ // properties //--------------------------------------------------------- // read local properties - in.readUTF(); // Read marker + marker = in.readUTF(); // Read marker + if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) { + log.trace(getLogIDString() + + ": readExternal(): About to read properties, marker is: " + marker); + } properties = in.readHashMap(); //--------------------------------------------------------- // special data //--------------------------------------------------------- - in.readUTF(); // Read marker + marker = in.readUTF(); // Read marker + if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) { + log.trace(getLogIDString() + + ": readExternal(): About to read SpecialData, marker is: " + marker); + } boolean gotSelfManagedData = in.readBoolean();