You are viewing a plain text version of this content. The canonical link for it is here.
Posted to sandesha-dev@ws.apache.org by ml...@apache.org on 2007/03/15 15:10:34 UTC

svn commit: r518633 - in /webservices/sandesha/trunk/java/src/org/apache/sandesha2: i18n/SandeshaMessageKeys.java i18n/resource.properties storage/inmemory/InMemoryStorageManager.java

Author: mlovett
Date: Thu Mar 15 07:10:33 2007
New Revision: 518633

URL: http://svn.apache.org/viewvc?view=rev&rev=518633
Log:
Move the StorageMap off the context, and into the storage manager

Modified:
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/i18n/SandeshaMessageKeys.java
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/i18n/resource.properties
    webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemoryStorageManager.java

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/i18n/SandeshaMessageKeys.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/i18n/SandeshaMessageKeys.java?view=diff&rev=518633&r1=518632&r2=518633
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/i18n/SandeshaMessageKeys.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/i18n/SandeshaMessageKeys.java Thu Mar 15 07:10:33 2007
@@ -181,7 +181,6 @@
 	public static final String newSeqIdIsNull="newSeqIdIsNull";
 	public static final String terminateAddedPreviously="terminateAddedPreviously";
 	public static final String nullMsgId="nullMsgId";
-	public static final String storageMapNotPresent="storageMapNotPresent";
 	public static final String failedToStoreMessage="failedToStoreMessage";
 	public static final String failedToLoadMessage="failedToLoadMessage";
 	public static final String entryNotPresentForUpdating="entryNotPresentForUpdating";

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/i18n/resource.properties
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/i18n/resource.properties?view=diff&rev=518633&r1=518632&r2=518633
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/i18n/resource.properties (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/i18n/resource.properties Thu Mar 15 07:10:33 2007
@@ -202,7 +202,6 @@
 newSeqIdIsNull=New sequence Id is null.
 terminateAddedPreviously=Terminate was added previously.
 nullMsgId=Key (MessageId) is null. Cannot insert.
-storageMapNotPresent=Error: storage Map not present.
 failedToStoreMessage=Failed to store message due to exception {0}.
 failedToLoadMessage=Failed to load message due to exception {0}.
 entryNotPresentForUpdating=Entry is not present for updating.

Modified: webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemoryStorageManager.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemoryStorageManager.java?view=diff&rev=518633&r1=518632&r2=518633
==============================================================================
--- webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemoryStorageManager.java (original)
+++ webservices/sandesha/trunk/java/src/org/apache/sandesha2/storage/inmemory/InMemoryStorageManager.java Thu Mar 15 07:10:33 2007
@@ -57,7 +57,6 @@
 	private static Log log = LogFactory.getLog(InMemoryStorageManager.class);
 
 	private static InMemoryStorageManager instance = null;
-    private final String MESSAGE_MAP_KEY = "Sandesha2MessageMap";
     private RMSBeanMgr  rMSBeanMgr = null;
     private RMDBeanMgr rMDBeanMgr = null;
     private SenderBeanMgr senderBeanMgr = null;
@@ -67,6 +66,7 @@
     private PollingManager pollingManager = null;
     private HashMap transactions = new HashMap();
     private boolean useSerialization = false;
+    private HashMap storageMap = new HashMap();
     
 	public InMemoryStorageManager(ConfigurationContext context)
 	throws SandeshaException
@@ -196,11 +196,6 @@
 	
 	public MessageContext retrieveMessageContext(String key,ConfigurationContext context) throws SandeshaStorageException {
 		if(log.isDebugEnabled()) log.debug("Enter: InMemoryStorageManager::retrieveMessageContext, key: " + key);
-		HashMap storageMap = (HashMap) getContext().getProperty(MESSAGE_MAP_KEY);
-		if (storageMap==null) {
-			if(log.isDebugEnabled()) log.debug("Exit: InMemoryStorageManager::retrieveMessageContext");
-			return null;
-		}
 		
 		MessageContext messageContext = null;
 		try {
@@ -252,12 +247,6 @@
 	throws SandeshaStorageException
 	{
 		if(log.isDebugEnabled()) log.debug("Enter: InMemoryStorageManager::storeMessageContext, key: " + key);
-		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();
@@ -309,13 +298,6 @@
 	public void updateMessageContext(String key,MessageContext msgContext) throws SandeshaStorageException { 
 		if(log.isDebugEnabled()) log.debug("Enter: InMemoryStorageManager::updateMessageContext, key: " + key);
 
-		HashMap storageMap = (HashMap) getContext().getProperty(MESSAGE_MAP_KEY);
-		
-		if (storageMap==null) {
-			throw new SandeshaStorageException (SandeshaMessageHelper.getMessage(
-					SandeshaMessageKeys.storageMapNotPresent));
-		}
-		
 		Object oldEntry = storageMap.remove(key);
 		if (oldEntry==null)
 			throw new SandeshaStorageException (SandeshaMessageHelper.getMessage(
@@ -329,10 +311,7 @@
 	public void removeMessageContext(String key) { 
 		if(log.isDebugEnabled()) log.debug("Enter: InMemoryStorageManager::removeMessageContext, key: " + key);
 
-		HashMap storageMap = (HashMap) getContext().getProperty(MESSAGE_MAP_KEY);
-
-		if (storageMap!=null)
-			storageMap.remove(key);
+		storageMap.remove(key);
 		
 		if(log.isDebugEnabled()) log.debug("Exit: InMemoryStorageManager::removeMessageContext, key: " + key);
 	}



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