Dictionary Cache improvements - ensure CMIS Dictionary Registry is MT-aware

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14057 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2009-04-22 16:30:51 +00:00
parent 4b98b6c0d8
commit 200a8c3843
6 changed files with 82 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
* Copyright (C) 2005-2009 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -150,7 +150,7 @@ public class DictionaryBootstrap implements DictionaryListener
}
}
}
/*
* (non-Javadoc)
* @see org.alfresco.repo.dictionary.DictionaryListener#afterInit()
@@ -159,6 +159,14 @@ public class DictionaryBootstrap implements DictionaryListener
{
}
/*
* (non-Javadoc)
* @see org.alfresco.repo.dictionary.DictionaryListener#onDictionaryDestroy()
*/
public void afterDictionaryDestroy()
{
}
/**
* Register the static resource bundles
*/

View File

@@ -147,7 +147,7 @@ public class DictionaryDAOImpl implements DictionaryDAO
// initialise empty dictionary & namespaces
putCompiledModels(tenantDomain, new HashMap<QName,CompiledModel>());
putUriToModels(tenantDomain, new HashMap<String, List<CompiledModel>>());
namespaceDAO.init();
// populate the dictionary
@@ -155,8 +155,8 @@ public class DictionaryDAOImpl implements DictionaryDAO
{
dictionaryListener.onDictionaryInit();
}
// populate the dictionary
// notify registered listeners that dictionary has been initialised
for (DictionaryListener dictionaryListener : dictionaryListeners)
{
dictionaryListener.afterDictionaryInit();
@@ -177,6 +177,12 @@ public class DictionaryDAOImpl implements DictionaryDAO
namespaceDAO.destroy();
// notify registered listeners that dictionary has been destroyed
for (DictionaryListener dictionaryDeployer : dictionaryListeners)
{
dictionaryDeployer.afterDictionaryDestroy();
}
logger.info("Dictionary destroyed");
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
* Copyright (C) 2005-2009 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -37,6 +37,9 @@ public interface DictionaryListener
// callback for (re-)initialising the Dictionary caches
public void onDictionaryInit();
// callback once initialisation is complete
// callback once dictionary destroy is complete
public void afterDictionaryDestroy();
// callback once dictionary initialisation is complete
public void afterDictionaryInit();
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2008 Alfresco Software Limited.
* Copyright (C) 2005-2009 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -293,6 +293,14 @@ public class DictionaryRepositoryBootstrap extends AbstractLifecycleBean impleme
{
}
/*
* (non-Javadoc)
* @see org.alfresco.repo.dictionary.DictionaryListener#onDictionaryDestroy()
*/
public void afterDictionaryDestroy()
{
}
public void initMessages()
{
if (this.repositoryMessagesLocations != null)