handle concurrent close errors

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@392441 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2006-04-07 22:31:53 +00:00
parent d8546c2567
commit 3c72961e09
1 changed files with 5 additions and 1 deletions

View File

@ -65,9 +65,10 @@ public class StoreImpl implements Store{
*
* @see org.apache.activemq.kaha.Store#close()
*/
public void close() throws IOException{
public void close() {
synchronized(mutex){
if(!closed){
try {
for(Iterator i=mapContainers.values().iterator();i.hasNext();){
MapContainerImpl container=(MapContainerImpl) i.next();
container.close();
@ -79,6 +80,9 @@ public class StoreImpl implements Store{
force();
dataFile.close();
closed=true;
}catch(IOException e){
log.debug("Failed to close the store cleanly",e);
}
}
}
}