ws-sandesha-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chamik...@apache.org
Subject svn commit: r330193 [1/2] - in /webservices/sandesha/trunk/src/org/apache/sandesha2: ./ handlers/ msgprocessors/ storage/ storage/beanmanagers/ storage/beans/ storage/inmemory/ storage/persistent/ util/ workers/
Date Wed, 02 Nov 2005 05:58:32 GMT
Author: chamikara
Date: Tue Nov  1 21:56:42 2005
New Revision: 330193

URL: http://svn.apache.org/viewcvs?rev=330193&view=rev
Log:
Rearranged the Sandesha2 storage framework. Changed the storage framework to a plugable form for being able to support both persistantand in-memory.

Currently users can set a new storage framework to Sandesha2 by implementing following interfaces and abstractclasses.

Storagemanager
BeanManagers (5 classes)
Transaction

After implementing user has to add the classes to the classpath and set Constants.STORAGE_MANAGER_IMPL to the full name of the implemented StorageManager class. (we will be moving this to a sandesha-config.xml soon.)


Sandesha2 will provide two in-built storage frameworks. 
1. In memory
2. Persisntant - using derby and hybernate

Added:
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/StorageManager.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/Transaction.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/RMBeanManager.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryCreateSeqBeanMgr.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryNextMsgBeanMgr.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryRetransmitterBeanMgr.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/storage/inmemory/InMemoryStorageMapBeanMgr.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryTransaction.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/persistent/
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/persistent/PersistentCreateSeqBeanMgr.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/persistent/PersistentNextMsgBeanMgr.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/persistent/PersistentRetransmitterBeanMgr.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/persistent/PersistentSequencePropertyBeanMgr.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/persistent/PersistentStorageManager.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/persistent/PersistentStorageMapBeanMgr.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/persistent/TransactionImpl.java
Removed:
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/AbstractBeanMgrFactory.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemBeanMgrFactory.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemCreateSeqBeanMgr.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemNextMsgBeanMgr.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemRetransmitterBeanMgr.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemSequencePropretyBeanMgr.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemStorageMapBeanMgr.java
Modified:
    webservices/sandesha/trunk/src/org/apache/sandesha2/Constants.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/SandeshaGlobalInHandler.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/SandeshaInHandler.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/beanmanagers/CreateSeqBeanMgr.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/NextMsgBeanMgr.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/RetransmitterBeanMgr.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/SequencePropertyBeanMgr.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/StorageMapBeanMgr.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beans/CreateSeqBean.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beans/NextMsgBean.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beans/RMBean.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beans/RetransmitterBean.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beans/SequencePropertyBean.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beans/StorageMapBean.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/util/FaultMgr.java
    webservices/sandesha/trunk/src/org/apache/sandesha2/util/RMMsgCreator.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/Constants.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/Constants.java?rev=330193&r1=330192&r2=330193&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/Constants.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/Constants.java Tue Nov  1 21:56:42 2005
@@ -261,4 +261,6 @@
 	
 	String SANDESHA_DEBUG_MODE = "SandeshaDebugMode";
 	
+	String STORAGE_MANAGER_IMPL = "org.apache.sandesha2.storage.inmemory.InMemoryStorageManager";
+	
 }

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=330193&r1=330192&r2=330193&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/SandeshaGlobalInHandler.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/SandeshaGlobalInHandler.java Tue Nov  1 21:56:42 2005
@@ -37,11 +37,12 @@
 import org.apache.sandesha2.msgprocessors.ApplicationMsgProcessor;
 import org.apache.sandesha2.msgprocessors.MsgProcessor;
 import org.apache.sandesha2.msgprocessors.MsgProcessorFactory;
-import org.apache.sandesha2.storage.AbstractBeanMgrFactory;
+import org.apache.sandesha2.storage.StorageManager;
 import org.apache.sandesha2.storage.beanmanagers.SequencePropertyBeanMgr;
-import org.apache.sandesha2.storage.beanmanagers.StorageMapBeanMgr;
 import org.apache.sandesha2.storage.beans.SequencePropertyBean;
 import org.apache.sandesha2.storage.beans.StorageMapBean;
+import org.apache.sandesha2.storage.inmemory.InMemorySequencePropertyBeanMgr;
+import org.apache.sandesha2.storage.inmemory.InMemoryStorageMapBeanMgr;
 import org.apache.sandesha2.util.MsgInitializer;
 import org.apache.sandesha2.util.SandeshaUtil;
 import org.apache.sandesha2.wsrm.Sequence;
@@ -99,8 +100,9 @@
 			
 			long msgNo = sequence.getMessageNumber().getMessageNumber();
 			
-			if (sequenceId!=null && msgNo>0) {				
-				SequencePropertyBeanMgr seqPropMgr = AbstractBeanMgrFactory.getInstance(rmMsgContext.getContext()).getSequencePropretyBeanMgr();
+			if (sequenceId!=null && msgNo>0) {	
+				StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(rmMsgContext.getMessageContext().getSystemContext());
+				SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
 				SequencePropertyBean receivedMsgsBean = seqPropMgr.retrieve(sequenceId,Constants.SequenceProperties.RECEIVED_MESSAGES);
 				if (receivedMsgsBean!=null) {
 					String receivedMsgStr = (String) receivedMsgsBean.getValue();
@@ -130,7 +132,8 @@
 				sequenceId = sequence.getIdentifier().getIdentifier();
 			}
 			
-			SequencePropertyBeanMgr seqPropMgr = AbstractBeanMgrFactory.getInstance(rmMsgContext.getContext()).getSequencePropretyBeanMgr();
+			StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(rmMsgContext.getMessageContext().getSystemContext());
+			SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
 			SequencePropertyBean receivedMsgsBean = seqPropMgr.retrieve(sequenceId,Constants.SequenceProperties.RECEIVED_MESSAGES);
 			String receivedMsgStr = (String) receivedMsgsBean.getValue();
 			

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/SandeshaInHandler.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/SandeshaInHandler.java?rev=330193&r1=330192&r2=330193&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/SandeshaInHandler.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/SandeshaInHandler.java Tue Nov  1 21:56:42 2005
@@ -39,7 +39,7 @@
 import org.apache.sandesha2.RMMsgContext;
 import org.apache.sandesha2.msgprocessors.MsgProcessor;
 import org.apache.sandesha2.msgprocessors.MsgProcessorFactory;
-import org.apache.sandesha2.storage.beanmanagers.SequencePropertyBeanMgr;
+import org.apache.sandesha2.storage.inmemory.InMemorySequencePropertyBeanMgr;
 import org.apache.sandesha2.util.MsgInitializer;
 import org.apache.sandesha2.util.MsgValidator;
 import org.apache.sandesha2.util.SandeshaUtil;

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=330193&r1=330192&r2=330193&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/SandeshaOutHandler.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/handlers/SandeshaOutHandler.java Tue Nov  1 21:56:42 2005
@@ -36,13 +36,16 @@
 import org.apache.sandesha2.Constants;
 import org.apache.sandesha2.SandeshaException;
 import org.apache.sandesha2.RMMsgContext;
-import org.apache.sandesha2.storage.AbstractBeanMgrFactory;
+import org.apache.sandesha2.storage.StorageManager;
 import org.apache.sandesha2.storage.beanmanagers.CreateSeqBeanMgr;
 import org.apache.sandesha2.storage.beanmanagers.RetransmitterBeanMgr;
 import org.apache.sandesha2.storage.beanmanagers.SequencePropertyBeanMgr;
 import org.apache.sandesha2.storage.beans.CreateSeqBean;
 import org.apache.sandesha2.storage.beans.RetransmitterBean;
 import org.apache.sandesha2.storage.beans.SequencePropertyBean;
+import org.apache.sandesha2.storage.inmemory.InMemoryCreateSeqBeanMgr;
+import org.apache.sandesha2.storage.inmemory.InMemoryRetransmitterBeanMgr;
+import org.apache.sandesha2.storage.inmemory.InMemorySequencePropertyBeanMgr;
 import org.apache.sandesha2.util.MsgInitializer;
 import org.apache.sandesha2.util.RMMsgCreator;
 import org.apache.sandesha2.util.SOAPAbstractFactory;
@@ -131,10 +134,17 @@
 		//Strating the sender.
 		SandeshaUtil.startSenderIfStopped(context);
 
-		CreateSeqBeanMgr createSeqMgr = AbstractBeanMgrFactory.getInstance(
-				context).getCreateSeqBeanMgr();
-		SequencePropertyBeanMgr seqPropMgr = AbstractBeanMgrFactory
-				.getInstance(context).getSequencePropretyBeanMgr();
+		StorageManager storageManager = null;
+		
+		try {
+			storageManager = SandeshaUtil.getSandeshaStorageManager(context);
+		} catch (SandeshaException e2) {
+			throw new AxisFault (e2.getMessage());
+		}
+		
+		CreateSeqBeanMgr createSeqMgr = storageManager.getCreateSeqBeanMgr();
+		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
+		
 		boolean serverSide = msgCtx.isServerSide();
 
 		
@@ -411,9 +421,10 @@
 			offeredSequenceBean.setSequenceId(tempSequenceId);
 			offeredSequenceBean.setValue(offeredSequenceId);
 
-			SequencePropertyBeanMgr seqPropMgr = AbstractBeanMgrFactory
-					.getInstance(applicationMsg.getSystemContext())
-					.getSequencePropretyBeanMgr();
+			StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(applicationMsg.getSystemContext());
+			
+			SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
+			
 			seqPropMgr.insert(msgsBean);
 			seqPropMgr.insert(offeredSequenceBean);
 		}
@@ -430,14 +441,15 @@
 		if (context == null)
 			throw new SandeshaException("Context is null");
 
-		CreateSeqBeanMgr createSeqMgr = AbstractBeanMgrFactory.getInstance(
-				context).getCreateSeqBeanMgr();
+		StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(applicationMsg.getSystemContext());
+		CreateSeqBeanMgr createSeqMgr = storageManager.getCreateSeqBeanMgr();
+		
 		CreateSeqBean createSeqBean = new CreateSeqBean(tempSequenceId,
 				createSeqMsg.getMessageID(), null);
 		createSeqMgr.insert(createSeqBean);
 
-		RetransmitterBeanMgr retransmitterMgr = AbstractBeanMgrFactory
-				.getInstance(context).getRetransmitterBeanMgr();
+		RetransmitterBeanMgr retransmitterMgr = storageManager.getRetransmitterBeanMgr();
+		
 		String key = SandeshaUtil.storeMessageContext(createSeqRMMessage
 				.getMessageContext());
 		RetransmitterBean createSeqEntry = new RetransmitterBean();
@@ -461,10 +473,10 @@
 		if (context == null)
 			throw new SandeshaException("Context is null");
 
-		SequencePropertyBeanMgr sequencePropertyMgr = AbstractBeanMgrFactory
-				.getInstance(context).getSequencePropretyBeanMgr();
-		RetransmitterBeanMgr retransmitterMgr = AbstractBeanMgrFactory
-				.getInstance(context).getRetransmitterBeanMgr();
+		StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(msg.getSystemContext());
+		SequencePropertyBeanMgr sequencePropertyMgr = storageManager.getSequencePropretyBeanMgr();
+		
+		RetransmitterBeanMgr retransmitterMgr = storageManager.getRetransmitterBeanMgr();
 
 		SequencePropertyBean toBean = sequencePropertyMgr.retrieve(
 				tempSequenceId, Constants.SequenceProperties.TO_EPR);
@@ -599,10 +611,18 @@
 	}
 
 	private long getNextMsgNo(ConfigurationContext context,
-			String tempSequenceId) {
+			String tempSequenceId)  {
 		//FIXME set a correct message number.
-		SequencePropertyBeanMgr seqPropMgr = AbstractBeanMgrFactory
-				.getInstance(context).getSequencePropretyBeanMgr();
+		
+		StorageManager storageManager = null;
+		
+		try {
+			storageManager = SandeshaUtil.getSandeshaStorageManager(context);
+		} catch (SandeshaException e) {
+			e.printStackTrace();
+		}
+		
+		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
 		SequencePropertyBean nextMsgNoBean = seqPropMgr.retrieve(
 				tempSequenceId,
 				Constants.SequenceProperties.NEXT_MESSAGE_NUMBER);

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=330193&r1=330192&r2=330193&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/AcknowledgementProcessor.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/AcknowledgementProcessor.java Tue Nov  1 21:56:42 2005
@@ -36,11 +36,13 @@
 import org.apache.sandesha2.RMMsgContext;
 import org.apache.sandesha2.SandeshaException;
 import org.apache.sandesha2.handlers.SandeshaOutHandler;
-import org.apache.sandesha2.storage.AbstractBeanMgrFactory;
+import org.apache.sandesha2.storage.StorageManager;
 import org.apache.sandesha2.storage.beanmanagers.RetransmitterBeanMgr;
 import org.apache.sandesha2.storage.beanmanagers.SequencePropertyBeanMgr;
 import org.apache.sandesha2.storage.beans.RetransmitterBean;
 import org.apache.sandesha2.storage.beans.SequencePropertyBean;
+import org.apache.sandesha2.storage.inmemory.InMemoryRetransmitterBeanMgr;
+import org.apache.sandesha2.storage.inmemory.InMemorySequencePropertyBeanMgr;
 import org.apache.sandesha2.util.RMMsgCreator;
 import org.apache.sandesha2.util.SandeshaUtil;
 import org.apache.sandesha2.wsrm.AcknowledgementRange;
@@ -66,11 +68,9 @@
 		if (context == null)
 			throw new SandeshaException("Context is null");
 
-		
-		RetransmitterBeanMgr retransmitterMgr = AbstractBeanMgrFactory
-				.getInstance(context).getRetransmitterBeanMgr();
-		SequencePropertyBeanMgr seqPropMgr = AbstractBeanMgrFactory
-				.getInstance(context).getSequencePropretyBeanMgr();
+		StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(rmMsgCtx.getMessageContext().getSystemContext());
+		RetransmitterBeanMgr retransmitterMgr = storageManager.getRetransmitterBeanMgr();
+		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
 
 		Iterator ackRangeIterator = sequenceAck.getAcknowledgementRanges()
 				.iterator();
@@ -193,9 +193,9 @@
 				.createTerminateSequenceMessage(incomingAckRMMsg, outSequenceId);
 
 		//detting addressing headers.
-		SequencePropertyBeanMgr seqPropMgr = AbstractBeanMgrFactory
-				.getInstance(incomingAckRMMsg.getContext())
-				.getSequencePropretyBeanMgr();
+		StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(incomingAckRMMsg.getMessageContext().getSystemContext());
+		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
+		
 		//SequencePropertyBean replyToBean =
 		// seqPropMgr.retrieve(tempSequenceId,Constants.SequenceProperties.REPLY_TO_EPR);
 		SequencePropertyBean toBean = seqPropMgr.retrieve(tempSequenceId,
@@ -244,9 +244,7 @@
 		terminateBean.setSend(true);
 		terminateBean.setReSend(false);
 
-		RetransmitterBeanMgr retramsmitterMgr = AbstractBeanMgrFactory
-				.getInstance(incomingAckRMMsg.getContext())
-				.getRetransmitterBeanMgr();
+		RetransmitterBeanMgr retramsmitterMgr = storageManager.getRetransmitterBeanMgr();
 		retramsmitterMgr.insert(terminateBean);
 
 	}

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=330193&r1=330192&r2=330193&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java Tue Nov  1 21:56:42 2005
@@ -45,7 +45,7 @@
 import org.apache.sandesha2.SandeshaException;
 import org.apache.sandesha2.handlers.SandeshaOutHandler;
 import org.apache.sandesha2.msgreceivers.RMMessageReceiver;
-import org.apache.sandesha2.storage.AbstractBeanMgrFactory;
+import org.apache.sandesha2.storage.StorageManager;
 import org.apache.sandesha2.storage.beanmanagers.NextMsgBeanMgr;
 import org.apache.sandesha2.storage.beanmanagers.RetransmitterBeanMgr;
 import org.apache.sandesha2.storage.beanmanagers.SequencePropertyBeanMgr;
@@ -54,6 +54,10 @@
 import org.apache.sandesha2.storage.beans.RetransmitterBean;
 import org.apache.sandesha2.storage.beans.SequencePropertyBean;
 import org.apache.sandesha2.storage.beans.StorageMapBean;
+import org.apache.sandesha2.storage.inmemory.InMemoryNextMsgBeanMgr;
+import org.apache.sandesha2.storage.inmemory.InMemoryRetransmitterBeanMgr;
+import org.apache.sandesha2.storage.inmemory.InMemorySequencePropertyBeanMgr;
+import org.apache.sandesha2.storage.inmemory.InMemoryStorageMapBeanMgr;
 import org.apache.sandesha2.util.MsgInitializer;
 import org.apache.sandesha2.util.MsgValidator;
 import org.apache.sandesha2.util.RMMsgCreator;
@@ -97,9 +101,8 @@
 			return;
 		}
 
-		SequencePropertyBeanMgr seqPropMgr = AbstractBeanMgrFactory
-				.getInstance(rmMsgCtx.getContext())
-				.getSequencePropretyBeanMgr();
+		StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(rmMsgCtx.getMessageContext().getSystemContext());
+		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
 
 		//setting acked msg no range
 		Sequence sequence = (Sequence) rmMsgCtx
@@ -147,15 +150,13 @@
 		//		}
 
 		//		Pause the messages bean if not the right message to invoke.
-		NextMsgBeanMgr mgr = AbstractBeanMgrFactory.getInstance(configCtx)
-				.getNextMsgBeanMgr();
+		NextMsgBeanMgr mgr = storageManager.getNextMsgBeanMgr();
 		NextMsgBean bean = mgr.retrieve(sequenceId);
 
 		if (bean == null)
 			throw new SandeshaException("Error- The sequence does not exist");
 
-		StorageMapBeanMgr storageMapMgr = AbstractBeanMgrFactory.getInstance(
-				configCtx).getStorageMapBeanMgr();
+		StorageMapBeanMgr storageMapMgr = storageManager.getStorageMapBeanMgr();
 
 		long nextMsgno = bean.getNextMsgNoToProcess();
 
@@ -260,10 +261,8 @@
 	public void sendAckIfNeeded (RMMsgContext rmMsgCtx,String messagesStr) throws SandeshaException {
 		
 		MessageContext msgCtx = rmMsgCtx.getMessageContext();
-		
-		SequencePropertyBeanMgr seqPropMgr = AbstractBeanMgrFactory
-		.getInstance(rmMsgCtx.getContext())
-		.getSequencePropretyBeanMgr();
+		StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(msgCtx.getSystemContext());
+		SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
 		
 		
 		Sequence sequence = (Sequence) rmMsgCtx
@@ -354,7 +353,7 @@
 				throw new SandeshaException(e1.getMessage());
 			}
 		} else {
-			RetransmitterBeanMgr retransmitterBeanMgr = AbstractBeanMgrFactory.getInstance(configCtx).getRetransmitterBeanMgr();
+			RetransmitterBeanMgr retransmitterBeanMgr = storageManager.getRetransmitterBeanMgr();
 			
 			String key = SandeshaUtil.storeMessageContext(ackMsgCtx);
 			RetransmitterBean ackBean = new RetransmitterBean ();

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=330193&r1=330192&r2=330193&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/CreateSeqMsgProcessor.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/CreateSeqMsgProcessor.java Tue Nov  1 21:56:42 2005
@@ -28,11 +28,13 @@
 import org.apache.sandesha2.Constants;
 import org.apache.sandesha2.RMMsgContext;
 import org.apache.sandesha2.SandeshaException;
-import org.apache.sandesha2.storage.AbstractBeanMgrFactory;
+import org.apache.sandesha2.storage.StorageManager;
 import org.apache.sandesha2.storage.beanmanagers.CreateSeqBeanMgr;
 import org.apache.sandesha2.storage.beanmanagers.SequencePropertyBeanMgr;
 import org.apache.sandesha2.storage.beans.CreateSeqBean;
 import org.apache.sandesha2.storage.beans.SequencePropertyBean;
+import org.apache.sandesha2.storage.inmemory.InMemoryCreateSeqBeanMgr;
+import org.apache.sandesha2.storage.inmemory.InMemorySequencePropertyBeanMgr;
 import org.apache.sandesha2.util.RMMsgCreator;
 import org.apache.sandesha2.util.SandeshaUtil;
 import org.apache.sandesha2.util.SequenceManager;
@@ -90,11 +92,11 @@
 				createSeqBean.setTempSequenceId(newSequenceId);
 				createSeqBean.setCreateSeqMsgId(SandeshaUtil.getUUID());   //this is a dummy value.
 				
-				CreateSeqBeanMgr createSeqMgr = AbstractBeanMgrFactory.getInstance(context).getCreateSeqBeanMgr();
-				createSeqMgr.insert(createSeqBean);
+				StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(context);
+				CreateSeqBeanMgr createSeqMgr = storageManager.getCreateSeqBeanMgr();
 				
 				//Setting sequence properties.
-				SequencePropertyBeanMgr seqPropMgr = AbstractBeanMgrFactory.getInstance(context).getSequencePropretyBeanMgr();
+				SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
 				SequencePropertyBean outSequenceBean = new SequencePropertyBean ();
 				outSequenceBean.setName(Constants.SequenceProperties.OUT_SEQUENCE_ID);
 				outSequenceBean.setValue(outSequenceId);
@@ -125,11 +127,12 @@
 				throw new AxisFault("Acks to not present in the create sequence message");
 
 			SequencePropertyBean seqPropBean = new SequencePropertyBean(newSequenceId, Constants.SequenceProperties.ACKS_TO_EPR, acksTo);
-			//		SequencePropertyBeanMgr beanMgr = new SequencePropertyBeanMgr
+			//		InMemorySequencePropertyBeanMgr beanMgr = new InMemorySequencePropertyBeanMgr
 			// (Constants.DEFAULT_STORAGE_TYPE);
 			//		beanMgr.create(seqPropBean);
 
-			SequencePropertyBeanMgr seqPropMgr = AbstractBeanMgrFactory.getInstance(context).getSequencePropretyBeanMgr();
+			StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(context);
+			SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
 			seqPropMgr.insert(seqPropBean);
 			outMessage.setResponseWritten(true);
 

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=330193&r1=330192&r2=330193&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/CreateSeqResponseMsgProcessor.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/CreateSeqResponseMsgProcessor.java Tue Nov  1 21:56:42 2005
@@ -20,15 +20,19 @@
 import org.apache.sandesha2.Constants;
 import org.apache.sandesha2.RMMsgContext;
 import org.apache.sandesha2.SandeshaException;
-import org.apache.sandesha2.storage.AbstractBeanMgrFactory;
-import org.apache.sandesha2.storage.beans.CreateSeqBean;
-import org.apache.sandesha2.storage.beans.NextMsgBean;
-import org.apache.sandesha2.storage.beans.RetransmitterBean;
-import org.apache.sandesha2.storage.beans.SequencePropertyBean;
+import org.apache.sandesha2.storage.StorageManager;
 import org.apache.sandesha2.storage.beanmanagers.CreateSeqBeanMgr;
 import org.apache.sandesha2.storage.beanmanagers.NextMsgBeanMgr;
 import org.apache.sandesha2.storage.beanmanagers.RetransmitterBeanMgr;
 import org.apache.sandesha2.storage.beanmanagers.SequencePropertyBeanMgr;
+import org.apache.sandesha2.storage.beans.CreateSeqBean;
+import org.apache.sandesha2.storage.beans.NextMsgBean;
+import org.apache.sandesha2.storage.beans.RetransmitterBean;
+import org.apache.sandesha2.storage.beans.SequencePropertyBean;
+import org.apache.sandesha2.storage.inmemory.InMemoryCreateSeqBeanMgr;
+import org.apache.sandesha2.storage.inmemory.InMemoryNextMsgBeanMgr;
+import org.apache.sandesha2.storage.inmemory.InMemoryRetransmitterBeanMgr;
+import org.apache.sandesha2.storage.inmemory.InMemorySequencePropertyBeanMgr;
 import org.apache.sandesha2.util.MsgInitializer;
 import org.apache.sandesha2.util.SandeshaUtil;
 import org.apache.sandesha2.wsrm.Accept;
@@ -82,10 +86,11 @@
 				.getMessageContext().getSystemContext();
 		String createSeqMsgId = createSeqResponseRMMsgCtx.getMessageContext()
 				.getRelatesTo().getValue();
-		RetransmitterBeanMgr retransmitterMgr = AbstractBeanMgrFactory
-				.getInstance(configCtx).getRetransmitterBeanMgr();
-		CreateSeqBeanMgr createSeqMgr = AbstractBeanMgrFactory.getInstance(
-				configCtx).getCreateSeqBeanMgr();
+		
+		StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configCtx);
+		
+		RetransmitterBeanMgr retransmitterMgr = storageManager.getRetransmitterBeanMgr();
+		CreateSeqBeanMgr createSeqMgr = storageManager.getCreateSeqBeanMgr();
 
 		CreateSeqBean createSeqBean = createSeqMgr.retrieve(createSeqMsgId);
 		if (createSeqBean == null)
@@ -99,8 +104,7 @@
 		retransmitterMgr.delete(createSeqMsgId);
 
 		//storing new out sequence id
-		SequencePropertyBeanMgr sequencePropMgr = AbstractBeanMgrFactory
-				.getInstance(configCtx).getSequencePropretyBeanMgr();
+		SequencePropertyBeanMgr sequencePropMgr = storageManager.getSequencePropretyBeanMgr();
 		SequencePropertyBean outSequenceBean = new SequencePropertyBean(
 				tempSequenceId,
 				Constants.SequenceProperties.OUT_SEQUENCE_ID, newOutSequenceId);
@@ -134,7 +138,7 @@
 			nextMsgBean.setSequenceId(offeredSequenceId);
 			nextMsgBean.setNextMsgNoToProcess(1);
 			
-			NextMsgBeanMgr nextMsgMgr = AbstractBeanMgrFactory.getInstance(configCtx).getNextMsgBeanMgr();
+			NextMsgBeanMgr nextMsgMgr = storageManager.getNextMsgBeanMgr();
 			nextMsgMgr.insert(nextMsgBean);
 		}
 		

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=330193&r1=330192&r2=330193&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/TerminateSeqMsgProcessor.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/msgprocessors/TerminateSeqMsgProcessor.java Tue Nov  1 21:56:42 2005
@@ -26,11 +26,11 @@
 import org.apache.sandesha2.Constants;
 import org.apache.sandesha2.RMMsgContext;
 import org.apache.sandesha2.SandeshaException;
-import org.apache.sandesha2.storage.AbstractBeanMgrFactory;
-import org.apache.sandesha2.storage.beanmanagers.CreateSeqBeanMgr;
-import org.apache.sandesha2.storage.beanmanagers.NextMsgBeanMgr;
-import org.apache.sandesha2.storage.beanmanagers.SequencePropertyBeanMgr;
-import org.apache.sandesha2.storage.beanmanagers.StorageMapBeanMgr;
+import org.apache.sandesha2.storage.StorageManager;
+import org.apache.sandesha2.storage.inmemory.InMemoryCreateSeqBeanMgr;
+import org.apache.sandesha2.storage.inmemory.InMemoryNextMsgBeanMgr;
+import org.apache.sandesha2.storage.inmemory.InMemorySequencePropertyBeanMgr;
+import org.apache.sandesha2.storage.inmemory.InMemoryStorageMapBeanMgr;
 import org.apache.sandesha2.wsrm.SequenceAcknowledgement;
 import org.apache.sandesha2.wsrm.TerminateSequence;
 

Added: 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=330193&view=auto
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/storage/StorageManager.java (added)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/storage/StorageManager.java Tue Nov  1 21:56:42 2005
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ */
+
+package org.apache.sandesha2.storage;
+
+import org.apache.axis2.context.AbstractContext;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.sandesha2.Constants;
+import org.apache.sandesha2.storage.beanmanagers.CreateSeqBeanMgr;
+import org.apache.sandesha2.storage.beanmanagers.NextMsgBeanMgr;
+import org.apache.sandesha2.storage.beanmanagers.RetransmitterBeanMgr;
+import org.apache.sandesha2.storage.beanmanagers.SequencePropertyBeanMgr;
+import org.apache.sandesha2.storage.beanmanagers.StorageMapBeanMgr;
+import org.apache.sandesha2.storage.inmemory.InMemoryCreateSeqBeanMgr;
+import org.apache.sandesha2.storage.inmemory.InMemoryNextMsgBeanMgr;
+import org.apache.sandesha2.storage.inmemory.InMemoryRetransmitterBeanMgr;
+import org.apache.sandesha2.storage.inmemory.InMemorySequencePropertyBeanMgr;
+import org.apache.sandesha2.storage.inmemory.InMemoryStorageMapBeanMgr;
+
+import com.sun.corba.se.internal.core.Constant;
+
+/**
+ * @author Chamikara Jayalath <chamikara@wso2.com>
+ * @author Sanka Samaranayake <ssanka@gmail.com>
+ */
+public abstract class StorageManager {
+
+	private ConfigurationContext context;
+	
+	public StorageManager (ConfigurationContext context) {
+		this.context = context;
+	}
+	
+	public ConfigurationContext getContext () {
+		return context;
+	}
+	
+	public void setContext (ConfigurationContext context) {
+		if (context!=null)
+			this.context = context;
+	}
+	
+	public abstract Transaction getTransaction ();
+	
+	public abstract CreateSeqBeanMgr getCreateSeqBeanMgr ();
+	
+	public abstract NextMsgBeanMgr getNextMsgBeanMgr ();
+
+	public abstract RetransmitterBeanMgr getRetransmitterBeanMgr ();
+
+	public abstract SequencePropertyBeanMgr getSequencePropretyBeanMgr ();
+
+	public abstract StorageMapBeanMgr getStorageMapBeanMgr ();
+
+}
\ No newline at end of file

Added: webservices/sandesha/trunk/src/org/apache/sandesha2/storage/Transaction.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/storage/Transaction.java?rev=330193&view=auto
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/storage/Transaction.java (added)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/storage/Transaction.java Tue Nov  1 21:56:42 2005
@@ -0,0 +1,26 @@
+/*
+ * Copyright  1999-2004 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.sandesha2.storage;
+
+public interface Transaction {
+
+	public void commit ();
+	
+	public void rollback ();
+	
+}

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=330193&r1=330192&r2=330193&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 Tue Nov  1 21:56:42 2005
@@ -1,19 +1,20 @@
 /*
- * Copyright 2004,2005 The Apache Software Foundation.
+ * Copyright  1999-2004 The Apache Software Foundation.
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
  */
+
 package org.apache.sandesha2.storage.beanmanagers;
 
 import java.sql.ResultSet;
@@ -23,95 +24,25 @@
 import java.util.Iterator;
 
 import org.apache.axis2.context.AbstractContext;
-import org.apache.axis2.context.ConfigurationContext;
 import org.apache.sandesha2.Constants;
-import org.apache.sandesha2.SandeshaException;
 import org.apache.sandesha2.storage.beans.CreateSeqBean;
 
 /**
- * @author Chamikara Jayalath <chamikara@wso2.com>
- * @author Sanka Samaranayake <ssanka@gmail.com>
+ * @author Chamikara
+ * @author Sanka
  */
 
-public class CreateSeqBeanMgr {
+public interface CreateSeqBeanMgr extends RMBeanManager {
+
+	public boolean insert(CreateSeqBean bean);
+
+	public boolean delete(String msgId);
+
+	public CreateSeqBean retrieve(String msgId);
 
-	private Hashtable table = null;
+	public boolean update(CreateSeqBean bean);
 
-	
-	//TODO change the primary key.
-	//When offered. msgId==null
-	/**
-	 *  
-	 */
-	public CreateSeqBeanMgr(AbstractContext context) {
-		Object obj = context.getProperty(Constants.BeanMAPs.CREATE_SEQUECE);
-		if (obj != null) {
-			table = (Hashtable) obj;
-		} else {
-			table = new Hashtable();
-			context.setProperty(Constants.BeanMAPs.CREATE_SEQUECE, table);
-		}
-	}
-
-	public boolean insert(CreateSeqBean bean) {
-		table.put(bean.getCreateSeqMsgId(), bean);
-		return true;
-	}
-
-	public boolean delete(String msgId) {
-		return table.remove(msgId) != null;
-	}
-
-	public CreateSeqBean retrieve(String msgId) {
-		return (CreateSeqBean) table.get(msgId);
-	}
-
-	public boolean update(CreateSeqBean bean) {
-		if (!table.contains(bean))
-			return false;
-		
-		return table.put(bean.getCreateSeqMsgId(), bean) != null;
-	}
-
-	public Collection find(CreateSeqBean bean) {
-		ArrayList beans = new ArrayList();
-		if (bean==null)
-			return beans;
-		
-		Iterator iterator = table.values().iterator();
-
-		CreateSeqBean temp;
-		while (iterator.hasNext()) {
-			temp = (CreateSeqBean) iterator.next();
-//			if ((bean.getCreateSeqMsgId() != null && bean.getCreateSeqMsgId()
-//					.equals(temp.getCreateSeqMsgId()))
-//					&& (bean.getSequenceId() != null && bean.getSequenceId()
-//							.equals(bean.getSequenceId()))) {
-//				beans.add(temp);
-//
-//			}
-			
-			boolean equal = true;
-			
-			if (bean.getCreateSeqMsgId()!=null && !bean.getCreateSeqMsgId().equals(temp.getCreateSeqMsgId()))
-				equal = false;
-			
-			if (bean.getSequenceId()!=null && !bean.getSequenceId().equals(temp.getSequenceId()))
-				equal = false;
-			
-			if (bean.getTempSequenceId()!=null && !bean.getTempSequenceId().equals(temp.getTempSequenceId()))
-				equal = false;
-			
-			
-			if (equal)
-				beans.add(temp);
-			
-		}
-		return beans;
-	}
-
-	public ResultSet find(String query) {
-		throw new UnsupportedOperationException("selectRS() is not supported");
-	}
+	public Collection find(CreateSeqBean bean);
 
-}
\ No newline at end of file
+	public ResultSet find(String query);
+}

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=330193&r1=330192&r2=330193&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 Tue Nov  1 21:56:42 2005
@@ -1,19 +1,20 @@
 /*
- * Copyright 2004,2005 The Apache Software Foundation.
+ * Copyright  1999-2004 The Apache Software Foundation.
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
  */
+
 package org.apache.sandesha2.storage.beanmanagers;
 
 import java.sql.ResultSet;
@@ -23,97 +24,26 @@
 import java.util.Iterator;
 
 import org.apache.axis2.context.AbstractContext;
-import org.apache.axis2.context.ConfigurationContext;
 import org.apache.sandesha2.Constants;
-import org.apache.sandesha2.SandeshaException;
 import org.apache.sandesha2.storage.beans.NextMsgBean;
 
 /**
- * @author Chamikara Jayalath <chamikara@wso2.com>
- * @author Sanka Samaranayake <ssanka@gmail.com>
+ * @author Chamikara
+ * @author Sanka
  */
-public class NextMsgBeanMgr {
+public interface NextMsgBeanMgr extends RMBeanManager {
+
+	public boolean delete(String sequenceId);
+
+	public NextMsgBean retrieve(String sequenceId);
+
+	public boolean insert(NextMsgBean bean);
+
+	public ResultSet find(String query);
+
+	public Collection find(NextMsgBean bean);
 
-	private Hashtable table = null;
+	public boolean update(NextMsgBean bean);
 
-	/**
-	 *  
-	 */
-	public NextMsgBeanMgr(AbstractContext context) {
-		Object obj = context.getProperty(Constants.BeanMAPs.NEXT_MESSAGE);
-
-		if (obj != null) {
-			table = (Hashtable) obj;
-		} else {
-			table = new Hashtable();
-			context.setProperty(Constants.BeanMAPs.NEXT_MESSAGE, table);
-		}
-	}
-
-	public boolean delete(String sequenceId) {
-		return table.remove(sequenceId) != null;
-	}
-
-	public NextMsgBean retrieve(String sequenceId) {
-		return (NextMsgBean) table.get(sequenceId);
-	}
-
-	public boolean insert(NextMsgBean bean) {
-		table.put(bean.getSequenceId(), bean);
-		return true;
-	}
-
-	public ResultSet find(String query) {
-		throw new UnsupportedOperationException("selectRS() is not supported");
-	}
-
-	public Collection find(NextMsgBean bean) {
-		ArrayList beans = new ArrayList();
-		Iterator iterator = table.values().iterator();
-
-		if (bean==null)
-			return beans;
-		
-		NextMsgBean temp;
-		while (iterator.hasNext()) {
-			temp = (NextMsgBean) iterator.next();
-
-//			if ((bean.getSequenceId() != null && bean.getSequenceId().equals(
-//					temp.getSequenceId()))
-//					/*
-//					 * && (bean.getNextMsgNoToProcess() != null &&
-//					 * bean.getNextMsgNoToProcess().equals(temp.getNextMsgNoToProcess()))
-//					 */
-//					&& (bean.getNextMsgNoToProcess() > 0)) {
-//
-//				beans.add(temp);
-//			}
-			
-			
-			boolean equal = true;
-			
-			if (bean.getNextMsgNoToProcess()>0 && bean.getNextMsgNoToProcess()!=temp.getNextMsgNoToProcess())
-				equal = false;
-			
-			if (bean.getSequenceId()!=null && !bean.getSequenceId().equals(temp.getSequenceId()))
-				equal = false;
-			
-			if (equal)
-				beans.add(temp);
-			
-
-		}
-		return beans;
-	}
-
-	public boolean update(NextMsgBean bean) {
-		if (!table.contains(bean))
-			return false;
-		
-		return table.put(bean.getSequenceId(), bean) != null;
-	}
-
-	public Collection retrieveAll() {
-		return table.values();
-	}
-}
\ No newline at end of file
+	public Collection retrieveAll();
+}

Added: webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/RMBeanManager.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/RMBeanManager.java?rev=330193&view=auto
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/RMBeanManager.java (added)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/RMBeanManager.java Tue Nov  1 21:56:42 2005
@@ -0,0 +1,27 @@
+/*
+ * Copyright  1999-2004 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.sandesha2.storage.beanmanagers;
+
+/**
+ * @author Chamikara
+ * @author Sanka
+ */
+
+public interface RMBeanManager {
+	
+}

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/RetransmitterBeanMgr.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/RetransmitterBeanMgr.java?rev=330193&r1=330192&r2=330193&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/RetransmitterBeanMgr.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/RetransmitterBeanMgr.java Tue Nov  1 21:56:42 2005
@@ -1,19 +1,20 @@
 /*
- * Copyright 2004,2005 The Apache Software Foundation.
+ * Copyright  1999-2004 The Apache Software Foundation.
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
  */
+
 package org.apache.sandesha2.storage.beanmanagers;
 
 import java.sql.ResultSet;
@@ -23,110 +24,29 @@
 import java.util.Iterator;
 
 import org.apache.axis2.context.AbstractContext;
-import org.apache.axis2.context.ConfigurationContext;
 import org.apache.sandesha2.Constants;
 import org.apache.sandesha2.SandeshaException;
 import org.apache.sandesha2.storage.beans.RetransmitterBean;
-import org.apache.sandesha2.util.MsgInitializer;
 
 /**
- * @author Chamikara Jayalath <chamikara@wso2.com>
- * @author Sanka Samaranayake <ssanka@gmail.com>
+ * @author Chamikara
+ * @author Sanka
  */
-public class RetransmitterBeanMgr {
-	private Hashtable table = null;
 
-	public RetransmitterBeanMgr(AbstractContext context) {
-		Object obj = context.getProperty(Constants.BeanMAPs.RETRANSMITTER);
-		if (obj != null) {
-			table = (Hashtable) obj;
-		} else {
-			table = new Hashtable();
-			context.setProperty(Constants.BeanMAPs.RETRANSMITTER, table);
-		}
-	}
-
-	public boolean delete(String MessageId) {
-		return table.remove(MessageId) != null;
-	}
-
-	public RetransmitterBean retrieve(String MessageId) {
-		return (RetransmitterBean) table.get(MessageId);
-	}
-
-	public boolean insert(RetransmitterBean bean) throws SandeshaException {
-		if (bean.getMessageId() == null)
-			throw new SandeshaException("Key (MessageId) is null. Cant insert.");	
-		table.put(bean.getMessageId(), bean);
-		return true;
-	}
-
-	public ResultSet find(String query) {
-		throw new UnsupportedOperationException("selectRS() is not supported");
-	}
-
-	public Collection find(RetransmitterBean bean) {
-		ArrayList beans = new ArrayList();
-		Iterator iterator = table.values().iterator();
-
-		RetransmitterBean temp;
-		while (iterator.hasNext()) {
-			temp = (RetransmitterBean) iterator.next();
-
-			boolean add = true;
-			
-			if (bean.getKey() != null && !bean.getKey().equals(temp.getKey()))
-				add = false;
-
-			if (bean.getLastSentTime() > 0
-					&& bean.getLastSentTime() != temp.getLastSentTime())
-				add = false;
-
-			if (bean.getMessageId() != null
-					&& !bean.getMessageId().equals(temp.getMessageId()))
-				add = false;
-
-			if (bean.getTempSequenceId() != null
-					&& !bean.getTempSequenceId().equals(temp.getTempSequenceId()))
-				add = false;
-
-			if (bean.getMessageNumber() > 0
-					&& bean.getMessageNumber() != temp.getMessageNumber())
-				add = false;
-
-			if (add)
-				beans.add(temp);
-		}
-
-		return beans;
-	}
-
-	public Collection findMsgsToSend() {
-		ArrayList beans = new ArrayList();
-		Iterator iterator = table.values().iterator();
-
-		RetransmitterBean temp;
-		while (iterator.hasNext()) {
-			temp = (RetransmitterBean) iterator.next();
-			if (temp.isSend()) {
-				long lastSentTime = temp.getLastSentTime();
-				int count = temp.getSentCount();
-				long timeNow = System.currentTimeMillis();
-				if (count == 0
-						|| (timeNow > (lastSentTime + Constants.WSP.RETRANSMISSION_INTERVAL))) {
-					beans.add(temp);
-				}
-			}
-		}
-
-		return beans;
-	}
-
-	public boolean update(RetransmitterBean bean) {
-		if (!table.contains(bean))
-			return false;
-		
-		return table.put(bean.getMessageId(), bean) != null;
-	}
+public interface RetransmitterBeanMgr extends RMBeanManager {
+
+	public boolean delete(String MessageId);
+
+	public RetransmitterBean retrieve(String MessageId);
+
+	public boolean insert(RetransmitterBean bean) throws SandeshaException;
+
+	public ResultSet find(String query);
+
+	public Collection find(RetransmitterBean bean);
+
+	public Collection findMsgsToSend();
+
+	public boolean update(RetransmitterBean bean);
 
-}
\ No newline at end of file
+}

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=330193&r1=330192&r2=330193&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 Tue Nov  1 21:56:42 2005
@@ -1,19 +1,20 @@
 /*
- * Copyright 2004,2005 The Apache Software Foundation.
+ * Copyright  1999-2004 The Apache Software Foundation.
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
  */
+
 package org.apache.sandesha2.storage.beanmanagers;
 
 import java.sql.ResultSet;
@@ -23,98 +24,26 @@
 import java.util.Iterator;
 
 import org.apache.axis2.context.AbstractContext;
-import org.apache.axis2.context.ConfigurationContext;
 import org.apache.sandesha2.Constants;
-import org.apache.sandesha2.SandeshaException;
 import org.apache.sandesha2.storage.beans.SequencePropertyBean;
 
 /**
- * @author Chamikara Jayalath <chamikara@wso2.com>
- * @author Sanka Samaranayake <ssanka@gmail.com>
+ * @author Chamikara
+ * @author Sanka
  */
-public class SequencePropertyBeanMgr {
-	private Hashtable table = null;
 
-	/**
-	 *  
-	 */
-	public SequencePropertyBeanMgr(AbstractContext context) {
-		Object obj = context.getProperty(Constants.BeanMAPs.SEQUENCE_PROPERTY);
-		if (obj != null) {
-			table = (Hashtable) obj;
-		} else {
-			table = new Hashtable();
-			context.setProperty(Constants.BeanMAPs.SEQUENCE_PROPERTY, table);
-		}
-	}
-
-	public boolean delete(String sequenceId, String name) {
-		return table.remove(sequenceId + ":" + name) != null;
-	}
-
-	public SequencePropertyBean retrieve(String sequenceId, String name) {
-		return (SequencePropertyBean) table.get(sequenceId + ":" + name);
-	}
-
-	public boolean insert(SequencePropertyBean bean) {
-		table.put(bean.getSequenceId() + ":" + bean.getName(), bean);
-		return true;
-	}
-
-	public ResultSet find(String query) {
-		throw new UnsupportedOperationException("selectRS() is not supported");
-	}
-
-	public Collection find(SequencePropertyBean bean) {
-		ArrayList beans = new ArrayList();
-		
-		if (bean==null)
-			return beans;
-		
-		Iterator iterator = table.values().iterator();
-		SequencePropertyBean temp;
-
-		while (iterator.hasNext()) {
-			temp = (SequencePropertyBean) iterator.next();
-
-//			if ((bean.getSequenceId() != null && bean.getSequenceId().equals(
-//					temp.getSequenceId()))
-//					&& (bean.getName() != null && bean.getName().equals(
-//							temp.getName()))
-//					&& (bean.getValue() != null && bean.getValue().equals(
-//							temp.getValue()))) {
-//
-//				beans.add(temp);
-//			}
-			
-			boolean equal = true;
-			
-			if (bean.getSequenceId()!=null && !bean.getSequenceId().equals(temp.getSequenceId()))
-				equal = false;
-			
-			if (bean.getName()!=null && !bean.getName().equals(temp.getName()))
-				equal = false;
-			
-			if (bean.getValue()!=null && !bean.getValue().equals(temp.getValue()))
-				equal = false;
-			
-			if (equal)
-				beans.add(temp);
-			
-		}
-		return beans;
-	}
-
-	public boolean update(SequencePropertyBean bean) {
-		if (!table.contains(bean))
-			return false;
-		
-		return table.put(getId(bean), bean) != null;
-
-	}
-
-	private String getId(SequencePropertyBean bean) {
-		return bean.getSequenceId() + ":" + bean.getName();
-	}
+public interface SequencePropertyBeanMgr extends RMBeanManager {
+
+	public boolean delete(String sequenceId, String name);
+
+	public SequencePropertyBean retrieve(String sequenceId, String name);
+
+	public boolean insert(SequencePropertyBean bean);
+
+	public ResultSet find(String query);
+
+	public Collection find(SequencePropertyBean bean);
+
+	public boolean update(SequencePropertyBean bean);
 
-}
\ No newline at end of file
+}

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/StorageMapBeanMgr.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/StorageMapBeanMgr.java?rev=330193&r1=330192&r2=330193&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/StorageMapBeanMgr.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beanmanagers/StorageMapBeanMgr.java Tue Nov  1 21:56:42 2005
@@ -1,19 +1,20 @@
 /*
- * Copyright 2004,2005 The Apache Software Foundation.
+ * Copyright  1999-2004 The Apache Software Foundation.
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
  */
+
 package org.apache.sandesha2.storage.beanmanagers;
 
 import java.sql.ResultSet;
@@ -23,86 +24,26 @@
 import java.util.Iterator;
 
 import org.apache.axis2.context.AbstractContext;
-import org.apache.axis2.context.ConfigurationContext;
 import org.apache.sandesha2.Constants;
-import org.apache.sandesha2.SandeshaException;
-import org.apache.sandesha2.storage.beans.CreateSeqBean;
 import org.apache.sandesha2.storage.beans.StorageMapBean;
 
 /**
- * @author Chamikara Jayalath <chamikara@wso2.com>
- * @author Sanka Samaranayake <ssanka@gmail.com>
+ * @author Chamikara
+ * @author Sanka
  */
-public class StorageMapBeanMgr {
-	private Hashtable table = null;
 
-	/**
-	 *  
-	 */
-	public StorageMapBeanMgr(AbstractContext context) {
-		Object obj = context.getProperty(Constants.BeanMAPs.STORAGE_MAP);
-		if (obj != null) {
-			table = (Hashtable) obj;
-		} else {
-			table = new Hashtable();
-			context.setProperty(Constants.BeanMAPs.STORAGE_MAP, table);
-		}
-	}
-
-	public boolean insert(StorageMapBean bean) {
-		table.put(bean.getKey(), bean);
-		return true;
-	}
-
-	public boolean delete(String key) {
-		return table.remove(key) != null;
-	}
-
-	public StorageMapBean retrieve(String key) {
-		return (StorageMapBean) table.get(key);
-	}
-
-	public ResultSet find(String query) {
-		throw new UnsupportedOperationException("selectRS() is not implemented");
-	}
-
-	public Collection find(StorageMapBean bean) {
-		ArrayList beans = new ArrayList();
-		Iterator iterator = table.values().iterator();
-
-		StorageMapBean temp = new StorageMapBean();
-		while (iterator.hasNext()) {
-			temp = (StorageMapBean) iterator.next();
-			boolean select = true;
-			/*
-			 * if ((temp.getKey() != null &&
-			 * bean.getKey().equals(temp.getKey())) && (bean.getMsgNo() != -1 &&
-			 * bean.getMsgNo() == temp.getMsgNo()) && (bean.getSequenceId() !=
-			 * null && bean.getSequenceId().equals(temp.getSequenceId()))) {
-			 */
-
-			//}
-			if (bean.getKey() != null && !bean.getKey().equals(temp.getKey()))
-				select = false;
-
-			if (bean.getMsgNo() != 0 && bean.getMsgNo() != temp.getMsgNo())
-				select = false;
-
-			if (bean.getSequenceId() != null
-					&& !bean.getSequenceId().equals(temp.getSequenceId()))
-				select = false;
-
-			if (select)
-				beans.add(temp);
-		}
-		return beans;
-	}
-
-	public boolean update(StorageMapBean bean) {
-		if (!table.contains(bean))
-			return false;
-		
-		return table.put(bean.getKey(), bean) != null;
-	}
+public interface StorageMapBeanMgr extends RMBeanManager {
+
+	public boolean insert(StorageMapBean bean);
+
+	public boolean delete(String key);
+
+	public StorageMapBean retrieve(String key);
+
+	public ResultSet find(String query);
+
+	public Collection find(StorageMapBean bean);
+
+	public boolean update(StorageMapBean bean);
 
-}
\ No newline at end of file
+}

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beans/CreateSeqBean.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beans/CreateSeqBean.java?rev=330193&r1=330192&r2=330193&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beans/CreateSeqBean.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beans/CreateSeqBean.java Tue Nov  1 21:56:42 2005
@@ -1,8 +1,25 @@
+/*
+ * Copyright  1999-2004 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
 package org.apache.sandesha2.storage.beans;
 
 import java.io.Serializable;
 
-public class CreateSeqBean implements Serializable {
+public class CreateSeqBean implements RMBean {
 	private String tempSequenceId;
 
 	private String CreateSeqMsgId;

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beans/NextMsgBean.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beans/NextMsgBean.java?rev=330193&r1=330192&r2=330193&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beans/NextMsgBean.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beans/NextMsgBean.java Tue Nov  1 21:56:42 2005
@@ -22,7 +22,7 @@
 /**
  * @author  
  */
-public class NextMsgBean implements Serializable {
+public class NextMsgBean implements RMBean {
 	private String SequenceId;
 
 	private long NextMsgNoToProcess;

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beans/RMBean.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beans/RMBean.java?rev=330193&r1=330192&r2=330193&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beans/RMBean.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beans/RMBean.java Tue Nov  1 21:56:42 2005
@@ -17,9 +17,11 @@
 
 package org.apache.sandesha2.storage.beans;
 
+import java.io.Serializable;
+
 /**
  * @author  
  */
-public interface RMBean {
+public interface RMBean extends Serializable {
 
 }

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beans/RetransmitterBean.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beans/RetransmitterBean.java?rev=330193&r1=330192&r2=330193&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beans/RetransmitterBean.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beans/RetransmitterBean.java Tue Nov  1 21:56:42 2005
@@ -19,7 +19,7 @@
 
 import java.io.Serializable;
 
-public class RetransmitterBean implements Serializable {
+public class RetransmitterBean implements RMBean {
 
 	private String messageId;
 

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beans/SequencePropertyBean.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beans/SequencePropertyBean.java?rev=330193&r1=330192&r2=330193&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beans/SequencePropertyBean.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beans/SequencePropertyBean.java Tue Nov  1 21:56:42 2005
@@ -21,7 +21,7 @@
 /**
  * @author Sanka Samaranayake <ssanka@gmail.com>
  */
-public class SequencePropertyBean implements Serializable {
+public class SequencePropertyBean implements RMBean {
 
 	private String sequenceId;
 

Modified: webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beans/StorageMapBean.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beans/StorageMapBean.java?rev=330193&r1=330192&r2=330193&view=diff
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beans/StorageMapBean.java (original)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/storage/beans/StorageMapBean.java Tue Nov  1 21:56:42 2005
@@ -22,7 +22,7 @@
 /**
  * @author  
  */
-public class StorageMapBean implements Serializable {
+public class StorageMapBean implements RMBean {
 
 	private String Key;
 

Added: webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryCreateSeqBeanMgr.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryCreateSeqBeanMgr.java?rev=330193&view=auto
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryCreateSeqBeanMgr.java (added)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryCreateSeqBeanMgr.java Tue Nov  1 21:56:42 2005
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ */
+package org.apache.sandesha2.storage.inmemory;
+
+import java.sql.ResultSet;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Hashtable;
+import java.util.Iterator;
+
+import org.apache.axis2.context.AbstractContext;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.sandesha2.Constants;
+import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.storage.beanmanagers.CreateSeqBeanMgr;
+import org.apache.sandesha2.storage.beans.CreateSeqBean;
+
+/**
+ * @author Chamikara Jayalath <chamikara@wso2.com>
+ * @author Sanka Samaranayake <ssanka@gmail.com>
+ */
+
+public class InMemoryCreateSeqBeanMgr implements CreateSeqBeanMgr {
+
+	private Hashtable table = null;
+
+	
+	//TODO change the primary key.
+	//When offered. msgId==null
+	/**
+	 *  
+	 */
+	public InMemoryCreateSeqBeanMgr(AbstractContext context) {
+		Object obj = context.getProperty(Constants.BeanMAPs.CREATE_SEQUECE);
+		if (obj != null) {
+			table = (Hashtable) obj;
+		} else {
+			table = new Hashtable();
+			context.setProperty(Constants.BeanMAPs.CREATE_SEQUECE, table);
+		}
+	}
+
+	public boolean insert(CreateSeqBean bean) {
+		table.put(bean.getCreateSeqMsgId(), bean);
+		return true;
+	}
+
+	public boolean delete(String msgId) {
+		return table.remove(msgId) != null;
+	}
+
+	public CreateSeqBean retrieve(String msgId) {
+		return (CreateSeqBean) table.get(msgId);
+	}
+
+	public boolean update(CreateSeqBean bean) {
+		if (!table.contains(bean))
+			return false;
+		
+		return table.put(bean.getCreateSeqMsgId(), bean) != null;
+	}
+
+	public Collection find(CreateSeqBean bean) {
+		ArrayList beans = new ArrayList();
+		if (bean==null)
+			return beans;
+		
+		Iterator iterator = table.values().iterator();
+
+		CreateSeqBean temp;
+		while (iterator.hasNext()) {
+			temp = (CreateSeqBean) iterator.next();
+//			if ((bean.getCreateSeqMsgId() != null && bean.getCreateSeqMsgId()
+//					.equals(temp.getCreateSeqMsgId()))
+//					&& (bean.getSequenceId() != null && bean.getSequenceId()
+//							.equals(bean.getSequenceId()))) {
+//				beans.add(temp);
+//
+//			}
+			
+			boolean equal = true;
+			
+			if (bean.getCreateSeqMsgId()!=null && !bean.getCreateSeqMsgId().equals(temp.getCreateSeqMsgId()))
+				equal = false;
+			
+			if (bean.getSequenceId()!=null && !bean.getSequenceId().equals(temp.getSequenceId()))
+				equal = false;
+			
+			if (bean.getTempSequenceId()!=null && !bean.getTempSequenceId().equals(temp.getTempSequenceId()))
+				equal = false;
+			
+			
+			if (equal)
+				beans.add(temp);
+			
+		}
+		return beans;
+	}
+
+	public ResultSet find(String query) {
+		throw new UnsupportedOperationException("selectRS() is not supported");
+	}
+
+}
\ No newline at end of file

Added: 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=330193&view=auto
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryNextMsgBeanMgr.java (added)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryNextMsgBeanMgr.java Tue Nov  1 21:56:42 2005
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ */
+package org.apache.sandesha2.storage.inmemory;
+
+import java.sql.ResultSet;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Hashtable;
+import java.util.Iterator;
+
+import org.apache.axis2.context.AbstractContext;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.sandesha2.Constants;
+import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.storage.beanmanagers.NextMsgBeanMgr;
+import org.apache.sandesha2.storage.beans.NextMsgBean;
+
+/**
+ * @author Chamikara Jayalath <chamikara@wso2.com>
+ * @author Sanka Samaranayake <ssanka@gmail.com>
+ */
+public class InMemoryNextMsgBeanMgr implements NextMsgBeanMgr {
+
+	private Hashtable table = null;
+
+	/**
+	 *  
+	 */
+	public InMemoryNextMsgBeanMgr(AbstractContext context) {
+		Object obj = context.getProperty(Constants.BeanMAPs.NEXT_MESSAGE);
+
+		if (obj != null) {
+			table = (Hashtable) obj;
+		} else {
+			table = new Hashtable();
+			context.setProperty(Constants.BeanMAPs.NEXT_MESSAGE, table);
+		}
+	}
+
+	public boolean delete(String sequenceId) {
+		return table.remove(sequenceId) != null;
+	}
+
+	public NextMsgBean retrieve(String sequenceId) {
+		return (NextMsgBean) table.get(sequenceId);
+	}
+
+	public boolean insert(NextMsgBean bean) {
+		table.put(bean.getSequenceId(), bean);
+		return true;
+	}
+
+	public ResultSet find(String query) {
+		throw new UnsupportedOperationException("selectRS() is not supported");
+	}
+
+	public Collection find(NextMsgBean bean) {
+		ArrayList beans = new ArrayList();
+		Iterator iterator = table.values().iterator();
+
+		if (bean==null)
+			return beans;
+		
+		NextMsgBean temp;
+		while (iterator.hasNext()) {
+			temp = (NextMsgBean) iterator.next();
+
+//			if ((bean.getSequenceId() != null && bean.getSequenceId().equals(
+//					temp.getSequenceId()))
+//					/*
+//					 * && (bean.getNextMsgNoToProcess() != null &&
+//					 * bean.getNextMsgNoToProcess().equals(temp.getNextMsgNoToProcess()))
+//					 */
+//					&& (bean.getNextMsgNoToProcess() > 0)) {
+//
+//				beans.add(temp);
+//			}
+			
+			
+			boolean equal = true;
+			
+			if (bean.getNextMsgNoToProcess()>0 && bean.getNextMsgNoToProcess()!=temp.getNextMsgNoToProcess())
+				equal = false;
+			
+			if (bean.getSequenceId()!=null && !bean.getSequenceId().equals(temp.getSequenceId()))
+				equal = false;
+			
+			if (equal)
+				beans.add(temp);
+			
+
+		}
+		return beans;
+	}
+
+	public boolean update(NextMsgBean bean) {
+		if (!table.contains(bean))
+			return false;
+		
+		return table.put(bean.getSequenceId(), bean) != null;
+	}
+
+	public Collection retrieveAll() {
+		return table.values();
+	}
+}
\ No newline at end of file

Added: webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryRetransmitterBeanMgr.java
URL: http://svn.apache.org/viewcvs/webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryRetransmitterBeanMgr.java?rev=330193&view=auto
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryRetransmitterBeanMgr.java (added)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryRetransmitterBeanMgr.java Tue Nov  1 21:56:42 2005
@@ -0,0 +1,133 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ */
+package org.apache.sandesha2.storage.inmemory;
+
+import java.sql.ResultSet;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Hashtable;
+import java.util.Iterator;
+
+import org.apache.axis2.context.AbstractContext;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.sandesha2.Constants;
+import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.storage.beanmanagers.RetransmitterBeanMgr;
+import org.apache.sandesha2.storage.beans.RetransmitterBean;
+import org.apache.sandesha2.util.MsgInitializer;
+
+/**
+ * @author Chamikara Jayalath <chamikara@wso2.com>
+ * @author Sanka Samaranayake <ssanka@gmail.com>
+ */
+public class InMemoryRetransmitterBeanMgr implements RetransmitterBeanMgr {
+	private Hashtable table = null;
+
+	public InMemoryRetransmitterBeanMgr(AbstractContext context) {
+		Object obj = context.getProperty(Constants.BeanMAPs.RETRANSMITTER);
+		if (obj != null) {
+			table = (Hashtable) obj;
+		} else {
+			table = new Hashtable();
+			context.setProperty(Constants.BeanMAPs.RETRANSMITTER, table);
+		}
+	}
+
+	public boolean delete(String MessageId) {
+		return table.remove(MessageId) != null;
+	}
+
+	public RetransmitterBean retrieve(String MessageId) {
+		return (RetransmitterBean) table.get(MessageId);
+	}
+
+	public boolean insert(RetransmitterBean bean) throws SandeshaException {
+		if (bean.getMessageId() == null)
+			throw new SandeshaException("Key (MessageId) is null. Cant insert.");	
+		table.put(bean.getMessageId(), bean);
+		return true;
+	}
+
+	public ResultSet find(String query) {
+		throw new UnsupportedOperationException("selectRS() is not supported");
+	}
+
+	public Collection find(RetransmitterBean bean) {
+		ArrayList beans = new ArrayList();
+		Iterator iterator = table.values().iterator();
+
+		RetransmitterBean temp;
+		while (iterator.hasNext()) {
+			temp = (RetransmitterBean) iterator.next();
+
+			boolean add = true;
+			
+			if (bean.getKey() != null && !bean.getKey().equals(temp.getKey()))
+				add = false;
+
+			if (bean.getLastSentTime() > 0
+					&& bean.getLastSentTime() != temp.getLastSentTime())
+				add = false;
+
+			if (bean.getMessageId() != null
+					&& !bean.getMessageId().equals(temp.getMessageId()))
+				add = false;
+
+			if (bean.getTempSequenceId() != null
+					&& !bean.getTempSequenceId().equals(temp.getTempSequenceId()))
+				add = false;
+
+			if (bean.getMessageNumber() > 0
+					&& bean.getMessageNumber() != temp.getMessageNumber())
+				add = false;
+
+			if (add)
+				beans.add(temp);
+		}
+
+		return beans;
+	}
+
+	public Collection findMsgsToSend() {
+		ArrayList beans = new ArrayList();
+		Iterator iterator = table.values().iterator();
+
+		RetransmitterBean temp;
+		while (iterator.hasNext()) {
+			temp = (RetransmitterBean) iterator.next();
+			if (temp.isSend()) {
+				long lastSentTime = temp.getLastSentTime();
+				int count = temp.getSentCount();
+				long timeNow = System.currentTimeMillis();
+				if (count == 0
+						|| (timeNow > (lastSentTime + Constants.WSP.RETRANSMISSION_INTERVAL))) {
+					beans.add(temp);
+				}
+			}
+		}
+
+		return beans;
+	}
+
+	public boolean update(RetransmitterBean bean) {
+		if (!table.contains(bean))
+			return false;
+		
+		return table.put(bean.getMessageId(), bean) != null;
+	}
+
+}
\ No newline at end of file

Added: 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=330193&view=auto
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemorySequencePropertyBeanMgr.java (added)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemorySequencePropertyBeanMgr.java Tue Nov  1 21:56:42 2005
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ */
+package org.apache.sandesha2.storage.inmemory;
+
+import java.sql.ResultSet;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Hashtable;
+import java.util.Iterator;
+
+import org.apache.axis2.context.AbstractContext;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.sandesha2.Constants;
+import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.storage.beanmanagers.SequencePropertyBeanMgr;
+import org.apache.sandesha2.storage.beans.SequencePropertyBean;
+
+/**
+ * @author Chamikara Jayalath <chamikara@wso2.com>
+ * @author Sanka Samaranayake <ssanka@gmail.com>
+ */
+public class InMemorySequencePropertyBeanMgr implements SequencePropertyBeanMgr {
+	private Hashtable table = null;
+
+	/**
+	 *  
+	 */
+	public InMemorySequencePropertyBeanMgr(AbstractContext context) {
+		Object obj = context.getProperty(Constants.BeanMAPs.SEQUENCE_PROPERTY);
+		if (obj != null) {
+			table = (Hashtable) obj;
+		} else {
+			table = new Hashtable();
+			context.setProperty(Constants.BeanMAPs.SEQUENCE_PROPERTY, table);
+		}
+	}
+
+	public boolean delete(String sequenceId, String name) {
+		return table.remove(sequenceId + ":" + name) != null;
+	}
+
+	public SequencePropertyBean retrieve(String sequenceId, String name) {
+		return (SequencePropertyBean) table.get(sequenceId + ":" + name);
+	}
+
+	public boolean insert(SequencePropertyBean bean) {
+		table.put(bean.getSequenceId() + ":" + bean.getName(), bean);
+		return true;
+	}
+
+	public ResultSet find(String query) {
+		throw new UnsupportedOperationException("selectRS() is not supported");
+	}
+
+	public Collection find(SequencePropertyBean bean) {
+		ArrayList beans = new ArrayList();
+		
+		if (bean==null)
+			return beans;
+		
+		Iterator iterator = table.values().iterator();
+		SequencePropertyBean temp;
+
+		while (iterator.hasNext()) {
+			temp = (SequencePropertyBean) iterator.next();
+
+//			if ((bean.getSequenceId() != null && bean.getSequenceId().equals(
+//					temp.getSequenceId()))
+//					&& (bean.getName() != null && bean.getName().equals(
+//							temp.getName()))
+//					&& (bean.getValue() != null && bean.getValue().equals(
+//							temp.getValue()))) {
+//
+//				beans.add(temp);
+//			}
+			
+			boolean equal = true;
+			
+			if (bean.getSequenceId()!=null && !bean.getSequenceId().equals(temp.getSequenceId()))
+				equal = false;
+			
+			if (bean.getName()!=null && !bean.getName().equals(temp.getName()))
+				equal = false;
+			
+			if (bean.getValue()!=null && !bean.getValue().equals(temp.getValue()))
+				equal = false;
+			
+			if (equal)
+				beans.add(temp);
+			
+		}
+		return beans;
+	}
+
+	public boolean update(SequencePropertyBean bean) {
+		if (!table.contains(bean))
+			return false;
+		
+		return table.put(getId(bean), bean) != null;
+
+	}
+
+	private String getId(SequencePropertyBean bean) {
+		return bean.getSequenceId() + ":" + bean.getName();
+	}
+
+}
\ No newline at end of file

Added: 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=330193&view=auto
==============================================================================
--- webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryStorageManager.java (added)
+++ webservices/sandesha/trunk/src/org/apache/sandesha2/storage/inmemory/InMemoryStorageManager.java Tue Nov  1 21:56:42 2005
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ */
+
+package org.apache.sandesha2.storage.inmemory;
+
+import org.apache.axis2.context.AbstractContext;
+import org.apache.axis2.context.ConfigurationContext;
+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.NextMsgBeanMgr;
+import org.apache.sandesha2.storage.beanmanagers.RetransmitterBeanMgr;
+import org.apache.sandesha2.storage.beanmanagers.SequencePropertyBeanMgr;
+import org.apache.sandesha2.storage.beanmanagers.StorageMapBeanMgr;
+import org.apache.sandesha2.storage.beans.RetransmitterBean;
+
+public class InMemoryStorageManager extends StorageManager {
+	
+	private static InMemoryStorageManager instance = null;
+
+	public InMemoryStorageManager (ConfigurationContext context) {
+		super (context);
+	}
+	
+	public Transaction getTransaction () {
+		return new InMemoryTransaction  ();
+	}
+	
+	public CreateSeqBeanMgr getCreateSeqBeanMgr() {
+		return new InMemoryCreateSeqBeanMgr(getContext());
+	}
+
+	public NextMsgBeanMgr getNextMsgBeanMgr() {
+		return new InMemoryNextMsgBeanMgr(getContext());
+	}
+
+	public RetransmitterBeanMgr getRetransmitterBeanMgr() {
+		return new InMemoryRetransmitterBeanMgr(getContext());
+	}
+
+	public SequencePropertyBeanMgr getSequencePropretyBeanMgr() {
+		return new InMemorySequencePropertyBeanMgr(getContext());
+	}
+
+	public StorageMapBeanMgr getStorageMapBeanMgr() {
+		return new InMemoryStorageMapBeanMgr(getContext());
+	}
+
+	//	public static StorageManager getBeanMgrFactory (int storageType)
+	// {
+	//		switch (storageType) {
+	//			case Constants.STORAGE_TYPE_PERSISTANCE:
+	//				return new PersistentBeanMgrFactory();
+	//			case Constants.STORAGE_TYPE_IN_MEMORY:
+	//				return new InMemBeanMgrFactory();
+	//			default:
+	//				return null;
+	//		}
+	//	}
+
+
+	public void init(ConfigurationContext context) {
+		setContext(context);
+	}
+
+	public static InMemoryStorageManager getInstance(ConfigurationContext context) {
+		if (instance == null)
+			instance = new InMemoryStorageManager(context);
+
+		return instance;
+	}
+}



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