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 mc...@apache.org on 2008/01/04 18:29:39 UTC
svn commit: r608934 -
/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/inmemory/InMemoryBeanMgr.java
Author: mckierna
Date: Fri Jan 4 09:29:32 2008
New Revision: 608934
URL: http://svn.apache.org/viewvc?rev=608934&view=rev
Log:
Close timing window when storing invoker beans
Modified:
webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/inmemory/InMemoryBeanMgr.java
Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/inmemory/InMemoryBeanMgr.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/inmemory/InMemoryBeanMgr.java?rev=608934&r1=608933&r2=608934&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/inmemory/InMemoryBeanMgr.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/inmemory/InMemoryBeanMgr.java Fri Jan 4 09:29:32 2008
@@ -55,11 +55,19 @@
protected boolean insert(Object key, RMBean bean) throws SandeshaStorageException {
if(log.isDebugEnabled()) log.debug("Entry: InMemoryBeanMgr " + this.getClass() + " insert " + key + ", " + bean);
mgr.enlistBean(bean);
+ boolean returnValue;
synchronized (table) {
- table.put(key, bean);
+ if(table.containsKey(key)){
+ //we want to ensure there are no duplicate entries since this should never happen
+ returnValue = false;
+ }
+ else{
+ table.put(key, bean);
+ returnValue = true;
+ }
}
- if(log.isDebugEnabled()) log.debug("Exit: InMemoryBeanMgr " + this.getClass() + " insert " + true);
- return true;
+ if(log.isDebugEnabled()) log.debug("Exit: InMemoryBeanMgr " + this.getClass() + " insert " + returnValue);
+ return returnValue;
}
protected boolean delete(Object key) throws SandeshaStorageException {
---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org