ws-sandesha-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gatf...@apache.org
Subject svn commit: r587457 - in /webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2: util/SandeshaUtil.java workers/SandeshaThread.java workers/SenderWorker.java
Date Tue, 23 Oct 2007 11:12:48 GMT
Author: gatfora
Date: Tue Oct 23 04:12:47 2007
New Revision: 587457

URL: http://svn.apache.org/viewvc?rev=587457&view=rev
Log:
If a SandeshaThread is stopped, we can't then restart it using Thread.start().  Also, change
errors to debug and remove an unused method from SandeshaUtil

Modified:
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/SandeshaUtil.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/workers/SandeshaThread.java
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/workers/SenderWorker.java

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/SandeshaUtil.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/SandeshaUtil.java?rev=587457&r1=587456&r2=587457&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/SandeshaUtil.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/SandeshaUtil.java
Tue Oct 23 04:12:47 2007
@@ -25,8 +25,6 @@
 import java.util.Map;
 
 import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
 
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.util.CopyUtils;
@@ -36,7 +34,6 @@
 import org.apache.axiom.soap.SOAPFactory;
 import org.apache.axiom.soap.SOAPHeader;
 import org.apache.axiom.soap.SOAPHeaderBlock;
-import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
 import org.apache.axis2.addressing.AddressingConstants;
@@ -1003,75 +1000,6 @@
 		copyConfiguredProperties(oldMsg,newMsg);
 		return newMsg;
 		
-	}
-	
-	public static SOAPEnvelope cloneEnvelope(SOAPEnvelope envelope)
-	        throws SandeshaException
-	{
-
-		// Now clone the env and set it in the message context. We need to be
-		// sure that we
-		// close off the stream reader, in order to free up some of the heap.
-		XMLStreamReader streamReader = null;
-		SOAPEnvelope clonedEnvelope = null;
-		try
-		{
-			streamReader = envelope.getXMLStreamReader();
-			clonedEnvelope = new StAXSOAPModelBuilder(streamReader, null)
-			        .getSOAPEnvelope();
-			// you have to explicitely set the 'processed' attribute for header
-			// blocks, since it get lost in the above read from the stream.
-
-			SOAPHeader header = envelope.getHeader();
-			if (header != null)
-			{
-				Iterator childrenOfOldEnv = header.getChildElements();
-				Iterator childrenOfNewEnv = clonedEnvelope.getHeader()
-				        .getChildElements();
-				while (childrenOfOldEnv.hasNext())
-				{
-					SOAPHeaderBlock oldEnvHeaderBlock = (SOAPHeaderBlock) childrenOfOldEnv
-					        .next();
-					SOAPHeaderBlock newEnvHeaderBlock = (SOAPHeaderBlock) childrenOfNewEnv
-					        .next();
-
-					QName oldEnvHeaderBlockQName = oldEnvHeaderBlock.getQName();
-					if (oldEnvHeaderBlockQName != null)
-					{
-						if (oldEnvHeaderBlockQName.equals(newEnvHeaderBlock
-						        .getQName()))
-						{
-							if (oldEnvHeaderBlock.isProcessed())
-								newEnvHeaderBlock.setProcessed();
-						}
-						else
-						{
-							String message = SandeshaMessageHelper
-							        .getMessage(SandeshaMessageKeys.cloneDoesNotMatchToOriginal);
-							throw new SandeshaException(message);
-						}
-					}
-				}
-			}
-			// Completely build the new tree
-			clonedEnvelope.build();
-		}
-		finally
-		{
-			if (streamReader != null)
-			{
-				try
-				{
-					streamReader.close();
-				}
-				catch (XMLStreamException e)
-				{
-					log.debug("Caught exception closing stream", e);
-				}
-			}
-
-		}
-		return clonedEnvelope;
 	}
 
 	/** 

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/workers/SandeshaThread.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/workers/SandeshaThread.java?rev=587457&r1=587456&r2=587457&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/workers/SandeshaThread.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/workers/SandeshaThread.java
Tue Oct 23 04:12:47 2007
@@ -131,8 +131,6 @@
 					//ignore
 				}
 			}
-			
-			stopRequested = false;
 		}
 		
     // In a unit test, tracing 'this' once the thread was stopped caused
@@ -192,6 +190,8 @@
 		} else if (!stopRequested){
 			if(log.isDebugEnabled()) log.debug("Waking thread");
 			wakeThread();
+		} else if (stopRequested) {
+			if(log.isDebugEnabled()) log.debug("Can't start thread as it has been stopped");
 		}
 
 		if(log.isDebugEnabled()) log.debug("Exit: SandeshaThread::runThreadForSequence");

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/workers/SenderWorker.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/workers/SenderWorker.java?rev=587457&r1=587456&r2=587457&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/workers/SenderWorker.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/workers/SenderWorker.java
Tue Oct 23 04:12:47 2007
@@ -314,8 +314,8 @@
 				String message = SandeshaMessageHelper.getMessage(
 						SandeshaMessageKeys.sendMsgError, e.toString());
 				
-				if (log.isErrorEnabled())
-				  log.error(message, e);
+				if (log.isDebugEnabled())
+				  log.debug(message, e);
 				
 				recordError(e, rmMsgCtx, storageManager);
 				
@@ -598,10 +598,10 @@
 					}
 				} catch (AxisFault e) {
 					//Cannot find a valid SOAP envelope.
-					if (log.isErrorEnabled() ) {
-						log.error (SandeshaMessageHelper
+					if (log.isDebugEnabled() ) {
+						log.debug (SandeshaMessageHelper
 								.getMessage(SandeshaMessageKeys.soapEnvNotSet));
-					log.error ("Caught exception", e);
+					log.debug ("Caught exception", e);
 					}
 				
 					return;



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


Mime
View raw message