ws-sandesha-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chamik...@apache.org
Subject svn commit: r372216 - in /webservices/sandesha/trunk/src/org/apache/sandesha2: ./ handlers/ msgprocessors/ storage/ storage/beanmanagers/ storage/inmemory/ transport/ util/ workers/
Date Wed, 25 Jan 2006 14:00:33 GMT
Author: chamikara
Date: Wed Jan 25 05:59:28 2006
New Revision: 372216

URL: http://svn.apache.org/viewcvs?rev=372216&view=rev
Log:
Logic to dump the message to the storage at the transport sender. This causes the message to go through all the handlers and in retransmission those can be skipped (have to work a bit more to comply with security).
Updates to comply with latest Axis2 version.
Bug fixes.

Added:
    webservices/sandesha/trunk/src/org/apache/sandesha2/transport/
    webservices/sandesha/trunk/src/org/apache/sandesha2/transport/Sandesha2TransportSender.java
Modified:
    webservices/sandesha/trunk/src/org/apache/sandesha2/AcknowledgementManager.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/Sandesha2Constants.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/SandeshaModule.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/TerminateManager.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/SandeshaGlobalInHandler.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/SandeshaOutHandler.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/AcknowledgementProcessor.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/CreateSeqMsgProcessor.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/CreateSeqResponseMsgProcessor.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/TerminateSeqMsgProcessor.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/StorageManager.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/CreateSeqBeanMgr.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/NextMsgBeanMgr.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/SenderBeanMgr.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/SequencePropertyBeanMgr.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryInvokerBeanMgr.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryNextMsgBeanMgr.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemorySenderBeanMgr.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemorySequencePropertyBeanMgr.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryStorageManager.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/util/FaultManager.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/util/MessageRetransmissionAdjuster.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/util/PropertyManager.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/util/SandeshaUtil.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/util/SequenceManager.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/workers/InOrderInvoker.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/workers/Sender.java

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/AcknowledgementManager.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/AcknowledgementManager.java?rev=372216&r1=372215&r2=372216&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/AcknowledgementManager.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/AcknowledgementManager.java Wed Jan 25 05:59:28 2006
@@ -106,9 +106,9 @@
 				retransmitterBeanMgr.delete(ackBean.getMessageID());
 
 				//Adding the ack to the application message
-				MessageContext ackMsgContext = SandeshaUtil
-						.getStoredMessageContext(ackBean
-								.getMessageContextRefKey());
+				MessageContext ackMsgContext = storageManager
+						.retrieveMessageContext(ackBean
+								.getMessageContextRefKey(),configurationContext);
 				RMMsgContext ackRMMsgContext = MsgInitializer
 						.initializeMessage(ackMsgContext);
 				if (ackRMMsgContext.getMessageType() != Sandesha2Constants.MessageTypes.ACK) {

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/Sandesha2Constants.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/Sandesha2Constants.java?rev=372216&r1=372215&r2=372216&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/Sandesha2Constants.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/Sandesha2Constants.java Wed Jan 25 05:59:28 2006
@@ -17,7 +17,6 @@
 
 package org.apache.sandesha2;
 
-import java.util.ArrayList;
 
 /**
  * Contains all the Sandesha2Constants of Sandesha2.
@@ -305,6 +304,10 @@
 		}
 	}
 	
+	public interface DatabaseParams {
+		
+	}
+	
 	String IN_HANDLER_NAME = "SandeshaInHandler";
 
 	String OUT_HANDLER_NAME = "SandeshaOutHandler";
@@ -335,6 +338,27 @@
 	
 	String VALUE_NONE = "none";
 	
+	String VALUE_EMPTY = "empty";
+	
+	String VALUE_TRUE = "true";
+	
+	String VALUE_FALSE = "false";
+	
 	String SANDESHA2_INTERNAL_SEQUENCE_ID = "Sandesha2IntSeq";
+	
+	String MESSAGE_STORE_KEY = "Sandesha2MessageStoreKey";
 
+	String ORIGINAL_TRANSPORT_SENDER = "Sandesha2OriginalTransportSender";
+	
+	String SET_SEND_TO_TRUE = "Sandesha2SetSendToTrue";
+	
+	String MESSAGE_TYPE = "Sandesha2MessageType";
+	
+	String QUALIFIED_FOR_SENDING = "Sandesha2QualifiedForSending";  //Sender will send messages only if this property is null (not set) or true.
+
+	String QNAME_SEPERATOR = ",";
+	
+	String EXECUTIN_CHAIN_SEPERATOR = ".";
+	
+	String INTERNAL_SEQUENCE_PREFIX = "Sandesha2InternalSequence";
 }

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/SandeshaModule.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/SandeshaModule.java?rev=372216&r1=372215&r2=372216&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/SandeshaModule.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/SandeshaModule.java Wed Jan 25 05:59:28 2006
@@ -17,25 +17,15 @@
 
 package org.apache.sandesha2;
 
-import java.beans.beancontext.BeanContext;
-import java.util.ArrayList;
-
-import javax.xml.namespace.QName;
-
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.description.AxisDescription;
-import org.apache.axis2.description.ModuleDescription;
+import org.apache.axis2.description.AxisModule;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.modules.Module;
-import org.apache.sandesha2.policy.PolicyEngineData;
-import org.apache.sandesha2.policy.RMPolicyProcessor;
-import org.apache.sandesha2.policy.RMProcessorContext;
 import org.apache.sandesha2.storage.StorageManager;
 import org.apache.sandesha2.util.PropertyManager;
-import org.apache.sandesha2.util.SandeshaPropertyBean;
 import org.apache.sandesha2.util.SandeshaUtil;
-import org.apache.ws.policy.Policy;
 
 
 /**
@@ -48,12 +38,15 @@
 
 	// initialize the module
 	public void init(ConfigurationContext configContext,
-			ModuleDescription module) throws AxisFault {
+			AxisModule module) throws AxisFault {
 
 		// continueUncompletedSequences (storageManager,configCtx);
 
 		// loading properties to property manager.
-		 PropertyManager.getInstance().loadPropertiesFromModuleDesc(module);
+		// PropertyManager.getInstance().loadPropertiesFromModuleDesc(module);
+		PropertyManager.getInstance().loadPropertiesFromModuleDesc(module);
+		StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configContext);
+		storageManager.initStorage(module);
 	}
 
 	public void engageNotify(AxisDescription axisDescription) throws AxisFault {
@@ -88,7 +81,7 @@
 	// will not be confused
 	private void cleanStorage(StorageManager storageManager) throws AxisFault {
 
-		storageManager.initStorage();
+		
 
 		// server side cleaning
 

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/TerminateManager.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/TerminateManager.java?rev=372216&r1=372215&r2=372216&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/TerminateManager.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/TerminateManager.java Wed Jan 25 05:59:28 2006
@@ -22,11 +22,7 @@
 import java.util.HashMap;
 import java.util.Iterator;
 
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.Constants;
-import org.apache.axis2.client.ListenerManager;
 import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.MessageContextConstants;
 import org.apache.sandesha2.storage.StorageManager;
 import org.apache.sandesha2.storage.Transaction;
 import org.apache.sandesha2.storage.beanmanagers.CreateSeqBeanMgr;

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/SandeshaGlobalInHandler.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/SandeshaGlobalInHandler.java?rev=372216&r1=372215&r2=372216&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/SandeshaGlobalInHandler.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/SandeshaGlobalInHandler.java Wed Jan 25 05:59:28 2006
@@ -25,7 +25,6 @@
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.context.ServiceContext;
 import org.apache.axis2.engine.AxisEngine;
 import org.apache.axis2.handlers.AbstractHandler;
 import org.apache.axis2.soap.SOAPBody;
@@ -62,6 +61,7 @@
 		if (!isRMGlobalMessage) {
 			return;
 		}
+		
 
 		FaultManager faultManager = new FaultManager();
 		RMMsgContext faultMessageContext = faultManager
@@ -77,12 +77,6 @@
 		RMMsgContext rmMessageContext = MsgInitializer
 				.initializeMessage(msgContext);
 
-		ConfigurationContext context = rmMessageContext.getMessageContext()
-				.getConfigurationContext();
-
-		ServiceContext serviceContext = msgContext.getServiceContext();
-		Object debug = null;
-
 		//Dropping duplicates
 		boolean dropped = dropIfDuplicate(rmMessageContext);
 		if (dropped) {
@@ -90,6 +84,11 @@
 			return;
 		}
 
+        //Persisting the application messages	
+//		if (rmMessageContext.getMessageType()==Sandesha2Constants.MessageTypes.APPLICATION) {
+//			SandeshaUtil.PersistMessageContext ()
+//		}
+		
 		//Process if global processing possible. - Currently none
 		if (SandeshaUtil.isGloballyProcessableMessageType(rmMessageContext
 				.getMessageType())) {

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/SandeshaOutHandler.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/SandeshaOutHandler.java?rev=372216&r1=372215&r2=372216&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/SandeshaOutHandler.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/SandeshaOutHandler.java Wed Jan 25 05:59:28 2006
@@ -29,10 +29,12 @@
 import org.apache.axis2.context.OperationContextFactory;
 import org.apache.axis2.context.ServiceContext;
 import org.apache.axis2.description.AxisService;
+import org.apache.axis2.engine.AxisEngine;
 import org.apache.axis2.handlers.AbstractHandler;
 import org.apache.axis2.soap.SOAPBody;
 import org.apache.axis2.soap.SOAPEnvelope;
 import org.apache.axis2.soap.SOAPFactory;
+import org.apache.axis2.transport.TransportSender;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.sandesha2.RMMsgContext;
@@ -48,6 +50,7 @@
 import org.apache.sandesha2.storage.beans.CreateSeqBean;
 import org.apache.sandesha2.storage.beans.SenderBean;
 import org.apache.sandesha2.storage.beans.SequencePropertyBean;
+import org.apache.sandesha2.transport.Sandesha2TransportSender;
 import org.apache.sandesha2.util.MsgInitializer;
 import org.apache.sandesha2.util.RMMsgCreator;
 import org.apache.sandesha2.util.RMPolicyManager;
@@ -102,8 +105,6 @@
 		StorageManager storageManager = SandeshaUtil
 		.getSandeshaStorageManager(context);
 		
-		Transaction transaction = storageManager.getTransaction();
-		
 		ServiceContext serviceContext = msgCtx.getServiceContext();
 		OperationContext operationContext = msgCtx.getOperationContext();
 
@@ -120,6 +121,8 @@
 		SequencePropertyBeanMgr seqPropMgr = storageManager
 				.getSequencePropretyBeanMgr();
 
+		Transaction transaction = storageManager.getTransaction();
+		
 		boolean serverSide = msgCtx.isServerSide();
 
 		//setting message Id if null
@@ -289,12 +292,16 @@
 
 					}
 				}
+				
+				transaction.commit();
+				
 				addCreateSequenceMessage(rmMsgCtx, internalSequenceId, acksTo);
 			}
 		}
 
 		//do response processing
-
+		Transaction responseProcessTransaction = storageManager.getTransaction();
+		
 		SOAPEnvelope env = rmMsgCtx.getSOAPEnvelope();
 		if (env == null) {
 			SOAPEnvelope envelope = SOAPAbstractFactory.getSOAPFactory(
@@ -357,10 +364,11 @@
 
 		}
 
+		//cannot pause since the message have to be saved at the sender
 		//pausing the message
-		msgCtx.pause();
+		//msgCtx.pause();
 		
-		transaction.commit();
+		responseProcessTransaction.commit();
 	}
 
 	public void addCreateSequenceMessage(RMMsgContext applicationRMMsg,
@@ -383,6 +391,14 @@
 			throw new SandeshaException(message);
 		}
 
+		StorageManager storageManager = SandeshaUtil
+		.getSandeshaStorageManager(applicationMsg
+				.getConfigurationContext());
+
+		Transaction  createSeqTransaction = storageManager.getTransaction();
+		SequencePropertyBeanMgr seqPropMgr = storageManager
+			.getSequencePropretyBeanMgr();
+
 		SequenceOffer offer = createSequencePart.getSequenceOffer();
 		if (offer != null) {
 			//Offer processing
@@ -398,13 +414,6 @@
 			offeredSequenceBean.setSequenceID(internalSequenceId);
 			offeredSequenceBean.setValue(offeredSequenceId);
 
-			StorageManager storageManager = SandeshaUtil
-					.getSandeshaStorageManager(applicationMsg
-							.getConfigurationContext());
-
-			SequencePropertyBeanMgr seqPropMgr = storageManager
-					.getSequencePropretyBeanMgr();
-
 			seqPropMgr.insert(msgsBean);
 			seqPropMgr.insert(offeredSequenceBean);
 		}
@@ -419,8 +428,6 @@
 			throw new SandeshaException(message);
 		}
 
-		StorageManager storageManager = SandeshaUtil
-				.getSandeshaStorageManager(applicationMsg.getConfigurationContext());
 		CreateSeqBeanMgr createSeqMgr = storageManager.getCreateSeqBeanMgr();
 
 		CreateSeqBean createSeqBean = new CreateSeqBean(internalSequenceId,
@@ -434,15 +441,43 @@
 		SenderBeanMgr retransmitterMgr = storageManager
 				.getRetransmitterBeanMgr();
 
-		String key = SandeshaUtil.storeMessageContext(createSeqRMMessage
-				.getMessageContext());
+		String key = SandeshaUtil.getUUID();
+
 		SenderBean createSeqEntry = new SenderBean();
 		createSeqEntry.setMessageContextRefKey(key);
 		createSeqEntry.setTimeToSend(System.currentTimeMillis());
 		createSeqEntry.setMessageID(createSeqRMMessage.getMessageId());
-		createSeqEntry.setSend(true);
+		
+		//this will be set to true in the sender
+		createSeqEntry.setSend(false);
 		createSeqEntry.setMessageType(Sandesha2Constants.MessageTypes.CREATE_SEQ); 
 		retransmitterMgr.insert(createSeqEntry);
+		createSeqTransaction.commit();
+		
+		
+		//sending the message once through our sender.
+		AxisEngine engine = new AxisEngine (createSeqMsg.getConfigurationContext());
+		Sandesha2TransportSender sender = new Sandesha2TransportSender ();
+		
+		//message will be stored in the Sandesha2TransportSender
+		createSeqMsg.setProperty(Sandesha2Constants.MESSAGE_STORE_KEY,key);
+		//sender.setMessageStoreKey(key);
+		
+		TransportSender oldSender = createSeqMsg.getTransportOut().getSender();
+		createSeqMsg.setProperty(Sandesha2Constants.ORIGINAL_TRANSPORT_SENDER,oldSender);
+		createSeqMsg.setProperty(Sandesha2Constants.SET_SEND_TO_TRUE,Sandesha2Constants.VALUE_TRUE);
+		createSeqMsg.setProperty(Sandesha2Constants.MESSAGE_STORE_KEY,key);
+		
+		//setting the sandesha2 sender as the sender.
+		createSeqMsg.getTransportOut().setSender(sender);
+		
+		try {
+			log.info ("Sending create seq msg...");
+			engine.send(createSeqMsg);
+		} catch (AxisFault e) {
+			throw new SandeshaException (e.getMessage());
+		}
+		
 	}
 
 	private void processResponseMessage(RMMsgContext rmMsg,
@@ -628,9 +663,12 @@
 
 		//Retransmitter bean entry for the application message
 		SenderBean appMsgEntry = new SenderBean();
-		String key = SandeshaUtil
-				.storeMessageContext(rmMsg.getMessageContext());
-		appMsgEntry.setMessageContextRefKey(key);
+//		String key = storageManager
+//				.storeMessageContext(rmMsg.getMessageContext());
+		String storageKey = SandeshaUtil.getUUID();
+		
+		appMsgEntry.setMessageContextRefKey(storageKey);
+		
 		appMsgEntry.setTimeToSend(System.currentTimeMillis());
 		appMsgEntry.setMessageID(rmMsg.getMessageId());
 		appMsgEntry.setMessageNumber(messageNumber);
@@ -638,11 +676,32 @@
 		if (outSequenceBean == null || outSequenceBean.getValue() == null) {
 			appMsgEntry.setSend(false);
 		} else {
-			appMsgEntry.setSend(true);
-
+			appMsgEntry.setSend(false);
+			//Send will be set to true at the sender.
+			msg.setProperty(Sandesha2Constants.SET_SEND_TO_TRUE,Sandesha2Constants.VALUE_TRUE);
 		}
+		
 		appMsgEntry.setInternalSequenceID(internalSequenceId);
 		retransmitterMgr.insert(appMsgEntry);
+		
+		msg.setProperty(Sandesha2Constants.QUALIFIED_FOR_SENDING,Sandesha2Constants.VALUE_FALSE);
+		
+		//changing the sender. This will set send to true.
+		TransportSender sender = msg.getTransportOut().getSender();
+		
+
+		
+		
+		if (sender!=null) {
+			Sandesha2TransportSender sandesha2Sender = new Sandesha2TransportSender ();
+			
+			msg.setProperty(Sandesha2Constants.MESSAGE_STORE_KEY,storageKey);
+			//sandesha2Sender.setMessageStoreKey(storageKey);
+			
+			msg.getTransportOut().setSender(sandesha2Sender);
+			msg.setProperty(Sandesha2Constants.ORIGINAL_TRANSPORT_SENDER,sender);
+		}
+		
 	}
 
 	private long getNextMsgNo(ConfigurationContext context,

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/AcknowledgementProcessor.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/AcknowledgementProcessor.java?rev=372216&r1=372215&r2=372216&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/AcknowledgementProcessor.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/AcknowledgementProcessor.java Wed Jan 25 05:59:28 2006
@@ -25,6 +25,9 @@
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.context.AbstractContext;
 import org.apache.axis2.context.MessageContextConstants;
+import org.apache.axis2.description.TransportOutDescription;
+import org.apache.axis2.engine.AxisEngine;
+import org.apache.axis2.transport.TransportSender;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.sandesha2.RMMsgContext;
@@ -36,6 +39,7 @@
 import org.apache.sandesha2.storage.beanmanagers.SequencePropertyBeanMgr;
 import org.apache.sandesha2.storage.beans.SenderBean;
 import org.apache.sandesha2.storage.beans.SequencePropertyBean;
+import org.apache.sandesha2.transport.Sandesha2TransportSender;
 import org.apache.sandesha2.util.RMMsgCreator;
 import org.apache.sandesha2.util.SandeshaUtil;
 import org.apache.sandesha2.util.SequenceManager;
@@ -294,11 +298,15 @@
 			throw new SandeshaException(e.getMessage());
 		}
 
-		String key = SandeshaUtil.storeMessageContext(terminateRMMessage
-				.getMessageContext());
+		String key = SandeshaUtil.getUUID();
+		
 		SenderBean terminateBean = new SenderBean();
 		terminateBean.setMessageContextRefKey(key);
 
+		
+		
+
+		
 		//Set a retransmitter lastSentTime so that terminate will be send with
 		// some delay.
 		//Otherwise this get send before return of the current request (ack).
@@ -307,7 +315,9 @@
 				+ Sandesha2Constants.TERMINATE_DELAY);
 
 		terminateBean.setMessageID(terminateRMMessage.getMessageId());
-		terminateBean.setSend(true);
+		
+		//this will be set to true at the sender.
+		terminateBean.setSend(false);
 		terminateBean.setReSend(false);
 
 		SenderBeanMgr retramsmitterMgr = storageManager
@@ -321,6 +331,27 @@
 		terminateAdded.setValue("true");
 
 		seqPropMgr.insert(terminateAdded);
+		
+		//This should be dumped to the storage by the sender
+		TransportOutDescription transportOut = terminateRMMessage.getMessageContext().getTransportOut();
+		Sandesha2TransportSender sandesha2Sender = new Sandesha2TransportSender ();
+		TransportSender originalSender = transportOut.getSender();
+		terminateRMMessage.setProperty(Sandesha2Constants.ORIGINAL_TRANSPORT_SENDER,originalSender);
+		
+		terminateRMMessage.setProperty(Sandesha2Constants.MESSAGE_STORE_KEY,key);
+		//sandesha2Sender.setMessageStoreKey(key);
+		
+		terminateRMMessage.setProperty(Sandesha2Constants.SET_SEND_TO_TRUE,Sandesha2Constants.VALUE_TRUE);
+		
+		transportOut.setSender(sandesha2Sender);
+		
+	    AxisEngine engine = new AxisEngine (incomingAckRMMsg.getMessageContext().getConfigurationContext());
+	    try {
+			engine.send(terminateRMMessage.getMessageContext());
+		} catch (AxisFault e) {
+			throw new SandeshaException (e.getMessage());
+		}
+	    
 	}
 	
 	private static long getNoOfMessagesAcked (Iterator ackRangeIterator) {

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java?rev=372216&r1=372215&r2=372216&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java Wed Jan 25 05:59:28 2006
@@ -21,8 +21,6 @@
 import java.util.Collection;
 import java.util.Iterator;
 
-import javax.xml.namespace.QName;
-
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
 import org.apache.axis2.addressing.EndpointReference;
@@ -31,6 +29,7 @@
 import org.apache.axis2.context.OperationContext;
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisOperationFactory;
+import org.apache.axis2.description.TransportOutDescription;
 import org.apache.axis2.engine.AxisEngine;
 import org.apache.axis2.soap.SOAPEnvelope;
 import org.apache.axis2.soap.SOAPFactory;
@@ -50,6 +49,7 @@
 import org.apache.sandesha2.storage.beans.NextMsgBean;
 import org.apache.sandesha2.storage.beans.SenderBean;
 import org.apache.sandesha2.storage.beans.SequencePropertyBean;
+import org.apache.sandesha2.transport.Sandesha2TransportSender;
 import org.apache.sandesha2.util.MsgInitializer;
 import org.apache.sandesha2.util.PropertyManager;
 import org.apache.sandesha2.util.RMMsgCreator;
@@ -219,7 +219,8 @@
 
 			//saving the message.
 			try {
-				String key = SandeshaUtil.storeMessageContext(rmMsgCtx
+				String key = SandeshaUtil.getUUID();
+				storageManager.storeMessageContext(key,rmMsgCtx
 						.getMessageContext());
 				storageMapMgr.insert(new InvokerBean(key, msgNo, sequenceId));
 
@@ -384,14 +385,20 @@
 			SenderBeanMgr retransmitterBeanMgr = storageManager
 					.getRetransmitterBeanMgr();
 
-			String key = SandeshaUtil.storeMessageContext(ackMsgCtx);
+			String key = SandeshaUtil.getUUID();
+			
+			//dumping to the storage will be done be Sandesha2 Transport Sender
+			//storageManager.storeMessageContext(key,ackMsgCtx);
+			
 			SenderBean ackBean = new SenderBean();
 			ackBean.setMessageContextRefKey(key);
 			ackBean.setMessageID(ackMsgCtx.getMessageID());
 			ackBean.setReSend(false);
-			ackBean.setSend(true);
+			
+			//this will be set to true in the sender.
+			ackBean.setSend(false);
 			ackBean.setMessageType(Sandesha2Constants.MessageTypes.ACK);
-
+			
 			//the internalSequenceId value of the retransmitter Table for the
 			// messages related to an incoming
 			//sequence is the actual sequence ID
@@ -431,6 +438,24 @@
 
 			asyncAckTransaction.commit();
 
+			//passing the message through sandesha2sender
+			Sandesha2TransportSender sandesha2Sender = new Sandesha2TransportSender ();
+			TransportOutDescription transportOut = ackMsgCtx.getTransportOut();
+			ackMsgCtx.setProperty(Sandesha2Constants.ORIGINAL_TRANSPORT_SENDER,transportOut.getSender());
+			ackMsgCtx.setProperty(Sandesha2Constants.SET_SEND_TO_TRUE,Sandesha2Constants.VALUE_TRUE);
+			
+			ackMsgCtx.setProperty(Sandesha2Constants.MESSAGE_STORE_KEY,key);
+			//sandesha2Sender.setMessageStoreKey(key);
+			
+			transportOut.setSender(sandesha2Sender);
+			
+			AxisEngine engine = new AxisEngine (configCtx);
+			try {
+				engine.send(ackMsgCtx);
+			} catch (AxisFault e) {
+				throw new SandeshaException (e.getMessage());
+			}
+			
 			SandeshaUtil.startSenderForTheSequence(configCtx,sequenceId);
 		}
 

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/CreateSeqMsgProcessor.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/CreateSeqMsgProcessor.java?rev=372216&r1=372215&r2=372216&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/CreateSeqMsgProcessor.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/CreateSeqMsgProcessor.java Wed Jan 25 05:59:28 2006
@@ -17,8 +17,6 @@
 
 package org.apache.sandesha2.msgprocessors;
 
-import javax.xml.namespace.QName;
-
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.context.ConfigurationContext;
@@ -27,8 +25,8 @@
 import org.apache.axis2.util.Utils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.sandesha2.Sandesha2Constants;
 import org.apache.sandesha2.RMMsgContext;
+import org.apache.sandesha2.Sandesha2Constants;
 import org.apache.sandesha2.SandeshaException;
 import org.apache.sandesha2.storage.StorageManager;
 import org.apache.sandesha2.storage.Transaction;

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/CreateSeqResponseMsgProcessor.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/CreateSeqResponseMsgProcessor.java?rev=372216&r1=372215&r2=372216&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/CreateSeqResponseMsgProcessor.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/CreateSeqResponseMsgProcessor.java Wed Jan 25 05:59:28 2006
@@ -198,9 +198,12 @@
 
 			//updating the application message
 			String key = tempBean.getMessageContextRefKey();
-			MessageContext applicationMsg = SandeshaUtil
-					.getStoredMessageContext(key);
+			MessageContext applicationMsg = storageManager.retrieveMessageContext(key,configCtx); 
 
+			//TODO make following exception message more understandable to the user (probably some others exceptions messages as well)
+			if (applicationMsg==null)
+				throw new SandeshaException ("Unavailable application message");
+			
 			RMMsgContext applicaionRMMsg = MsgInitializer
 					.initializeMessage(applicationMsg);
 
@@ -233,6 +236,9 @@
 			//asking to send the application msssage
 			tempBean.setSend(true);
 			retransmitterMgr.update(tempBean);
+			
+			//updating the message. this will correct the SOAP envelope string.
+			storageManager.updateMessageContext(key,applicationMsg);
 		}
 
 		SequenceManager.updateLastActivatedTime(newOutSequenceId,configCtx);

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/TerminateSeqMsgProcessor.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/TerminateSeqMsgProcessor.java?rev=372216&r1=372215&r2=372216&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/TerminateSeqMsgProcessor.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/TerminateSeqMsgProcessor.java Wed Jan 25 05:59:28 2006
@@ -17,8 +17,6 @@
 
 package org.apache.sandesha2.msgprocessors;
 
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.client.ListenerManager;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.MessageContext;
 import org.apache.commons.logging.Log;

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/storage/StorageManager.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/storage/StorageManager.java?rev=372216&r1=372215&r2=372216&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/storage/StorageManager.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/storage/StorageManager.java Wed Jan 25 05:59:28 2006
@@ -18,11 +18,13 @@
 package org.apache.sandesha2.storage;
 
 import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.description.AxisModule;
 import org.apache.sandesha2.storage.beanmanagers.CreateSeqBeanMgr;
+import org.apache.sandesha2.storage.beanmanagers.InvokerBeanMgr;
 import org.apache.sandesha2.storage.beanmanagers.NextMsgBeanMgr;
 import org.apache.sandesha2.storage.beanmanagers.SenderBeanMgr;
 import org.apache.sandesha2.storage.beanmanagers.SequencePropertyBeanMgr;
-import org.apache.sandesha2.storage.beanmanagers.InvokerBeanMgr;
 
 /**
  * Storage managers should extend this.
@@ -48,7 +50,7 @@
 			this.context = context;
 	}
 	
-	public abstract void initStorage ();
+	public abstract void initStorage (AxisModule moduleDesc) throws SandeshaStorageException;
 
 	public abstract Transaction getTransaction();
 
@@ -61,5 +63,15 @@
 	public abstract SequencePropertyBeanMgr getSequencePropretyBeanMgr();
 
 	public abstract InvokerBeanMgr getStorageMapBeanMgr();
+	
+	public abstract void storeMessageContext (String storageKey,MessageContext msgContext) throws SandeshaStorageException;
+	
+	public abstract void updateMessageContext (String storageKey,MessageContext msgContext) throws SandeshaStorageException;
+
+	public abstract MessageContext retrieveMessageContext (String storageKey, ConfigurationContext configContext) throws SandeshaStorageException;
+	
+//	public abstract void storeSOAPEnvelope (SOAPEnvelope envelope,String key) throws SandeshaStorageException;
+//	
+//	public abstract SOAPEnvelope retrieveSOAPEnvelope (String key) throws SandeshaStorageException;
 
 }

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/CreateSeqBeanMgr.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/CreateSeqBeanMgr.java?rev=372216&r1=372215&r2=372216&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/CreateSeqBeanMgr.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/CreateSeqBeanMgr.java Wed Jan 25 05:59:28 2006
@@ -22,7 +22,6 @@
 import org.apache.sandesha2.SandeshaException;
 import org.apache.sandesha2.storage.SandeshaStorageException;
 import org.apache.sandesha2.storage.beans.CreateSeqBean;
-import org.apache.sandesha2.storage.beans.SenderBean;
 
 /**
  * This is used to manage CreateSequence beans.

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/NextMsgBeanMgr.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/NextMsgBeanMgr.java?rev=372216&r1=372215&r2=372216&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/NextMsgBeanMgr.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/NextMsgBeanMgr.java Wed Jan 25 05:59:28 2006
@@ -21,7 +21,6 @@
 
 import org.apache.sandesha2.SandeshaException;
 import org.apache.sandesha2.storage.SandeshaStorageException;
-import org.apache.sandesha2.storage.beans.InvokerBean;
 import org.apache.sandesha2.storage.beans.NextMsgBean;
 
 /**

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/SenderBeanMgr.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/SenderBeanMgr.java?rev=372216&r1=372215&r2=372216&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/SenderBeanMgr.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/SenderBeanMgr.java Wed Jan 25 05:59:28 2006
@@ -21,8 +21,6 @@
 
 import org.apache.sandesha2.SandeshaException;
 import org.apache.sandesha2.storage.SandeshaStorageException;
-import org.apache.sandesha2.storage.beans.InvokerBean;
-import org.apache.sandesha2.storage.beans.NextMsgBean;
 import org.apache.sandesha2.storage.beans.SenderBean;
 
 /**
@@ -52,4 +50,5 @@
 
 	public boolean update(SenderBean bean) throws SandeshaStorageException;
 
+	public SenderBean retrieveFromMessageRefKey (String messageContextRefKey);
 }

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/SequencePropertyBeanMgr.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/SequencePropertyBeanMgr.java?rev=372216&r1=372215&r2=372216&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/SequencePropertyBeanMgr.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/SequencePropertyBeanMgr.java Wed Jan 25 05:59:28 2006
@@ -21,7 +21,6 @@
 
 import org.apache.sandesha2.SandeshaException;
 import org.apache.sandesha2.storage.SandeshaStorageException;
-import org.apache.sandesha2.storage.beans.SenderBean;
 import org.apache.sandesha2.storage.beans.SequencePropertyBean;
 
 /**
@@ -47,4 +46,5 @@
 
 	public boolean update(SequencePropertyBean bean) throws SandeshaStorageException;
 
+	public Collection retrieveAll ();
 }

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryInvokerBeanMgr.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryInvokerBeanMgr.java?rev=372216&r1=372215&r2=372216&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryInvokerBeanMgr.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryInvokerBeanMgr.java Wed Jan 25 05:59:28 2006
@@ -21,13 +21,13 @@
 import java.util.Collection;
 import java.util.Hashtable;
 import java.util.Iterator;
+
 import org.apache.axis2.context.AbstractContext;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.sandesha2.Sandesha2Constants;
 import org.apache.sandesha2.SandeshaException;
 import org.apache.sandesha2.storage.beanmanagers.InvokerBeanMgr;
-import org.apache.sandesha2.storage.beans.CreateSeqBean;
 import org.apache.sandesha2.storage.beans.InvokerBean;
 
 /**

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryNextMsgBeanMgr.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryNextMsgBeanMgr.java?rev=372216&r1=372215&r2=372216&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryNextMsgBeanMgr.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryNextMsgBeanMgr.java Wed Jan 25 05:59:28 2006
@@ -28,7 +28,6 @@
 import org.apache.sandesha2.Sandesha2Constants;
 import org.apache.sandesha2.SandeshaException;
 import org.apache.sandesha2.storage.beanmanagers.NextMsgBeanMgr;
-import org.apache.sandesha2.storage.beans.CreateSeqBean;
 import org.apache.sandesha2.storage.beans.NextMsgBean;
 
 /**

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemorySenderBeanMgr.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemorySenderBeanMgr.java?rev=372216&r1=372215&r2=372216&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemorySenderBeanMgr.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemorySenderBeanMgr.java Wed Jan 25 05:59:28 2006
@@ -28,7 +28,6 @@
 import org.apache.sandesha2.SandeshaException;
 import org.apache.sandesha2.storage.SandeshaStorageException;
 import org.apache.sandesha2.storage.beanmanagers.SenderBeanMgr;
-import org.apache.sandesha2.storage.beans.NextMsgBean;
 import org.apache.sandesha2.storage.beans.SenderBean;
 
 /**
@@ -188,5 +187,21 @@
 		else 
 			return null;
 	}
+
+	public SenderBean retrieveFromMessageRefKey(String messageContextRefKey) {
+		
+		Iterator iter = table.keySet().iterator();
+		while (iter.hasNext()) {
+			Object key = iter.next();
+			SenderBean bean = (SenderBean) table.get(key);
+			if (bean.getMessageContextRefKey().equals(messageContextRefKey)) {
+				return bean;
+			}
+		}
+		
+		return null;
+	}
+	
+	
 
 }

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemorySequencePropertyBeanMgr.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemorySequencePropertyBeanMgr.java?rev=372216&r1=372215&r2=372216&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemorySequencePropertyBeanMgr.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemorySequencePropertyBeanMgr.java Wed Jan 25 05:59:28 2006
@@ -28,7 +28,6 @@
 import org.apache.sandesha2.Sandesha2Constants;
 import org.apache.sandesha2.SandeshaException;
 import org.apache.sandesha2.storage.beanmanagers.SequencePropertyBeanMgr;
-import org.apache.sandesha2.storage.beans.SenderBean;
 import org.apache.sandesha2.storage.beans.SequencePropertyBean;
 
 /**
@@ -136,4 +135,17 @@
 			return null;
 	}
 
+	public Collection retrieveAll() {
+		Collection coll = new ArrayList();
+		
+		Iterator keys = table.keySet().iterator();
+		while (keys.hasNext()) {
+			Object key = keys.next();
+			coll.add(table.get(key));
+		}
+		
+		return coll;
+	}
+
+	
 }

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryStorageManager.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryStorageManager.java?rev=372216&r1=372215&r2=372216&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryStorageManager.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryStorageManager.java Wed Jan 25 05:59:28 2006
@@ -17,14 +17,21 @@
 
 package org.apache.sandesha2.storage.inmemory;
 
+import java.util.HashMap;
+
 import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.description.AxisModule;
+import org.apache.axis2.soap.SOAPEnvelope;
+import org.apache.sandesha2.storage.SandeshaStorageException;
 import org.apache.sandesha2.storage.StorageManager;
 import org.apache.sandesha2.storage.Transaction;
 import org.apache.sandesha2.storage.beanmanagers.CreateSeqBeanMgr;
+import org.apache.sandesha2.storage.beanmanagers.InvokerBeanMgr;
 import org.apache.sandesha2.storage.beanmanagers.NextMsgBeanMgr;
 import org.apache.sandesha2.storage.beanmanagers.SenderBeanMgr;
 import org.apache.sandesha2.storage.beanmanagers.SequencePropertyBeanMgr;
-import org.apache.sandesha2.storage.beanmanagers.InvokerBeanMgr;
+import org.apache.sandesha2.util.SandeshaUtil;
 
 /**
  * @author Chamikara Jayalath <chamikaramj@gmail.com>
@@ -34,7 +41,8 @@
 public class InMemoryStorageManager extends StorageManager {
 
 	private static InMemoryStorageManager instance = null;
-
+    private final String MESSAGE_MAP_KEY = "Sandesha2MessageMap";
+    
 	public InMemoryStorageManager(ConfigurationContext context) {
 		super(context);
 	}
@@ -75,7 +83,234 @@
 		return instance;
 	}
 	
-	public void  initStorage () {
+	public MessageContext retrieveMessageContext(String key,ConfigurationContext context) {
+		HashMap storageMap = (HashMap) getContext().getProperty(MESSAGE_MAP_KEY);
+		if (storageMap==null)
+			return null;
 		
+		return (MessageContext) storageMap.get(key);
 	}
+
+	public void storeMessageContext(String key,MessageContext msgContext) {
+		HashMap storageMap = (HashMap) getContext().getProperty(MESSAGE_MAP_KEY);
+		
+		if (storageMap==null) {
+			storageMap = new HashMap ();
+			getContext().setProperty(MESSAGE_MAP_KEY,storageMap);
+		}
+		
+		if (key==null)
+		    key = SandeshaUtil.getUUID();
+		
+		storageMap.put(key,msgContext);
+		
+	}
+	
+//	public MessageContext retrieveMessageContext(String key, ConfigurationContext configContext) throws SandeshaStorageException {
+//		// TODO remove this temporary method
+//		
+//	
+//		HashMap storageMap = (HashMap) getContext().getProperty(MESSAGE_MAP_KEY);
+//
+//		if (storageMap==null)
+//			return null;
+//		
+//		MessageStoreBean messageStoreBean = (MessageStoreBean) storageMap.get(key);
+//		if (messageStoreBean==null)
+//			return null;
+//		
+//		MessageContext messageContext = new MessageContext ();
+//		try {
+//			String soapEnvelopeStr = messageStoreBean.getSOAPEnvelopeString();
+//			StringReader strReader = new StringReader (soapEnvelopeStr);
+//			
+//			XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(strReader);
+//			
+//			SOAPFactory factory = null;
+//			if (messageStoreBean.getSOAPVersion()==Sandesha2Constants.SOAPVersion.v1_1) {
+//				factory = OMAbstractFactory.getSOAP11Factory();
+//			} else if (messageStoreBean.getSOAPVersion()==Sandesha2Constants.SOAPVersion.v1_2) {
+//				factory = OMAbstractFactory.getSOAP12Factory();
+//			} else {
+//				throw new SandeshaStorageException ("Unknows SOAP version");
+//			}
+//			
+//			//TODO make this SOAP version indipendent
+//			OMXMLParserWrapper wrapper = OMXMLBuilderFactory.createStAXSOAPModelBuilder(
+//			        factory, reader);
+//			SOAPEnvelope envelope = (SOAPEnvelope) wrapper.getDocumentElement();
+//			messageContext.setEnvelope(envelope);
+//			
+//			AxisConfiguration axisConfiguration = configContext.getAxisConfiguration();
+//			
+//			String transportOutStr = messageStoreBean.getTransportOut();
+//			if (transportOutStr!=null) {
+//				QName transportOutName = SandeshaUtil.getQNameFromString(transportOutStr);
+//				TransportOutDescription transportOut = configContext.getAxisConfiguration().getTransportOut(transportOutName);
+//				messageContext.setTransportOut(transportOut);
+//			}
+//			
+//			String serviceGroupName = messageStoreBean.getAxisServiceGroup();
+//			if (serviceGroupName!=null) {
+//				AxisServiceGroup serviceGroup = axisConfiguration.getServiceGroup(serviceGroupName);
+//				if (serviceGroup!=null)
+//					messageContext.setAxisServiceGroup(serviceGroup);
+//			} else {
+//				AxisServiceGroup serviceGroup = new AxisServiceGroup (axisConfiguration);
+//				messageContext.setAxisServiceGroup(serviceGroup);
+//			}
+//			
+//			String serviceName = messageStoreBean.getAxisService();
+//			if (serviceName!=null) {
+//				AxisService service = axisConfiguration.getService(serviceName);
+//				if (service!=null)
+//					messageContext.setAxisService(service);
+//			}
+//			
+//			String operationNameStr = messageStoreBean.getAxisOperation();
+//			String operationMEPStr = messageStoreBean.getAxisOperationMEP();
+//			if ((operationNameStr!=null || operationMEPStr!=null) && messageContext.getAxisService()!=null) {
+//				
+//				AxisOperation operation = null;
+//				if (operationNameStr!=null) {
+//					QName operationName = SandeshaUtil.getQNameFromString(operationNameStr);
+//					operation = messageContext.getAxisService().getOperation(operationName);
+//				}
+//				
+//				if (operation==null && operationMEPStr!=null)
+//					operation = AxisOperationFactory.getOperationDescription(operationMEPStr);
+//				
+//				if (operation!=null) {
+//					messageContext.setAxisOperation(operation);
+//					
+//					//TODO set the correct message receiver.	
+//					MessageReceiver messageReceiver = axisConfiguration.getMessageReceiver(messageStoreBean.getAxisOperationMEP());
+//
+//				}
+//			}
+//			
+//			
+//			//setting contexts TODO is this necessary?
+//			if (messageContext.getAxisServiceGroup()!=null){
+//				ServiceGroupContext serviceGroupCtx = new ServiceGroupContext (configContext,messageContext.getAxisServiceGroup());
+//				messageContext.setServiceGroupContext(serviceGroupCtx);
+//			}
+//			
+//			if (messageContext.getAxisService()!=null) {
+//				ServiceContext serviceContext = new ServiceContext (messageContext.getAxisService(),messageContext.getServiceGroupContext());
+//				serviceContext.setParent(messageContext.getServiceGroupContext());
+//				messageContext.setServiceContext(serviceContext);
+//			}
+//			
+//			if (messageContext.getAxisOperation()!=null) {
+//				OperationContext operationContext = new OperationContext (messageContext.getAxisOperation());
+//				operationContext.setParent(messageContext.getServiceContext());
+//				messageContext.setOperationContext(operationContext);
+//			}
+//			
+//			
+//			messageContext.setServerSide(messageStoreBean.isServerSide());
+//			messageContext.setFLOW(messageStoreBean.getFlow());
+//			
+//			messageContext.setProperty(MessageContextConstants.TRANSPORT_URL,messageStoreBean.getTransportTo());
+//			messageContext.setTo(new EndpointReference (messageStoreBean.getToURL()));
+//			
+//		} catch (XMLStreamException e) {
+//			throw new SandeshaStorageException (e.getMessage());
+//		} catch (FactoryConfigurationError e) {
+//			throw new SandeshaStorageException (e.getMessage());
+//		} catch (AxisFault e) {
+//			throw new SandeshaStorageException (e.getMessage());
+//		}
+//         
+//		return messageContext;
+//	}
+//
+//	public void storeMessageContext(String key,MessageContext msgContext) {
+//		// TODO Auto-generated method stub
+//		
+//		HashMap storageMap = (HashMap) getContext().getProperty(MESSAGE_MAP_KEY);
+//		
+//		if (storageMap==null) {
+//			storageMap = new HashMap ();
+//			getContext().setProperty(MESSAGE_MAP_KEY,storageMap);
+//		}
+//		
+//		SOAPEnvelope envelope = msgContext.getEnvelope();
+//		String str = envelope.toString();
+//		
+//		int SOAPVersion = 0;
+//		if (msgContext.isSOAP11())
+//			SOAPVersion = Sandesha2Constants.SOAPVersion.v1_1;
+//		else
+//			SOAPVersion = Sandesha2Constants.SOAPVersion.v1_2;
+//				
+//		MessageStoreBean bean = new MessageStoreBean ();
+//		
+//		TransportOutDescription transportOutDescription = msgContext.getTransportOut();
+//		AxisServiceGroup serviceGroup = msgContext.getAxisServiceGroup();
+//		AxisService service = msgContext.getAxisService();
+//		AxisOperation operation = msgContext.getAxisOperation();
+//		
+//		if (transportOutDescription!=null) {
+//			QName name = transportOutDescription.getName();
+//			bean.setTransportOut(SandeshaUtil.getStringFromQName(name));
+//		}
+//		
+//		if (serviceGroup!=null) {
+//			bean.setAxisServiceGroup(serviceGroup.getServiceGroupName());
+//		}
+//		
+//		if (service!=null) {
+//			bean.setAxisService(service.getName());
+//		}
+//		
+//		if (operation!=null) {
+//			QName name = operation.getName();
+//			if (name!=null)
+//				bean.setAxisOperation(SandeshaUtil.getStringFromQName(name));
+//			bean.setAxisOperationMEP(operation.getMessageExchangePattern());
+//		}
+//		
+//		bean.setFlow(msgContext.getFLOW());
+//		bean.setServerSide(msgContext.isServerSide());
+//		
+//		bean.setStoredKey(key);
+//		bean.setSOAPEnvelopeString(str);
+//		bean.setSOAPVersion(SOAPVersion);
+//
+//		bean.setToURL(msgContext.getTo().getAddress());
+//		bean.setTransportTo((String) msgContext.getProperty(MessageContextConstants.TRANSPORT_URL));
+//				
+//		storageMap.put(key,bean);
+//	}
+
+	public void updateMessageContext(String key,MessageContext msgContext) throws SandeshaStorageException { 
+		HashMap storageMap = (HashMap) getContext().getProperty(MESSAGE_MAP_KEY);
+		
+		if (storageMap==null) {
+			throw new SandeshaStorageException ("Storage Map not present");
+		}
+		
+		Object oldEntry = storageMap.get(key);
+		if (oldEntry==null)
+			throw new SandeshaStorageException ("En try is not present for updating");
+		
+		storeMessageContext(key,msgContext);
+	}
+	
+	public void  initStorage (AxisModule moduleDesc) {
+		
+	}
+
+	public SOAPEnvelope retrieveSOAPEnvelope(String key) throws SandeshaStorageException {
+		// TODO no real value
+		return null;
+	}
+
+	public void storeSOAPEnvelope(SOAPEnvelope envelope, String key) throws SandeshaStorageException {
+		// TODO no real value
+	}
+	
+	
 }

Added: webservices/sandesha/trunk/src/org/apache/sandesha2/transport/Sandesha2TransportSender.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/transport/Sandesha2TransportSender.java?rev=372216&view=auto
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/transport/Sandesha2TransportSender.java (added)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/transport/Sandesha2TransportSender.java Wed Jan 25 05:59:28 2006
@@ -0,0 +1,83 @@
+package org.apache.sandesha2.transport;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.description.HandlerDescription;
+import org.apache.axis2.description.Parameter;
+import org.apache.axis2.description.TransportOutDescription;
+import org.apache.axis2.transport.TransportSender;
+import org.apache.sandesha2.RMMsgContext;
+import org.apache.sandesha2.Sandesha2Constants;
+import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.storage.StorageManager;
+import org.apache.sandesha2.storage.Transaction;
+import org.apache.sandesha2.storage.beanmanagers.SenderBeanMgr;
+import org.apache.sandesha2.storage.beans.SenderBean;
+import org.apache.sandesha2.util.MsgInitializer;
+import org.apache.sandesha2.util.SandeshaUtil;
+
+public class Sandesha2TransportSender implements TransportSender  {
+
+	private String messageStoreKey = null;
+	
+	public void invoke(MessageContext msgContext) throws AxisFault {
+		
+		//setting the correct transport sender.
+		TransportSender sender = (TransportSender) msgContext.getProperty(Sandesha2Constants.ORIGINAL_TRANSPORT_SENDER);
+		
+		if (sender==null)
+			throw new SandeshaException ("Original transport sender is not present");
+		
+		msgContext.getTransportOut().setSender(sender);
+		
+		String key =  (String) msgContext.getProperty(Sandesha2Constants.MESSAGE_STORE_KEY);
+		
+		if (key==null)
+			throw new SandeshaException ("Cant store message without the storage key");
+		
+		ConfigurationContext configurationContext = msgContext.getConfigurationContext();
+		StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configurationContext);
+		
+		Transaction messageStoreTransaction = storageManager.getTransaction();
+		storageManager.storeMessageContext(key,msgContext);
+		messageStoreTransaction.commit();
+		
+		Transaction transaction = storageManager.getTransaction();
+		//setting send=true (if requestd) for the message.
+		SenderBeanMgr senderBeanMgr = storageManager.getRetransmitterBeanMgr();
+
+		RMMsgContext rmMsg = MsgInitializer.initializeMessage(msgContext);
+		
+		SenderBean senderBean = senderBeanMgr.retrieveFromMessageRefKey(key);
+
+	 	String setSendToTrue = (String) msgContext.getProperty(Sandesha2Constants.SET_SEND_TO_TRUE);
+		if (Sandesha2Constants.VALUE_TRUE.equals(setSendToTrue)) {
+
+			senderBean.setSend(true);
+			senderBeanMgr.update(senderBean);
+		}
+		
+		transaction.commit();
+		
+		msgContext.setProperty(Sandesha2Constants.QUALIFIED_FOR_SENDING,Sandesha2Constants.VALUE_TRUE);
+	}
+
+	//Below methods are not used
+	public void cleanUp(MessageContext msgContext) throws AxisFault {}
+
+	public void init(ConfigurationContext confContext, TransportOutDescription transportOut) throws AxisFault {}
+
+	public void cleanup() throws AxisFault {}
+
+	public HandlerDescription getHandlerDesc() {return null;}
+
+	public QName getName() { return null;}
+
+	public Parameter getParameter(String name) {  return null; }
+
+	public void init(HandlerDescription handlerdesc) {}
+
+}

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/util/FaultManager.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/util/FaultManager.java?rev=372216&r1=372215&r2=372216&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/util/FaultManager.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/util/FaultManager.java Wed Jan 25 05:59:28 2006
@@ -26,6 +26,8 @@
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.context.OperationContext;
+import org.apache.axis2.context.ServiceContext;
+import org.apache.axis2.context.ServiceGroupContext;
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisOperationFactory;
 import org.apache.axis2.om.OMElement;
@@ -395,6 +397,22 @@
 
 			MessageContext referenceMessage = referenceRMMsgContext
 					.getMessageContext();
+			
+			//This is to hack to remove NPE. TODO remove this.
+			if (referenceMessage.getServiceGroupContext()==null) {
+				ServiceGroupContext serviceGroupContext = new ServiceGroupContext (referenceMessage.getConfigurationContext(),referenceMessage.getAxisServiceGroup()); 
+				referenceMessage.setServiceGroupContext(serviceGroupContext);
+			}
+			if (referenceMessage.getServiceContext()==null) {
+				ServiceContext serviceContext = new ServiceContext (
+						referenceMessage.getAxisService(),
+								referenceMessage.getServiceGroupContext());
+				referenceMessage.setServiceContext(serviceContext);
+			}
+			
+			//end hack
+			
+			
 			MessageContext faultMsgContext = Utils
 					.createOutMessageContext(referenceMessage);
 

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/util/MessageRetransmissionAdjuster.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/util/MessageRetransmissionAdjuster.java?rev=372216&r1=372215&r2=372216&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/util/MessageRetransmissionAdjuster.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/util/MessageRetransmissionAdjuster.java Wed Jan 25 05:59:28 2006
@@ -17,9 +17,12 @@
 
 package org.apache.sandesha2.util;
 
+import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.MessageContext;
 import org.apache.sandesha2.Sandesha2Constants;
+import org.apache.sandesha2.SandeshaException;
 import org.apache.sandesha2.policy.RMPolicyBean;
+import org.apache.sandesha2.storage.StorageManager;
 import org.apache.sandesha2.storage.beans.SenderBean;
 
 /**
@@ -31,14 +34,15 @@
 public class MessageRetransmissionAdjuster {
 
 	public SenderBean adjustRetransmittion(
-			SenderBean retransmitterBean) {
+			SenderBean retransmitterBean,ConfigurationContext configContext) throws SandeshaException {
+		StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configContext);
+		
 		String storedKey = (String) retransmitterBean.getMessageContextRefKey();
 
 		if (storedKey == null)
 			return retransmitterBean;
 
-		MessageContext messageContext = SandeshaUtil
-				.getStoredMessageContext(storedKey);
+		MessageContext messageContext = storageManager.retrieveMessageContext(storedKey,configContext);
 
 		if (messageContext.getConfigurationContext() == null)
 			return retransmitterBean;

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/util/PropertyManager.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/util/PropertyManager.java?rev=372216&r1=372215&r2=372216&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/util/PropertyManager.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/util/PropertyManager.java Wed Jan 25 05:59:28 2006
@@ -23,7 +23,7 @@
 import java.util.Iterator;
 import java.util.Properties;
 
-import org.apache.axis2.description.ModuleDescription;
+import org.apache.axis2.description.AxisModule;
 import org.apache.axis2.description.Parameter;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -129,7 +129,40 @@
 		}
 	}
 
-	public void loadPropertiesFromModuleDesc(ModuleDescription desc)
+	public void loadPropertiesFromModuleDesc (AxisModule desc) {
+		
+		Parameter expoBackoffParam = desc.getParameter (Sandesha2Constants.Properties.ExponentialBackoff);
+		String expoBackoffStr = (String) expoBackoffParam.getValue();
+		loadExponentialBackoff(expoBackoffStr);
+		
+		Parameter retransmissionIntParam = desc.getParameter (Sandesha2Constants.Properties.RetransmissionInterval);
+		String retransmissionIntStr = (String) retransmissionIntParam.getValue();
+		loadRetransmissionInterval(retransmissionIntStr);
+		
+		Parameter acknowledgementIntParam = desc.getParameter(Sandesha2Constants.Properties.AcknowledgementInterval);
+		String acknowledgementIntStr = (String) acknowledgementIntParam.getValue();
+		loadAcknowledgementInterval(acknowledgementIntStr);		
+		
+		Parameter inactivityTimeoutParam = desc.getParameter(Sandesha2Constants.Properties.InactivityTimeout);
+		String inactivityTimeoutStr = (String) inactivityTimeoutParam.getValue();
+		Parameter inactivityTimeoutMeasureParam = desc.getParameter(Sandesha2Constants.Properties.InactivityTimeoutMeasure);
+		String inactivityTimeoutMeasure = (String) inactivityTimeoutMeasureParam.getValue();
+		loadInactivityTimeout(inactivityTimeoutStr,inactivityTimeoutMeasure);
+		
+		Parameter storageMgrClassParam = desc.getParameter(Sandesha2Constants.Properties.StorageManager);
+		String storageMgrClassStr = (String) storageMgrClassParam.getValue();
+		loadStoragemanagerClass(storageMgrClassStr);
+		
+		Parameter inOrderInvocationParam = desc.getParameter(Sandesha2Constants.Properties.InOrderInvocation);
+		String inOrderInvocation = (String) inOrderInvocationParam.getValue();
+		loadInOrderInvocation (inOrderInvocation);
+		
+		Parameter messageTypesToDropParam = desc.getParameter(Sandesha2Constants.Properties.MessageTypesToDrop); 
+		String messageTypesToDrop = (String) messageTypesToDropParam.getValue();
+		loadMessageTypesToDrop (messageTypesToDrop);
+	}
+	
+	public void loadPropertiesFromModuleDescPolicy(AxisModule desc)
 			throws SandeshaException {
 		Policy policy = desc.getPolicyInclude().getEffectivePolicy();
 

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/util/SandeshaUtil.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/util/SandeshaUtil.java?rev=372216&r1=372215&r2=372216&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/util/SandeshaUtil.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/util/SandeshaUtil.java Wed Jan 25 05:59:28 2006
@@ -19,7 +19,6 @@
 import java.lang.reflect.Constructor;
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.StringTokenizer;
 
@@ -37,6 +36,7 @@
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.AxisServiceGroup;
 import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.engine.Handler;
 import org.apache.axis2.om.OMElement;
 import org.apache.axis2.soap.SOAP11Constants;
 import org.apache.axis2.soap.SOAP12Constants;
@@ -65,7 +65,7 @@
 
 public class SandeshaUtil {
 
-	private static Hashtable storedMsgContexts = new Hashtable();
+	//private static Hashtable storedMsgContexts = new Hashtable();
 
 	private static StorageManager storageManager = null;
 
@@ -189,36 +189,36 @@
 		return sortedList;
 	}
 
-	/**
-	 * Used to store message context objects. Currently they are stored in a in-memory HashMap.
-	 * Returned key can be used to retrieve the message context.
-	 * 
-	 * @param ctx
-	 * @return
-	 * @throws SandeshaException
-	 */
-	public static String storeMessageContext(MessageContext ctx)
-			throws SandeshaException {
-		if (ctx == null) {
-			String message = "Stored Msg Ctx is null";
-			log.debug(message);
-			throw new SandeshaException(message);
-		}
-
-		String key = getUUID();
-		storedMsgContexts.put(key, ctx);
-		return key;
-	}
-
-	/**
-	 * Retrieve the MessageContexts saved by the above method.
-	 * 
-	 * @param key
-	 * @return
-	 */
-	public static MessageContext getStoredMessageContext(String key) {
-		return (MessageContext) storedMsgContexts.get(key);
-	}
+//	/**
+//	 * Used to store message context objects. Currently they are stored in a in-memory HashMap.
+//	 * Returned key can be used to retrieve the message context.
+//	 * 
+//	 * @param ctx
+//	 * @return
+//	 * @throws SandeshaException
+//	 */
+//	public static String storeMessageContext(MessageContext ctx)
+//			throws SandeshaException {
+//		if (ctx == null) {
+//			String message = "Stored Msg Ctx is null";
+//			log.debug(message);
+//			throw new SandeshaException(message);
+//		}
+//
+//		String key = getUUID();
+//		storedMsgContexts.put(key, ctx);
+//		return key;
+//	}
+	
+//	/**
+//	 * Retrieve the MessageContexts saved by the above method.
+//	 * 
+//	 * @param key
+//	 * @return
+//	 */
+//	public static MessageContext getStoredMessageContext(String key) {
+//		return (MessageContext) storedMsgContexts.get(key);
+//	}
 
 	public static void startSenderForTheSequence(ConfigurationContext context, String sequenceID) {
 		sender.runSenderForTheSequence (context,sequenceID);
@@ -612,7 +612,7 @@
 		else if (sequenceKey==null)
 			return to;
 		else 
-			return to + ":" +sequenceKey;
+			return Sandesha2Constants.INTERNAL_SEQUENCE_PREFIX + ":" + to + ":" +sequenceKey;
 	}
 	
 //	public static String getServerSideInternalSeqID (String incomingSeqId) {
@@ -631,6 +631,98 @@
 			sequeunceID = outSequenceBean.getValue();
 		
 		return sequeunceID;
+	}
+		
+	public static QName getQNameFromString (String qnameStr) throws SandeshaException {
+		String[] parts = qnameStr.split(Sandesha2Constants.QNAME_SEPERATOR);
+		if (!(parts.length==3))
+			throw new SandeshaException ("Invalid QName String");
+		
+		if (parts[0].equals(Sandesha2Constants.VALUE_NONE))
+			parts[0]=null;
+		
+		if (parts[1].equals(Sandesha2Constants.VALUE_NONE))
+			parts[1]=null;
+		
+		if (parts[2].equals(Sandesha2Constants.VALUE_NONE))
+			parts[2]=null;
+		
+		if (parts[0].equals(Sandesha2Constants.VALUE_EMPTY))
+			parts[0]="";
+		
+		if (parts[1].equals(Sandesha2Constants.VALUE_EMPTY))
+			parts[1]="";
+		
+		if (parts[2].equals(Sandesha2Constants.VALUE_EMPTY))
+			parts[2]="";
+		
+		String namespace = parts[0];
+		String localPart = parts[1];
+		String prefix = parts[2];
+		
+		QName name = new QName (namespace, localPart,prefix);
+		return name;
+	}
+	
+	public static String getStringFromQName (QName name) {
+		String localPart = name.getLocalPart();
+		String namespace = name.getNamespaceURI();
+		String prefix = name.getPrefix();
+		
+		if (localPart==null)
+			localPart = Sandesha2Constants.VALUE_NONE;
+
+		if (namespace==null)
+			namespace = Sandesha2Constants.VALUE_NONE;
+		
+		if (prefix==null)
+			prefix = Sandesha2Constants.VALUE_NONE;
+		
+		if ("".equals(localPart))
+			localPart = Sandesha2Constants.VALUE_EMPTY;
+
+		if ("".equals(namespace))
+			namespace = Sandesha2Constants.VALUE_EMPTY;
+		
+		if ("".equals(prefix))
+			prefix = Sandesha2Constants.VALUE_EMPTY;
+		
+		String QNameStr = namespace + Sandesha2Constants.QNAME_SEPERATOR + localPart + Sandesha2Constants.QNAME_SEPERATOR 
+								+ prefix;
+		
+		return QNameStr;
+	}
+	
+	public static String getExecutionChainString (ArrayList executionChain) {
+		Iterator iter = executionChain.iterator();
+		
+		String executionChainStr = "";
+		while (iter.hasNext()) {
+			Handler handler = (Handler) iter.next();
+			QName name = handler.getName();
+			String handlerStr = SandeshaUtil.getStringFromQName(name);
+			executionChainStr = executionChainStr + Sandesha2Constants.EXECUTIN_CHAIN_SEPERATOR + handlerStr;
+		}
+		
+		return executionChainStr;
+	}
+	
+	
+	//TODO complete below.
+	public static ArrayList getExecutionChainFromString (String executionChainStr, ConfigurationContext configContext) throws SandeshaException {
+		String[] QNameStrs = executionChainStr.split(Sandesha2Constants.EXECUTIN_CHAIN_SEPERATOR);
+		
+		AxisConfiguration axisConfiguration = configContext.getAxisConfiguration();
+		
+		int length = QNameStrs.length;
+		for (int i=0;i<length;i++) {
+			String QNameStr = QNameStrs[i];
+			QName name = getQNameFromString(QNameStr);
+			//axisConfiguration.get
+			
+		}
+		
+		return null;  //not complete yet.
 	}
 
 }

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/util/SequenceManager.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/util/SequenceManager.java?rev=372216&r1=372215&r2=372216&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/util/SequenceManager.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/util/SequenceManager.java Wed Jan 25 05:59:28 2006
@@ -6,13 +6,11 @@
  */
 package org.apache.sandesha2.util;
 
-import java.net.BindException;
 import java.util.Collection;
 import java.util.StringTokenizer;
 
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.ListenerManager;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.context.MessageContextConstants;

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/workers/InOrderInvoker.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/workers/InOrderInvoker.java?rev=372216&r1=372215&r2=372216&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/workers/InOrderInvoker.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/workers/InOrderInvoker.java Wed Jan 25 05:59:28 2006
@@ -19,25 +19,24 @@
 
 import java.util.ArrayList;
 import java.util.Iterator;
+
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.context.ServiceContext;
 import org.apache.axis2.engine.AxisEngine;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.sandesha2.Sandesha2Constants;
 import org.apache.sandesha2.RMMsgContext;
+import org.apache.sandesha2.Sandesha2Constants;
 import org.apache.sandesha2.SandeshaException;
 import org.apache.sandesha2.TerminateManager;
-import org.apache.sandesha2.client.Sandesha2ClientAPI;
 import org.apache.sandesha2.storage.StorageManager;
+import org.apache.sandesha2.storage.beanmanagers.InvokerBeanMgr;
 import org.apache.sandesha2.storage.beanmanagers.NextMsgBeanMgr;
 import org.apache.sandesha2.storage.beanmanagers.SequencePropertyBeanMgr;
-import org.apache.sandesha2.storage.beanmanagers.InvokerBeanMgr;
+import org.apache.sandesha2.storage.beans.InvokerBean;
 import org.apache.sandesha2.storage.beans.NextMsgBean;
 import org.apache.sandesha2.storage.beans.SequencePropertyBean;
-import org.apache.sandesha2.storage.beans.InvokerBean;
 import org.apache.sandesha2.util.MsgInitializer;
 import org.apache.sandesha2.util.SandeshaUtil;
 import org.apache.sandesha2.wsrm.Sequence;
@@ -159,13 +158,13 @@
 								.next();
 						String key = stMapBean.getMessageContextRefKey();
 
-						MessageContext msgToInvoke = SandeshaUtil
-								.getStoredMessageContext(key);
+						MessageContext msgToInvoke = storageManager.retrieveMessageContext(key,context);
 
 						RMMsgContext rmMsg = MsgInitializer
 								.initializeMessage(msgToInvoke);
 						Sequence seq = (Sequence) rmMsg
 								.getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
+
 						long msgNo = seq.getMessageNumber().getMessageNumber();
 
 						try {

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/workers/Sender.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/workers/Sender.java?rev=372216&r1=372215&r2=372216&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/workers/Sender.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/workers/Sender.java Wed Jan 25 05:59:28 2006
@@ -18,15 +18,9 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashMap;
 import java.util.Iterator;
 
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamWriter;
-
 import org.apache.axis2.AxisFault;
-import org.apache.axis2.Constants;
-import org.apache.axis2.client.ListenerManager;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.context.OperationContext;
@@ -127,9 +121,17 @@
 
 					SenderBean bean = (SenderBean) iter.next();
 					String key = (String) bean.getMessageContextRefKey();
-					MessageContext msgCtx = SandeshaUtil
-							.getStoredMessageContext(key);
+					MessageContext msgCtx = storageManager.retrieveMessageContext(key,context);
 
+					//sender will not send the message if following property is 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.
+					String qualifiedForSending = (String) msgCtx.getProperty(Sandesha2Constants.QUALIFIED_FOR_SENDING);
+					if (qualifiedForSending!=null && !qualifiedForSending.equals(Sandesha2Constants.VALUE_TRUE)) {
+						continue;
+					}
+					
 					try {
 
 						if (msgCtx == null) {
@@ -166,7 +168,9 @@
 								//sequence has been timed out.
 								//do time out processing.
 								
-								TerminateManager.terminateSendingSide(context,sequenceID);
+								//TODO uncomment below line
+								//TerminateManager.terminateSendingSide(context,sequenceID);
+								
 								String message = "Sequence timed out";
 								log.debug(message);
 								throw new SandeshaException (message);
@@ -182,6 +186,10 @@
 						
 						preSendTransaction.commit();
 						
+						if (rmMsgCtx.getMessageType()==Sandesha2Constants.MessageTypes.TERMINATE_SEQ) {
+							int i =1;
+						}
+						
 						try {
 							//every message should be resumed (pause==false) when sending
 							boolean paused = msgCtx.isPaused();
@@ -201,8 +209,8 @@
 							log.debug(message);
 							log.debug(e.getMessage());
 
-						}
-						
+						} 
+												
 						Transaction postSendTransaction = storageManager.getTransaction();
 
 						MessageRetransmissionAdjuster retransmitterAdjuster = new MessageRetransmissionAdjuster();
@@ -214,8 +222,9 @@
 									.getMessageNumber();
 						}
 
-						retransmitterAdjuster.adjustRetransmittion(bean);
+						retransmitterAdjuster.adjustRetransmittion(bean,context);
 
+							
 						//update or delete only if the object is still present.
 						SenderBean bean1 = mgr.retrieve(bean.getMessageID());
 						if (bean1 != null) {
@@ -303,7 +312,7 @@
 
 	public synchronized void runSenderForTheSequence(ConfigurationContext context, String sequenceID) {
 		
-		if (!workingSequences.contains(sequenceID))
+		if (sequenceID!=null && !workingSequences.contains(sequenceID))
 			workingSequences.add(sequenceID);
 		
 



---------------------------------------------------------------------
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