You are viewing a plain text version of this content. The canonical link for it is here.
Posted to sandesha-dev@ws.apache.org by ch...@apache.org on 2006/07/01 01:49:50 UTC

svn commit: r418421 - in /webservices/sandesha/trunk/java/src/org/apache/sandesha2: client/ handlers/ msgprocessors/ storage/ storage/inmemory/ util/ workers/

Author: chamikara
Date: Fri Jun 30 16:49:49 2006
New Revision: 418421

URL: http://svn.apache.org/viewvc?rev=418421&view=rev
Log:
Did corrections to the Fault Handling logic. Added a handleFault method to the InOrderInvoker.
Applied the patch from Andrew on 'Typos'

Modified:
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/client/SandeshaClient.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/handlers/SandeshaGlobalInHandler.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/AckRequestedProcessor.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/AcknowledgementProcessor.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/CloseSequenceProcessor.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/CreateSeqMsgProcessor.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/CreateSeqResponseMsgProcessor.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/TerminateSeqMsgProcessor.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/StorageManager.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemoryStorageManager.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/AcknowledgementManager.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/FaultManager.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/MsgInitializer.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/RMMsgCreator.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/SandeshaUtil.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/SequenceManager.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/TerminateManager.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/workers/InOrderInvoker.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/workers/Sender.java

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/client/SandeshaClient.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/client/SandeshaClient.java?rev=418421&r1=418420&r2=418421&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/client/SandeshaClient.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/client/SandeshaClient.java Fri Jun 30 16:49:49 2006
@@ -113,7 +113,7 @@
 		sequenceReport.setSequenceDirection(SequenceReport.SEQUENCE_DIRECTION_OUT);
 
 		StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configurationContext,configurationContext.getAxisConfiguration());
-		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
 		CreateSeqBeanMgr createSeqMgr = storageManager.getCreateSeqBeanMgr();
 
 		String withinTransactionStr = (String) configurationContext.getProperty(Sandesha2Constants.WITHIN_TRANSACTION);
@@ -235,7 +235,7 @@
 	public static SandeshaReport getSandeshaReport(ConfigurationContext configurationContext) throws SandeshaException {
 
 		StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configurationContext,configurationContext.getAxisConfiguration());
-		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
 		SandeshaReport sandeshaReport = new SandeshaReport();
 		SequencePropertyBean internalSequenceFindBean = new SequencePropertyBean();
 
@@ -572,7 +572,7 @@
 		}
 
 		StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configurationContext,configurationContext.getAxisConfiguration());
-		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
 
 		SequencePropertyBean sequenceIDBean = seqPropMgr.retrieve(internalSequenceID,
 				Sandesha2Constants.SequenceProperties.OUT_SEQUENCE_ID);
@@ -700,7 +700,7 @@
 			throw new SandeshaException("Canot close the sequence since it is not active");
 
 		StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configurationContext,configurationContext.getAxisConfiguration());
-		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
 		SequencePropertyBean sequenceIDBean = seqPropMgr.retrieve(internalSequenceID,
 				Sandesha2Constants.SequenceProperties.OUT_SEQUENCE_ID);
 		if (sequenceIDBean == null)
@@ -847,7 +847,7 @@
 	private static byte getServerSequenceStatus(String sequenceID, StorageManager storageManager)
 			throws SandeshaException {
 
-		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
 
 		SequencePropertyBean terminatedBean = seqPropMgr.retrieve(sequenceID,
 				Sandesha2Constants.SequenceProperties.SEQUENCE_TERMINATED);
@@ -894,7 +894,7 @@
 			throws SandeshaException {
 
 		StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configCtx,configCtx.getAxisConfiguration());
-		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
 
 		String withinTransactionStr = (String) configCtx.getProperty(Sandesha2Constants.WITHIN_TRANSACTION);
 		boolean withinTransaction = false;
@@ -967,7 +967,7 @@
 			throw new SandeshaException("Canot terminate the sequence since it is not active");
 
 		StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configurationContext,configurationContext.getAxisConfiguration());
-		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
 		SequencePropertyBean sequenceIDBean = seqPropMgr.retrieve(internalSequenceID,
 				Sandesha2Constants.SequenceProperties.OUT_SEQUENCE_ID);
 		if (sequenceIDBean == null)

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/handlers/SandeshaGlobalInHandler.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/handlers/SandeshaGlobalInHandler.java?rev=418421&r1=418420&r2=418421&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/handlers/SandeshaGlobalInHandler.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/handlers/SandeshaGlobalInHandler.java Fri Jun 30 16:49:49 2006
@@ -240,7 +240,7 @@
 			long msgNo = sequence.getMessageNumber().getMessageNumber();
 
 			if (sequenceId != null && msgNo > 0) {
-				SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
+				SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
 				SequencePropertyBean receivedMsgsBean = seqPropMgr.retrieve(sequenceId,
 						Sandesha2Constants.SequenceProperties.SERVER_COMPLETED_MESSAGES);
 				if (receivedMsgsBean != null) {
@@ -345,7 +345,7 @@
 				sequenceId = sequence.getIdentifier().getIdentifier();
 			}
 
-			SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
+			SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
 			SequencePropertyBean receivedMsgsBean = seqPropMgr.retrieve(sequenceId,
 					Sandesha2Constants.SequenceProperties.SERVER_COMPLETED_MESSAGES);
 			String receivedMsgStr = receivedMsgsBean.getValue();

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/AckRequestedProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/AckRequestedProcessor.java?rev=418421&r1=418420&r2=418421&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/AckRequestedProcessor.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/AckRequestedProcessor.java Fri Jun 30 16:49:49 2006
@@ -83,7 +83,7 @@
 		
 		StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configurationContext,configurationContext.getAxisConfiguration());
 		
-		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
 			
 		//Setting the ack depending on AcksTo.
 		SequencePropertyBean acksToBean = seqPropMgr.retrieve(sequenceID,

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/AcknowledgementProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/AcknowledgementProcessor.java?rev=418421&r1=418420&r2=418421&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/AcknowledgementProcessor.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/AcknowledgementProcessor.java Fri Jun 30 16:49:49 2006
@@ -79,7 +79,7 @@
 		SenderBeanMgr retransmitterMgr = storageManager
 				.getRetransmitterBeanMgr();
 		SequencePropertyBeanMgr seqPropMgr = storageManager
-				.getSequencePropretyBeanMgr();
+				.getSequencePropertyBeanMgr();
 
 		Iterator ackRangeIterator = sequenceAck.getAcknowledgementRanges()
 				.iterator();

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java?rev=418421&r1=418420&r2=418421&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java Fri Jun 30 16:49:49 2006
@@ -142,7 +142,7 @@
 			return;
 		}
 		
-		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
 		
 		//setting acked msg no range
 		Sequence sequence = (Sequence) rmMsgCtx
@@ -365,7 +365,7 @@
 		MessageContext msgCtx = rmMsgCtx.getMessageContext();
 
 		SequencePropertyBeanMgr seqPropMgr = storageManager
-				.getSequencePropretyBeanMgr();
+				.getSequencePropertyBeanMgr();
 		
 		Sequence sequence = (Sequence) rmMsgCtx
 				.getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
@@ -417,9 +417,7 @@
 		}
 		
 		StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configContext,configContext.getAxisConfiguration());
-
-		
-		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
 
 		boolean serverSide = msgContext.isServerSide();  
 
@@ -771,7 +769,7 @@
 		createSeqRMMessage.setFlow(MessageContext.OUT_FLOW);
 		CreateSequence createSequencePart = (CreateSequence) createSeqRMMessage.getMessagePart(Sandesha2Constants.MessageParts.CREATE_SEQ);
 
-		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
 		CreateSeqBeanMgr createSeqMgr = storageManager.getCreateSeqBeanMgr();
 		SenderBeanMgr retransmitterMgr = storageManager.getRetransmitterBeanMgr();
 		
@@ -848,7 +846,7 @@
 		SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SandeshaUtil.getSOAPVersion(rmMsg.getSOAPEnvelope()));
 		ConfigurationContext configurationContext = rmMsg.getMessageContext().getConfigurationContext();
 
-		SequencePropertyBeanMgr sequencePropertyMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr sequencePropertyMgr = storageManager.getSequencePropertyBeanMgr();
 		SenderBeanMgr retransmitterMgr = storageManager.getRetransmitterBeanMgr();
 
 		SequencePropertyBean toBean = sequencePropertyMgr.retrieve(
@@ -1048,7 +1046,7 @@
     if (log.isDebugEnabled())
       log.debug("Enter: ApplicationMsgProcessor::getPreviousMsgNo, " + internalSequenceId);
 
-		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
 		
 		SequencePropertyBean nextMsgNoBean = seqPropMgr.retrieve(
 				internalSequenceId,Sandesha2Constants.SequenceProperties.NEXT_MESSAGE_NUMBER);
@@ -1076,7 +1074,7 @@
 			throw new SandeshaException (message);
 		}
 		
-		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
 		
 		SequencePropertyBean nextMsgNoBean = seqPropMgr.retrieve(
 				internalSequenceId,Sandesha2Constants.SequenceProperties.NEXT_MESSAGE_NUMBER);

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/CloseSequenceProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/CloseSequenceProcessor.java?rev=418421&r1=418420&r2=418421&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/CloseSequenceProcessor.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/CloseSequenceProcessor.java Fri Jun 30 16:49:49 2006
@@ -58,7 +58,7 @@
 		}
 		
 
-		SequencePropertyBeanMgr sequencePropMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr sequencePropMgr = storageManager.getSequencePropertyBeanMgr();
 		SequencePropertyBean sequenceClosedBean = new SequencePropertyBean ();
 		sequenceClosedBean.setSequenceID(sequenceID);
 		sequenceClosedBean.setName(Sandesha2Constants.SequenceProperties.SEQUENCE_CLOSED);

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/CreateSeqMsgProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/CreateSeqMsgProcessor.java?rev=418421&r1=418420&r2=418421&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/CreateSeqMsgProcessor.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/CreateSeqMsgProcessor.java Fri Jun 30 16:49:49 2006
@@ -96,7 +96,7 @@
 		} catch (AxisFault e1) {
 			throw new SandeshaException (e1);
 		}
-		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
 
 		try {
 			String newSequenceId = SequenceManager.setupNewSequence(createSeqRMMsg,storageManager);  //newly created sequnceID.

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/CreateSeqResponseMsgProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/CreateSeqResponseMsgProcessor.java?rev=418421&r1=418420&r2=418421&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/CreateSeqResponseMsgProcessor.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/CreateSeqResponseMsgProcessor.java Fri Jun 30 16:49:49 2006
@@ -147,7 +147,7 @@
 
 		//storing new out sequence id
 		SequencePropertyBeanMgr sequencePropMgr = storageManager
-				.getSequencePropretyBeanMgr();
+				.getSequencePropertyBeanMgr();
 		SequencePropertyBean outSequenceBean = new SequencePropertyBean(
 				internalSequenceId, Sandesha2Constants.SequenceProperties.OUT_SEQUENCE_ID,
 				newOutSequenceId);

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/TerminateSeqMsgProcessor.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/TerminateSeqMsgProcessor.java?rev=418421&r1=418420&r2=418421&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/TerminateSeqMsgProcessor.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/msgprocessors/TerminateSeqMsgProcessor.java Fri Jun 30 16:49:49 2006
@@ -118,7 +118,7 @@
 		}
 		
 
-		SequencePropertyBeanMgr sequencePropertyBeanMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr sequencePropertyBeanMgr = storageManager.getSequencePropertyBeanMgr();
 
 		SequencePropertyBean terminateReceivedBean = new SequencePropertyBean ();
 		terminateReceivedBean.setSequenceID(sequenceId);
@@ -158,7 +158,7 @@
     if (log.isDebugEnabled())
       log.debug("Enter: TerminateSeqMsgProcessor::setUpHighestMsgNumbers, "+sequenceID);
 		
-		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
 		
 		String highestImMsgNumberStr = SandeshaUtil.getSequenceProperty(sequenceID,Sandesha2Constants.SequenceProperties.HIGHEST_IN_MSG_NUMBER,storageManager);
 		String highestImMsgKey = SandeshaUtil.getSequenceProperty(sequenceID,Sandesha2Constants.SequenceProperties.HIGHEST_IN_MSG_KEY,storageManager);
@@ -189,7 +189,13 @@
 				MessageContext highestInMsg = storageManager.retrieveMessageContext(highestImMsgKey,configCtx);
 				
 				//TODO get the out message in a storage friendly manner.
-				MessageContext highestOutMessage = highestInMsg.getOperationContext().getMessageContext(OperationContextFactory.MESSAGE_LABEL_OUT_VALUE);
+				MessageContext highestOutMessage = highestOutMessage = highestInMsg.getOperationContext().getMessageContext(OperationContextFactory.MESSAGE_LABEL_FAULT_VALUE);
+				
+				if (highestOutMessage==null || highestOutMessage.getEnvelope()==null)
+					highestOutMessage = highestInMsg.getOperationContext().getMessageContext(OperationContextFactory.MESSAGE_LABEL_OUT_VALUE);
+				
+				if (highestOutMessage.getEnvelope()==null)
+					throw new SandeshaException ("Out message does not have a envelope");
 				
 				if (highestOutMessage!=null) {
 					RMMsgContext highestOutRMMsg = MsgInitializer.initializeMessage(highestOutMessage);
@@ -293,7 +299,7 @@
 		
 		StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configurationContext,configurationContext.getAxisConfiguration());
 		
-		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
 		
 		String toAddress = rmMsgCtx.getTo().getAddress();
 		String sequenceKey = (String) options.getProperty(SandeshaClientConstants.SEQUENCE_KEY);

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/StorageManager.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/StorageManager.java?rev=418421&r1=418420&r2=418421&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/StorageManager.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/StorageManager.java Fri Jun 30 16:49:49 2006
@@ -60,7 +60,7 @@
 
 	public abstract SenderBeanMgr getRetransmitterBeanMgr();
 
-	public abstract SequencePropertyBeanMgr getSequencePropretyBeanMgr();
+	public abstract SequencePropertyBeanMgr getSequencePropertyBeanMgr();
 
 	public abstract InvokerBeanMgr getStorageMapBeanMgr();
 	
@@ -72,4 +72,4 @@
 
 	public abstract void removeMessageContext (String storageKey) throws SandeshaStorageException;
 
-}
\ No newline at end of file
+}

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemoryStorageManager.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemoryStorageManager.java?rev=418421&r1=418420&r2=418421&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemoryStorageManager.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemoryStorageManager.java Fri Jun 30 16:49:49 2006
@@ -74,7 +74,7 @@
 		return senderBeanMgr;
 	}
 
-	public SequencePropertyBeanMgr getSequencePropretyBeanMgr() {
+	public SequencePropertyBeanMgr getSequencePropertyBeanMgr() {
 		return sequencePropertyBeanMgr;
 	}
 
@@ -157,4 +157,4 @@
 	}
 	
 	
-}
\ No newline at end of file
+}

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/AcknowledgementManager.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/AcknowledgementManager.java?rev=418421&r1=418420&r2=418421&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/AcknowledgementManager.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/AcknowledgementManager.java Fri Jun 30 16:49:49 2006
@@ -71,7 +71,7 @@
 		ConfigurationContext configurationContext = rmMessageContext.getConfigurationContext();
 
 		SenderBeanMgr retransmitterBeanMgr = storageManager.getRetransmitterBeanMgr();
-		SequencePropertyBeanMgr sequencePropertyBeanMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr sequencePropertyBeanMgr = storageManager.getSequencePropertyBeanMgr();
 
 		SenderBean findBean = new SenderBean();
 
@@ -194,7 +194,7 @@
 		MessageContext referenceMsg = referenceRMMessage.getMessageContext();
 		
 		ConfigurationContext configurationContext = referenceRMMessage.getMessageContext().getConfigurationContext();
-		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
 		
 		//Setting the ack depending on AcksTo.
 		SequencePropertyBean acksToBean = seqPropMgr.retrieve(sequenceID,
@@ -388,4 +388,4 @@
 
 		return false;
 	}
-}
\ No newline at end of file
+}

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/FaultManager.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/FaultManager.java?rev=418421&r1=418420&r2=418421&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/FaultManager.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/FaultManager.java Fri Jun 30 16:49:49 2006
@@ -137,7 +137,7 @@
 		String sequenceID = sequence.getIdentifier().getIdentifier();
 		
 		ConfigurationContext configCtx = applicationRMMessage.getMessageContext().getConfigurationContext();
-		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
 		
 		boolean lastMessageNumberExceeded = false;
 		String reason = null;
@@ -352,7 +352,7 @@
     MessageContext referenceMessage = referenceRMMessage.getMessageContext();
 		ConfigurationContext configCtx = referenceMessage.getConfigurationContext();
 		
-		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
 		
 		boolean sequenceClosed = false;
 		String reason = null;
@@ -450,7 +450,7 @@
 						.getAddress();
 			} else {
 				SequencePropertyBeanMgr seqPropMgr = storageManager
-						.getSequencePropretyBeanMgr();
+						.getSequencePropertyBeanMgr();
 				
 				//TODO get the acksTo value using the property key.
 				

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/MsgInitializer.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/MsgInitializer.java?rev=418421&r1=418420&r2=418421&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/MsgInitializer.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/MsgInitializer.java Fri Jun 30 16:49:49 2006
@@ -164,7 +164,7 @@
 		ConfigurationContext configContext = rmMsgCtx.getMessageContext().getConfigurationContext();
 		AxisConfiguration axisConfiguration = configContext.getAxisConfiguration();
 		StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configContext,axisConfiguration);
-		SequencePropertyBeanMgr sequencePropertyBeanMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr sequencePropertyBeanMgr = storageManager.getSequencePropertyBeanMgr();
 		
 		String sequenceID = null;
 		
@@ -236,4 +236,4 @@
 		return true;
 	}
 
-}
\ No newline at end of file
+}

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/RMMsgCreator.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/RMMsgCreator.java?rev=418421&r1=418420&r2=418421&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/RMMsgCreator.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/RMMsgCreator.java Fri Jun 30 16:49:49 2006
@@ -219,7 +219,7 @@
 				.getSOAPVersion(applicationMsgContext.getEnvelope()));
 
 		SequencePropertyBeanMgr seqPropMgr = storageManager
-				.getSequencePropretyBeanMgr();
+				.getSequencePropertyBeanMgr();
 		MessageContext createSeqmsgContext;
 		try {
 			// creating by copying common contents. (this will not set contexts
@@ -644,7 +644,7 @@
 		sequenceAck.setIdentifier(id);
 
 		SequencePropertyBeanMgr seqPropMgr = storageManager
-				.getSequencePropretyBeanMgr();
+				.getSequencePropertyBeanMgr();
 
 		SequencePropertyBean seqBean = seqPropMgr.retrieve(sequenceId,
 				Sandesha2Constants.SequenceProperties.SERVER_COMPLETED_MESSAGES);
@@ -719,4 +719,4 @@
 		}
 	}
 
-}
\ No newline at end of file
+}

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/SandeshaUtil.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/SandeshaUtil.java?rev=418421&r1=418420&r2=418421&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/SandeshaUtil.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/SandeshaUtil.java Fri Jun 30 16:49:49 2006
@@ -690,7 +690,7 @@
 	public static String getSequenceIDFromInternalSequenceID(String internalSequenceID,
 			StorageManager storageManager) throws SandeshaException {
 
-		SequencePropertyBeanMgr sequencePropertyBeanMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr sequencePropertyBeanMgr = storageManager.getSequencePropertyBeanMgr();
 
 		SequencePropertyBean outSequenceBean = sequencePropertyBeanMgr.retrieve(internalSequenceID,
 				Sandesha2Constants.SequenceProperties.OUT_SEQUENCE_ID);
@@ -818,7 +818,7 @@
 	public static String getRMVersion(String propertyKey, StorageManager storageManager)
 			throws SandeshaException {
 
-		SequencePropertyBeanMgr sequencePropertyBeanMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr sequencePropertyBeanMgr = storageManager.getSequencePropertyBeanMgr();
 		SequencePropertyBean specVersionBean = sequencePropertyBeanMgr.retrieve(propertyKey,
 				Sandesha2Constants.SequenceProperties.RM_SPEC_VERSION);
 
@@ -830,7 +830,7 @@
 
 	public static String getSequenceProperty(String id, String name, StorageManager storageManager)
 			throws SandeshaException {
-		SequencePropertyBeanMgr sequencePropertyBeanMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr sequencePropertyBeanMgr = storageManager.getSequencePropertyBeanMgr();
 
 		SequencePropertyBean sequencePropertyBean = sequencePropertyBeanMgr.retrieve(id, name);
 		if (sequencePropertyBean == null)
@@ -894,4 +894,4 @@
 		return sequenceID;
 	}
 
-}
\ No newline at end of file
+}

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/SequenceManager.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/SequenceManager.java?rev=418421&r1=418420&r2=418421&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/SequenceManager.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/SequenceManager.java Fri Jun 30 16:49:49 2006
@@ -81,7 +81,7 @@
 
 
 		SequencePropertyBeanMgr seqPropMgr = storageManager
-				.getSequencePropretyBeanMgr();
+				.getSequencePropertyBeanMgr();
 
 		SequencePropertyBean receivedMsgBean = new SequencePropertyBean(
 				sequenceId, Sandesha2Constants.SequenceProperties.SERVER_COMPLETED_MESSAGES, "");
@@ -165,7 +165,7 @@
 										.getConfigurationContext();
 
 		SequencePropertyBeanMgr seqPropMgr = storageManager
-				.getSequencePropretyBeanMgr();
+				.getSequencePropertyBeanMgr();
 
 		//setting the addressing version
 		String addressingNamespace = (String) firstAplicationMsgCtx.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
@@ -351,7 +351,7 @@
 	 */
 	public static void updateLastActivatedTime (String propertyKey, StorageManager storageManager) throws SandeshaException {
 		//Transaction lastActivatedTransaction = storageManager.getTransaction();
-		SequencePropertyBeanMgr sequencePropertyBeanMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr sequencePropertyBeanMgr = storageManager.getSequencePropertyBeanMgr();
 		
 		SequencePropertyBean lastActivatedBean = sequencePropertyBeanMgr.retrieve(propertyKey, Sandesha2Constants.SequenceProperties.LAST_ACTIVATED_TIME);
 		
@@ -377,7 +377,7 @@
 	
 	public static long getLastActivatedTime (String propertyKey, StorageManager storageManager) throws SandeshaException {
 		
-		SequencePropertyBeanMgr seqPropBeanMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr seqPropBeanMgr = storageManager.getSequencePropertyBeanMgr();
 		
 		SequencePropertyBean lastActivatedBean = seqPropBeanMgr.retrieve(propertyKey,Sandesha2Constants.SequenceProperties.LAST_ACTIVATED_TIME);
 		
@@ -410,7 +410,7 @@
 	
 	public static long getOutGoingSequenceAckedMessageCount (String internalSequenceID,StorageManager storageManager) throws SandeshaException {
 ///		Transaction transaction = storageManager.getTransaction();
-		SequencePropertyBeanMgr seqPropBeanMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr seqPropBeanMgr = storageManager.getSequencePropertyBeanMgr();
 		
 		SequencePropertyBean findSeqIDBean = new SequencePropertyBean ();
 		findSeqIDBean.setValue(internalSequenceID);
@@ -444,7 +444,7 @@
 	
 	public static boolean isOutGoingSequenceCompleted (String internalSequenceID,StorageManager storageManager) throws SandeshaException {
 ///		Transaction transaction = storageManager.getTransaction();
-		SequencePropertyBeanMgr seqPropBeanMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr seqPropBeanMgr = storageManager.getSequencePropertyBeanMgr();
 		
 		SequencePropertyBean findSeqIDBean = new SequencePropertyBean ();
 		findSeqIDBean.setValue(internalSequenceID);
@@ -480,7 +480,7 @@
 	public static boolean isIncomingSequenceCompleted (String sequenceID, StorageManager storageManager) throws SandeshaException {
 		
 ///		Transaction transaction = storageManager.getTransaction();
-		SequencePropertyBeanMgr seqPropBeanMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr seqPropBeanMgr = storageManager.getSequencePropertyBeanMgr();
 		
 		SequencePropertyBean terminateReceivedBean = seqPropBeanMgr.retrieve(sequenceID,Sandesha2Constants.SequenceProperties.TERMINATE_RECEIVED);
 		boolean complete = false;
@@ -493,4 +493,4 @@
 	}
 	
 	
-}
\ No newline at end of file
+}

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/TerminateManager.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/TerminateManager.java?rev=418421&r1=418420&r2=418421&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/TerminateManager.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/util/TerminateManager.java Fri Jun 30 16:49:49 2006
@@ -154,7 +154,7 @@
 	}
 
 	private static void removeReceivingSideProperties (ConfigurationContext configContext, String sequenceID,StorageManager storageManager) throws SandeshaException {
-		SequencePropertyBeanMgr sequencePropertyBeanMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr sequencePropertyBeanMgr = storageManager.getSequencePropertyBeanMgr();
 		SequencePropertyBean allSequenceBean = sequencePropertyBeanMgr.retrieve(Sandesha2Constants.SequenceProperties.ALL_SEQUENCES,Sandesha2Constants.SequenceProperties.INCOMING_SEQUENCE_LIST);
 		
 		if (allSequenceBean!=null) {
@@ -190,7 +190,7 @@
 	 */
 	public static void terminateSendingSide (ConfigurationContext configContext, String internalSequenceID,boolean serverSide,StorageManager storageManager) throws SandeshaException {
 		
-		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
 		
 		SequencePropertyBean seqTerminatedBean = new SequencePropertyBean (internalSequenceID,Sandesha2Constants.SequenceProperties.SEQUENCE_TERMINATED,Sandesha2Constants.VALUE_TRUE);
 		seqPropMgr.insert(seqTerminatedBean);
@@ -234,7 +234,7 @@
 		}	
 	}
 	
-	private static boolean isProportyDeletable (String name) {
+	private static boolean isPropertyDeletable (String name) {
 		boolean deleatable = true;
 				
 		if (Sandesha2Constants.SequenceProperties.TERMINATE_ADDED.equals(name))
@@ -263,7 +263,7 @@
 	
 	public static void timeOutSendingSideSequence (ConfigurationContext context,String internalSequenceID, boolean serverside,StorageManager storageManager) throws SandeshaException {
 		
-		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
 		SequencePropertyBean seqTerminatedBean = new SequencePropertyBean (internalSequenceID,Sandesha2Constants.SequenceProperties.SEQUENCE_TIMED_OUT,Sandesha2Constants.VALUE_TRUE);
 		seqPropMgr.insert(seqTerminatedBean);
 		
@@ -272,7 +272,7 @@
 	
 	private static void cleanSendingSideData (ConfigurationContext configContext,String internalSequenceID, boolean serverSide,StorageManager storageManager) throws SandeshaException {
 		
-		SequencePropertyBeanMgr sequencePropertyBeanMgr = storageManager.getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr sequencePropertyBeanMgr = storageManager.getSequencePropertyBeanMgr();
 		SenderBeanMgr retransmitterBeanMgr = storageManager.getRetransmitterBeanMgr();
 		CreateSeqBeanMgr createSeqBeanMgr = storageManager.getCreateSeqBeanMgr();
 		
@@ -324,7 +324,7 @@
 			doUpdatesIfNeeded (outSequenceID,sequencePropertyBean,sequencePropertyBeanMgr);
 			
 			//TODO all properties which hv the temm:Seq:id as the key should be deletable.
-			if (isProportyDeletable(sequencePropertyBean.getName())) {
+			if (isPropertyDeletable(sequencePropertyBean.getName())) {
 				sequencePropertyBeanMgr.delete(sequencePropertyBean.getSequenceID(),sequencePropertyBean.getName());
 			}
 		}
@@ -339,7 +339,7 @@
 ///		Transaction addTerminateSeqTransaction = storageManager.getTransaction();
 		
 		SequencePropertyBeanMgr seqPropMgr = storageManager
-				.getSequencePropretyBeanMgr();
+				.getSequencePropertyBeanMgr();
 
 		SequencePropertyBean terminated = seqPropMgr.retrieve(outSequenceId,
 				Sandesha2Constants.SequenceProperties.TERMINATE_ADDED);

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/workers/InOrderInvoker.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/workers/InOrderInvoker.java?rev=418421&r1=418420&r2=418421&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/workers/InOrderInvoker.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/workers/InOrderInvoker.java Fri Jun 30 16:49:49 2006
@@ -102,14 +102,6 @@
 		return runInvoker;
 	}
 
-	public void setConfugurationContext(ConfigurationContext context) {
-    if (log.isDebugEnabled())
-      log.debug("Enter: InOrderInvoker::setConfugurationContext");
-		this.context = context;
-    if (log.isDebugEnabled())
-      log.debug("Exit: InOrderInvoker::setConfugurationContext");
-	}
-
 	public synchronized void runInvokerForTheSequence(ConfigurationContext context, String sequenceID) {
     if (log.isDebugEnabled())
       log.debug("Enter: InOrderInvoker::runInvokerForTheSequence");
@@ -177,7 +169,7 @@
 				InvokerBeanMgr storageMapMgr = storageManager.getStorageMapBeanMgr();
 
 				SequencePropertyBeanMgr sequencePropMgr = storageManager
-						.getSequencePropretyBeanMgr();
+						.getSequencePropertyBeanMgr();
 
 				transaction = storageManager.getTransaction();
 				
@@ -256,13 +248,14 @@
 							AxisEngine engine = new AxisEngine (context);
 							if (postFailureInvocation) {
 								makeMessageReadyForReinjection (msgToInvoke);
-                if (log.isDebugEnabled())
-                  log.debug("Receiving message, key=" + key +", msgCtx=" + msgToInvoke.getEnvelope().getHeader());
+								if (log.isDebugEnabled())
+									log.debug("Receiving message, key=" + key +", msgCtx=" + msgToInvoke.getEnvelope().getHeader());
 								engine.receive(msgToInvoke);
 							} else {
-                if (log.isDebugEnabled())
-                  log.debug("Resuming message, key=" + key +", msgCtx=" + msgToInvoke.getEnvelope().getHeader());
-								engine.resume(msgToInvoke);
+								if (log.isDebugEnabled())
+									log.debug("Resuming message, key=" + key +", msgCtx=" + msgToInvoke.getEnvelope().getHeader());
+								msgToInvoke.setPaused(false);
+								engine.resumeReceive(msgToInvoke);
 							}
 							
 							invoked = true;
@@ -270,7 +263,10 @@
 						} catch (Exception e) {
               if (log.isDebugEnabled())
                 log.debug("Exception :", e);
-							throw new SandeshaException(e);
+              
+              			handleFault(msgToInvoke,e);
+              			
+//							throw new SandeshaException(e);
 						} finally {
 							transaction = storageManager.getTransaction();
 						}
@@ -340,4 +336,12 @@
 		messageContext.getOptions().setAction(null);
 		messageContext.setProperty(Sandesha2Constants.REINJECTED_MESSAGE,Sandesha2Constants.VALUE_TRUE);
 	}
+	
+	private void handleFault(MessageContext inMsgContext,Exception e) throws Exception {
+		//		msgContext.setProperty(MessageContext.TRANSPORT_OUT, out);
+		AxisEngine engine = new AxisEngine(inMsgContext.getConfigurationContext());
+		MessageContext faultContext = engine.createFaultMessageContext(inMsgContext, e);
+		engine.sendFault(faultContext);
+	}
+	
 }

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/workers/Sender.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/workers/Sender.java?rev=418421&r1=418420&r2=418421&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/workers/Sender.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/workers/Sender.java Fri Jun 30 16:49:49 2006
@@ -57,89 +57,90 @@
 public class Sender extends Thread {
 
 	private boolean runSender = false;
+
 	private ArrayList workingSequences = new ArrayList();
+
 	private ConfigurationContext context = null;
+
 	private static final Log log = LogFactory.getLog(Sender.class);
+
 	private boolean hasStopped = false;
 
 	public synchronized void stopSenderForTheSequence(String sequenceID) {
-    if (log.isDebugEnabled())
-      log.debug("Enter: Sender::stopSenderForTheSequence, " + sequenceID);
+		if (log.isDebugEnabled())
+			log.debug("Enter: Sender::stopSenderForTheSequence, " + sequenceID);
 		workingSequences.remove(sequenceID);
 		if (workingSequences.size() == 0) {
-			 runSender = false;
+			runSender = false;
 		}
-    if (log.isDebugEnabled())
-      log.debug("Exit: Sender::stopSenderForTheSequence");
+		if (log.isDebugEnabled())
+			log.debug("Exit: Sender::stopSenderForTheSequence");
 	}
-	
-	public synchronized void stopSending () {
-    if (log.isDebugEnabled())
-      log.debug("Enter: Sender::stopSending");
-		
-    if(isSenderStarted()){
-			//the sender is started so stop it
+
+	public synchronized void stopSending() {
+		if (log.isDebugEnabled())
+			log.debug("Enter: Sender::stopSending");
+
+		if (isSenderStarted()) {
+			// the sender is started so stop it
 			runSender = false;
-			//wait for it to finish
-			while(!hasStoppedSending()){
+			// wait for it to finish
+			while (!hasStoppedSending()) {
 				try {
 					wait(Sandesha2Constants.SENDER_SLEEP_TIME);
-				}
-				catch (InterruptedException e1) {
-						log.debug(e1.getMessage());
+				} catch (InterruptedException e1) {
+					log.debug(e1.getMessage());
 				}
 			}
 		}
-    
-    if (log.isDebugEnabled())
-      log.debug("Exit: Sender::stopSending");
-	}
-	
-	private synchronized boolean hasStoppedSending(){
-    if (log.isDebugEnabled())
-    {
-      log.debug("Enter: Sender::hasStoppedSending");
-      log.debug("Exit: Sender::hasStoppedSending, " + hasStopped);
-    }
+
+		if (log.isDebugEnabled())
+			log.debug("Exit: Sender::stopSending");
+	}
+
+	private synchronized boolean hasStoppedSending() {
+		if (log.isDebugEnabled()) {
+			log.debug("Enter: Sender::hasStoppedSending");
+			log.debug("Exit: Sender::hasStoppedSending, " + hasStopped);
+		}
 		return hasStopped;
 	}
 
 	public synchronized boolean isSenderStarted() {
-    if (log.isDebugEnabled())
-    {
-      log.debug("Enter: Sender::isSenderStarted");
-      log.debug("Exit: Sender::isSenderStarted, " + runSender);
-    }
+		if (log.isDebugEnabled()) {
+			log.debug("Enter: Sender::isSenderStarted");
+			log.debug("Exit: Sender::isSenderStarted, " + runSender);
+		}
 		return runSender;
 	}
-	
-	public void run(){
-    if (log.isDebugEnabled())
-    	log.debug("Enter: Sender::run");
-    
-    try{
-    	internalRun();
-    }
-    finally{
-    	//flag that we have exited the run loop and notify any waiting threads
-    	synchronized(this){
-    			hasStopped = true;
-    			notify();
-    	}    	
-    }
-    
-    if (log.isDebugEnabled())
-      log.debug("Exit: Sender::run");
+
+	public void run() {
+		if (log.isDebugEnabled())
+			log.debug("Enter: Sender::run");
+
+		try {
+			internalRun();
+		} finally {
+			// flag that we have exited the run loop and notify any waiting
+			// threads
+			synchronized (this) {
+				hasStopped = true;
+				notify();
+			}
+		}
+
+		if (log.isDebugEnabled())
+			log.debug("Exit: Sender::run");
 	}
 
 	private void internalRun() {
-    if (log.isDebugEnabled())
-      log.debug("Enter: Sender::internalRun");
+		if (log.isDebugEnabled())
+			log.debug("Enter: Sender::internalRun");
 
 		StorageManager storageManager = null;
 
 		try {
-			storageManager = SandeshaUtil.getSandeshaStorageManager(context,context.getAxisConfiguration());
+			storageManager = SandeshaUtil.getSandeshaStorageManager(context, context.getAxisConfiguration());
 		} catch (SandeshaException e2) {
 			// TODO Auto-generated catch block
 			log.debug("ERROR: Could not start sender", e2);
@@ -157,33 +158,34 @@
 				log.debug(e1.getMessage());
 				log.debug("End printing Interrupt...");
 			}
-			
+
 			Transaction transaction = null;
 			boolean rolebacked = false;
-			
+
 			try {
 				if (context == null) {
 					String message = "Can't continue the Sender. Context is null";
 					log.debug(message);
 					throw new SandeshaException(message);
 				}
-				
+
 				transaction = storageManager.getTransaction();
-				
+
 				SenderBeanMgr mgr = storageManager.getRetransmitterBeanMgr();
 				SenderBean senderBean = mgr.getNextMsgToSend();
-				if (senderBean==null) {
-          if (log.isDebugEnabled())
-            log.debug("SenderBean not found");
+				if (senderBean == null) {
+					if (log.isDebugEnabled())
+						log.debug("SenderBean not found");
 					continue;
-			    }
-				
+				}
+
 				String key = senderBean.getMessageContextRefKey();
 				MessageContext msgCtx = storageManager.retrieveMessageContext(key, context);
-				msgCtx.setProperty(Sandesha2Constants.WITHIN_TRANSACTION,Sandesha2Constants.VALUE_TRUE);
-				
+				msgCtx.setProperty(Sandesha2Constants.WITHIN_TRANSACTION, Sandesha2Constants.VALUE_TRUE);
+
 				MessageRetransmissionAdjuster retransmitterAdjuster = new MessageRetransmissionAdjuster();
-				boolean continueSending = retransmitterAdjuster.adjustRetransmittion(senderBean, context,storageManager);
+				boolean continueSending = retransmitterAdjuster.adjustRetransmittion(senderBean, context,
+						storageManager);
 				if (!continueSending) {
 					continue;
 				}
@@ -196,7 +198,8 @@
 				// set and not true.
 				// But it will set if it is not set (null)
 
-				// This is used to make sure that the mesage get passed the Sandesha2TransportSender.
+				// This is used to make sure that the mesage get passed the
+				// Sandesha2TransportSender.
 
 				String qualifiedForSending = (String) msgCtx.getProperty(Sandesha2Constants.QUALIFIED_FOR_SENDING);
 				if (qualifiedForSending != null && !qualifiedForSending.equals(Sandesha2Constants.VALUE_TRUE)) {
@@ -209,14 +212,14 @@
 				}
 
 				RMMsgContext rmMsgCtx = MsgInitializer.initializeMessage(msgCtx);
-				
-				//operation is the lowest level Sandesha2 should be attached
+
+				// operation is the lowest level Sandesha2 should be attached
 				ArrayList msgsNotToSend = SandeshaUtil.getPropertyBean(msgCtx.getAxisOperation()).getMsgTypesToDrop();
 
 				if (msgsNotToSend != null && msgsNotToSend.contains(new Integer(rmMsgCtx.getMessageType()))) {
 					continue;
 				}
-				
+
 				updateMessage(msgCtx);
 
 				int messageType = rmMsgCtx.getMessageType();
@@ -224,43 +227,48 @@
 					Sequence sequence = (Sequence) rmMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
 					String sequenceID = sequence.getIdentifier().getIdentifier();
 				}
-				
-				//checking weather this message can carry piggybacked acks
+
+				// checking weather this message can carry piggybacked acks
 				if (isAckPiggybackableMsgType(messageType) && !isAckAlreadyPiggybacked(rmMsgCtx)) {
-					// piggybacking if an ack if available for the same sequence.
-					//TODO do piggybacking based on wsa:To
-					AcknowledgementManager.piggybackAcksIfPresent(rmMsgCtx,storageManager);
+					// piggybacking if an ack if available for the same
+					// sequence.
+					// TODO do piggybacking based on wsa:To
+					AcknowledgementManager.piggybackAcksIfPresent(rmMsgCtx, storageManager);
 				}
-				
-				//sending the message
+
+				// sending the message
 				TransportOutDescription transportOutDescription = msgCtx.getTransportOut();
 				TransportSender transportSender = transportOutDescription.getSender();
-					
+
 				boolean successfullySent = false;
 				if (transportSender != null) {
-					
-					//have to commit the transaction before sending. This may get changed when WS-AT is available.
+
+					// have to commit the transaction before sending. This may
+					// get changed when WS-AT is available.
 					transaction.commit();
-					msgCtx.setProperty(Sandesha2Constants.WITHIN_TRANSACTION,Sandesha2Constants.VALUE_FALSE);
+					msgCtx.setProperty(Sandesha2Constants.WITHIN_TRANSACTION, Sandesha2Constants.VALUE_FALSE);
 					try {
-						
-						//had to fully build the SOAP envelope to support retransmissions.
-						//Otherwise a 'parserAlreadyAccessed' exception could get thrown in retransmissions.
-						//But this has a performance reduction.
+
+						// had to fully build the SOAP envelope to support
+						// retransmissions.
+						// Otherwise a 'parserAlreadyAccessed' exception could
+						// get thrown in retransmissions.
+						// But this has a performance reduction.
 						msgCtx.getEnvelope().build();
-						
-            if (log.isDebugEnabled())
-              log.debug("Invoking using transportSender " + transportSender + ", msgCtx=" + msgCtx.getEnvelope().getHeader());
-						//TODO change this to cater for security.
+
+						if (log.isDebugEnabled())
+							log.debug("Invoking using transportSender " + transportSender + ", msgCtx="
+									+ msgCtx.getEnvelope().getHeader());
+						// TODO change this to cater for security.
 						transportSender.invoke(msgCtx);
 						successfullySent = true;
 					} catch (Exception e) {
 						// TODO Auto-generated catch block
-					    String message = "Sandesha2 got an exception when trying to send the message";
-						log.debug(message,e);
+						String message = "Sandesha2 got an exception when trying to send the message";
+						log.debug(message, e);
 					} finally {
-						transaction =  storageManager.getTransaction();
-						msgCtx.setProperty(Sandesha2Constants.WITHIN_TRANSACTION,Sandesha2Constants.VALUE_TRUE);
+						transaction = storageManager.getTransaction();
+						msgCtx.setProperty(Sandesha2Constants.WITHIN_TRANSACTION, Sandesha2Constants.VALUE_TRUE);
 					}
 				}
 
@@ -273,66 +281,68 @@
 						mgr.update(bean1);
 					} else {
 						mgr.delete(bean1.getMessageID());
-						
-						//removing the message from the storage.
+
+						// removing the message from the storage.
 						String messageStoredKey = bean1.getMessageContextRefKey();
 						storageManager.removeMessageContext(messageStoredKey);
 					}
 				}
-				
+
 				if (successfullySent) {
 					if (!msgCtx.isServerSide())
 						checkForSyncResponses(msgCtx);
 				}
-				
+
 				if (rmMsgCtx.getMessageType() == Sandesha2Constants.MessageTypes.TERMINATE_SEQ) {
 					// terminate sending side.
-					TerminateSequence terminateSequence = (TerminateSequence) rmMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.TERMINATE_SEQ);
+					TerminateSequence terminateSequence = (TerminateSequence) rmMsgCtx
+							.getMessagePart(Sandesha2Constants.MessageParts.TERMINATE_SEQ);
 					String sequenceID = terminateSequence.getIdentifier().getIdentifier();
 					ConfigurationContext configContext = msgCtx.getConfigurationContext();
-					
-					String internalSequenceID = SandeshaUtil.getSequenceProperty(sequenceID,Sandesha2Constants.SequenceProperties.INTERNAL_SEQUENCE_ID,storageManager);
-					TerminateManager.terminateSendingSide(configContext,internalSequenceID, msgCtx.isServerSide(),storageManager);
+
+					String internalSequenceID = SandeshaUtil.getSequenceProperty(sequenceID,
+							Sandesha2Constants.SequenceProperties.INTERNAL_SEQUENCE_ID, storageManager);
+					TerminateManager.terminateSendingSide(configContext, internalSequenceID, msgCtx.isServerSide(),
+							storageManager);
 				}
 
-				msgCtx.setProperty(Sandesha2Constants.WITHIN_TRANSACTION,Sandesha2Constants.VALUE_FALSE);
-				
+				msgCtx.setProperty(Sandesha2Constants.WITHIN_TRANSACTION, Sandesha2Constants.VALUE_FALSE);
+
 			} catch (Exception e) {
-				
+
 				// TODO : when this is the client side throw the exception to
 				// the client when necessary.
-				
-				if (transaction!=null) {
+
+				if (transaction != null) {
 					try {
 						transaction.rollback();
 						rolebacked = true;
 					} catch (Exception e1) {
 						String message = "Exception thrown when trying to roleback the transaction.";
-						log.debug(message,e1);
+						log.debug(message, e1);
 					}
 				}
-				
+
 				String message = "An Exception was throws in sending";
-				log.debug(message,e);
+				log.debug(message, e);
 			} finally {
-				if (transaction!=null && !rolebacked) {
+				if (transaction != null && !rolebacked) {
 					try {
 						transaction.commit();
 					} catch (Exception e) {
 						String message = "Exception thrown when trying to commit the transaction.";
-						log.debug(message,e);
+						log.debug(message, e);
 					}
 				}
 			}
 		}
-    if (log.isDebugEnabled())
-      log.debug("Exit: Sender::internalRun");
+		if (log.isDebugEnabled())
+			log.debug("Exit: Sender::internalRun");
 	}
 
-	public synchronized void runSenderForTheSequence(
-			ConfigurationContext context, String sequenceID) {
-    if (log.isDebugEnabled())
-      log.debug("Enter: Sender::runSenderForTheSequence, " + sequenceID);
+	public synchronized void runSenderForTheSequence(ConfigurationContext context, String sequenceID) {
+		if (log.isDebugEnabled())
+			log.debug("Enter: Sender::runSenderForTheSequence, " + sequenceID);
 
 		if (sequenceID != null && !workingSequences.contains(sequenceID))
 			workingSequences.add(sequenceID);
@@ -342,129 +352,126 @@
 			runSender = true; // so that isSenderStarted()=true.
 			super.start();
 		}
-    if (log.isDebugEnabled())
-      log.debug("Exit: Sender::runSenderForTheSequence");
+		if (log.isDebugEnabled())
+			log.debug("Exit: Sender::runSenderForTheSequence");
 	}
 
 	private void updateMessage(MessageContext msgCtx1) throws SandeshaException {
-		//do updates if required.
+		// do updates if required.
 	}
 
-	private void checkForSyncResponses(MessageContext msgCtx)
-			throws SandeshaException {
-    if (log.isDebugEnabled())
-      log.debug("Enter: Sender::checkForSyncResponses, " + msgCtx.getEnvelope().getHeader());
+	private void checkForSyncResponses(MessageContext msgCtx) throws SandeshaException {
+		if (log.isDebugEnabled())
+			log.debug("Enter: Sender::checkForSyncResponses, " + msgCtx.getEnvelope().getHeader());
 
 		try {
 
-			boolean responsePresent = (msgCtx
-					.getProperty(MessageContext.TRANSPORT_IN) != null);
+			boolean responsePresent = (msgCtx.getProperty(MessageContext.TRANSPORT_IN) != null);
 			if (!responsePresent)
 				return;
-			
+
 			// create the responseMessageContext
 
 			MessageContext responseMessageContext = new MessageContext();
 			responseMessageContext.setServerSide(false);
-			responseMessageContext.setConfigurationContext(msgCtx
-					.getConfigurationContext());
+			responseMessageContext.setConfigurationContext(msgCtx.getConfigurationContext());
 			responseMessageContext.setTransportIn(msgCtx.getTransportIn());
 			responseMessageContext.setTransportOut(msgCtx.getTransportOut());
 
-			responseMessageContext.setProperty(MessageContext.TRANSPORT_IN,
-					msgCtx.getProperty(MessageContext.TRANSPORT_IN));
+			responseMessageContext.setProperty(MessageContext.TRANSPORT_IN, msgCtx
+					.getProperty(MessageContext.TRANSPORT_IN));
 			responseMessageContext.setServiceContext(msgCtx.getServiceContext());
 			responseMessageContext.setServiceGroupContext(msgCtx.getServiceGroupContext());
-			
-			//copying required properties from op. context to the response msg ctx.
+
+			// copying required properties from op. context to the response msg
+			// ctx.
 			OperationContext requestMsgOpCtx = msgCtx.getOperationContext();
-			if (requestMsgOpCtx!=null) {
-			     if (responseMessageContext.getProperty(HTTPConstants.MTOM_RECEIVED_CONTENT_TYPE)==null) {
-			    	 responseMessageContext.setProperty(HTTPConstants.MTOM_RECEIVED_CONTENT_TYPE,
-			    			 requestMsgOpCtx.getProperty(HTTPConstants.MTOM_RECEIVED_CONTENT_TYPE));
-			     }
-			     
-			     if (responseMessageContext.getProperty(HTTPConstants.CHAR_SET_ENCODING)==null) {
-			    	 responseMessageContext.setProperty(HTTPConstants.CHAR_SET_ENCODING,
-			    			 requestMsgOpCtx.getProperty(HTTPConstants.CHAR_SET_ENCODING));
-			     }
+			if (requestMsgOpCtx != null) {
+				if (responseMessageContext.getProperty(HTTPConstants.MTOM_RECEIVED_CONTENT_TYPE) == null) {
+					responseMessageContext.setProperty(HTTPConstants.MTOM_RECEIVED_CONTENT_TYPE, requestMsgOpCtx
+							.getProperty(HTTPConstants.MTOM_RECEIVED_CONTENT_TYPE));
+				}
+
+				if (responseMessageContext.getProperty(HTTPConstants.CHAR_SET_ENCODING) == null) {
+					responseMessageContext.setProperty(HTTPConstants.CHAR_SET_ENCODING, requestMsgOpCtx
+							.getProperty(HTTPConstants.CHAR_SET_ENCODING));
+				}
 			}
 
 			// If request is REST we assume the responseMessageContext is REST,
 			// so set the variable
 
-		    responseMessageContext.setDoingREST(msgCtx.isDoingREST());
+			responseMessageContext.setDoingREST(msgCtx.isDoingREST());
 
 			SOAPEnvelope resenvelope = null;
 			try {
-				resenvelope = TransportUtils.createSOAPMessage(msgCtx, 
-						msgCtx.getEnvelope().getNamespace().getName());
-				
+				resenvelope = TransportUtils.createSOAPMessage(msgCtx, msgCtx.getEnvelope().getNamespace().getName());
+
 			} catch (AxisFault e) {
 				// TODO Auto-generated catch block
 				log.debug("Valid SOAP envelope not found");
 				log.debug(e.getStackTrace().toString());
 			}
-			
-			//if the request msg ctx is withina a transaction, processing if the response should also happen
-			//withing the same transaction
-			responseMessageContext.setProperty(Sandesha2Constants.WITHIN_TRANSACTION
-					,msgCtx.getProperty(Sandesha2Constants.WITHIN_TRANSACTION));
-			
+
+			// if the request msg ctx is withina a transaction, processing if
+			// the response should also happen
+			// withing the same transaction
+			responseMessageContext.setProperty(Sandesha2Constants.WITHIN_TRANSACTION, msgCtx
+					.getProperty(Sandesha2Constants.WITHIN_TRANSACTION));
+
 			if (resenvelope != null) {
 				responseMessageContext.setEnvelope(resenvelope);
-				AxisEngine engine = new AxisEngine(msgCtx
-						.getConfigurationContext());
-				
+				AxisEngine engine = new AxisEngine(msgCtx.getConfigurationContext());
+
 				if (isFaultEnvelope(resenvelope)) {
 					engine.receiveFault(responseMessageContext);
-				}else {
+				} else {
 					engine.receive(responseMessageContext);
 				}
-			} 
-			
+			}
+
 		} catch (Exception e) {
 			String message = "No valid Sync response...";
 			log.debug(message, e);
 			throw new SandeshaException(message, e);
 		}
-    if (log.isDebugEnabled())
-      log.debug("Exit: Sender::checkForSyncResponses");
+		if (log.isDebugEnabled())
+			log.debug("Exit: Sender::checkForSyncResponses");
 	}
-	
+
 	private boolean isAckPiggybackableMsgType(int messageType) {
-    if (log.isDebugEnabled())
-      log.debug("Enter: Sender::isAckPiggybackableMsgType, " + messageType);
-		boolean piggybackable = true;		
-    
-		if (messageType==Sandesha2Constants.MessageTypes.ACK) 
+		if (log.isDebugEnabled())
+			log.debug("Enter: Sender::isAckPiggybackableMsgType, " + messageType);
+		boolean piggybackable = true;
+
+		if (messageType == Sandesha2Constants.MessageTypes.ACK)
 			piggybackable = false;
-		
-    if (log.isDebugEnabled())
-      log.debug("Exit: Sender::isAckPiggybackableMsgType, " + piggybackable);
-		return piggybackable;	
-	}
-	
-	private boolean isAckAlreadyPiggybacked (RMMsgContext rmMessageContext) {
-		if (rmMessageContext.getMessagePart(Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT)!=null)
+
+		if (log.isDebugEnabled())
+			log.debug("Exit: Sender::isAckPiggybackableMsgType, " + piggybackable);
+		return piggybackable;
+	}
+
+	private boolean isAckAlreadyPiggybacked(RMMsgContext rmMessageContext) {
+		if (rmMessageContext.getMessagePart(Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT) != null)
 			return true;
-		
+
 		return false;
 	}
-	
-	private boolean isFaultEnvelope (SOAPEnvelope envelope) throws SandeshaException {		
-    if (log.isDebugEnabled())
-      log.debug("Enter: Sender::isFaultEnvelope, " + envelope.getBody().getFault());
+
+	private boolean isFaultEnvelope(SOAPEnvelope envelope) throws SandeshaException {
+		if (log.isDebugEnabled())
+			log.debug("Enter: Sender::isFaultEnvelope, " + envelope.getBody().getFault());
 		SOAPFault fault = envelope.getBody().getFault();
-		if (fault!=null) {
-      if (log.isDebugEnabled())
-        log.debug("Exit: Sender::isFaultEnvelope, TRUE");
+		if (fault != null) {
+			if (log.isDebugEnabled())
+				log.debug("Exit: Sender::isFaultEnvelope, TRUE");
 			return true;
-    }
-		
-    if (log.isDebugEnabled())
-      log.debug("Exit: Sender::isFaultEnvelope, FALSE");
+		}
+
+		if (log.isDebugEnabled())
+			log.debug("Exit: Sender::isFaultEnvelope, FALSE");
 		return false;
 	}
-	
+
 }



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