From dc74e02dfbfb33db630a72af4d50d1fed142bed7 Mon Sep 17 00:00:00 2001 From: Andrew Hind Date: Thu, 4 Jun 2009 11:25:37 +0000 Subject: [PATCH] Fixes for ALFCOM-2942 (after the addition of subsystems etc in 3.2) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14530 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../repo/audit/PublicServiceIdentifierImpl.java | 17 +++++++++++------ .../impl/lucene/fts/FullTextSearchIndexer.java | 4 ++-- .../lucene/fts/FullTextSearchIndexerImpl.java | 9 +++++++-- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/source/java/org/alfresco/repo/audit/PublicServiceIdentifierImpl.java b/source/java/org/alfresco/repo/audit/PublicServiceIdentifierImpl.java index 3a0556c5e1..2d084edb25 100644 --- a/source/java/org/alfresco/repo/audit/PublicServiceIdentifierImpl.java +++ b/source/java/org/alfresco/repo/audit/PublicServiceIdentifierImpl.java @@ -34,8 +34,9 @@ import org.aopalliance.intercept.MethodInvocation; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.BeansException; -import org.springframework.beans.factory.config.BeanFactoryPostProcessor; -import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; +import org.springframework.beans.factory.BeanFactory; +import org.springframework.beans.factory.BeanFactoryAware; +import org.springframework.beans.factory.ListableBeanFactory; /** * Identify public services by method invocation. Look ups are cached on a thread local as they are quite expensive. All public service names end with "Service" and start with @@ -43,24 +44,28 @@ import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; * * @author Andy Hind */ -public class PublicServiceIdentifierImpl implements PublicServiceIdentifier, BeanFactoryPostProcessor +public class PublicServiceIdentifierImpl implements PublicServiceIdentifier, BeanFactoryAware { private static Log s_logger = LogFactory.getLog(PublicServiceIdentifierImpl.class); private static ThreadLocal> methodToServiceMap = new ThreadLocal>(); - private ConfigurableListableBeanFactory beanFactory; + private ListableBeanFactory beanFactory; public PublicServiceIdentifierImpl() { super(); } - public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException + + + public void setBeanFactory(BeanFactory beanFactory) throws BeansException { - this.beanFactory = beanFactory; + this.beanFactory = (ListableBeanFactory)beanFactory; } + + public String getPublicServiceName(MethodInvocation mi) { return getServiceName(mi); diff --git a/source/java/org/alfresco/repo/search/impl/lucene/fts/FullTextSearchIndexer.java b/source/java/org/alfresco/repo/search/impl/lucene/fts/FullTextSearchIndexer.java index 6e77724dfc..0a2cfab068 100644 --- a/source/java/org/alfresco/repo/search/impl/lucene/fts/FullTextSearchIndexer.java +++ b/source/java/org/alfresco/repo/search/impl/lucene/fts/FullTextSearchIndexer.java @@ -25,14 +25,14 @@ package org.alfresco.repo.search.impl.lucene.fts; import org.alfresco.service.cmr.repository.StoreRef; -import org.springframework.beans.factory.config.BeanFactoryPostProcessor; +import org.springframework.beans.factory.BeanFactoryAware; /** * API for full text search indexing in the background * * @author andyh */ -public interface FullTextSearchIndexer extends BeanFactoryPostProcessor +public interface FullTextSearchIndexer extends BeanFactoryAware { /** * Mark a store as dirty, requiring a background index update to fix it up. diff --git a/source/java/org/alfresco/repo/search/impl/lucene/fts/FullTextSearchIndexerImpl.java b/source/java/org/alfresco/repo/search/impl/lucene/fts/FullTextSearchIndexerImpl.java index 66fe10aff4..dc3e7de7a7 100644 --- a/source/java/org/alfresco/repo/search/impl/lucene/fts/FullTextSearchIndexerImpl.java +++ b/source/java/org/alfresco/repo/search/impl/lucene/fts/FullTextSearchIndexerImpl.java @@ -34,6 +34,8 @@ import org.alfresco.repo.search.IndexerAndSearcher; import org.alfresco.repo.search.SupportsBackgroundIndexing; import org.alfresco.service.cmr.repository.StoreRef; import org.springframework.beans.BeansException; +import org.springframework.beans.factory.BeanFactory; +import org.springframework.beans.factory.ListableBeanFactory; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; @@ -243,10 +245,13 @@ public class FullTextSearchIndexerImpl implements FTSIndexerAware, FullTextSearc ApplicationContext ctx = new ClassPathXmlApplicationContext("classpath:alfresco/application-context.xml"); } - public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException + + public void setBeanFactory(BeanFactory beanFactory) throws BeansException { + ListableBeanFactory listableBeanFactory = (ListableBeanFactory)beanFactory; + // Find bean implementaing SupportsBackgroundIndexing and register - for(Object bgindexable : beanFactory.getBeansOfType(SupportsBackgroundIndexing.class).values()) + for(Object bgindexable : listableBeanFactory.getBeansOfType(SupportsBackgroundIndexing.class).values()) { if(bgindexable instanceof SupportsBackgroundIndexing) {