Check for null TransactionListeners being registered

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14926 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2009-06-25 13:35:57 +00:00
parent 1b41325ffe
commit 623c7ddabe

View File

@@ -39,6 +39,7 @@ import org.alfresco.repo.domain.hibernate.DirtySessionMethodInterceptor;
import org.alfresco.repo.node.integrity.IntegrityChecker;
import org.alfresco.repo.search.impl.lucene.LuceneIndexerAndSearcher;
import org.alfresco.util.GUID;
import org.alfresco.util.ParameterCheck;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.orm.hibernate3.SessionFactoryUtils;
@@ -564,6 +565,8 @@ public abstract class AlfrescoTransactionSupport
@SuppressWarnings("unchecked")
public boolean addListener(TransactionListener listener)
{
ParameterCheck.mandatory("listener", listener);
if (listener instanceof TransactionalCache)
{
return transactionalCaches.add((TransactionalCache<Serializable, Object>)listener);