Context to disable avm indexing

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5716 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Andrew Hind
2007-05-18 08:22:03 +00:00
parent 19ce257baa
commit 5a8f9282b6
3 changed files with 104 additions and 61 deletions

View File

@@ -0,0 +1,19 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<!-- disable avm indexing -->
<bean id="avmSnapShotTriggeredIndexingMethodInterceptor" class="org.alfresco.repo.search.AVMSnapShotTriggeredIndexingMethodInterceptor">
<property name="avmService">
<ref bean="avmService" />
</property>
<property name="indexerAndSearcher">
<ref bean="avmLuceneIndexerAndSearcherFactory" />
</property>
<property name="enableIndexing">
<value>false</value>
</property>
</bean>
</beans>

View File

@@ -862,6 +862,9 @@
<property name="indexerAndSearcher">
<ref bean="avmLuceneIndexerAndSearcherFactory" />
</property>
<property name="enableIndexing">
<value>true</value>
</property>
</bean>
<!-- The AVMSyncService -->

View File

@@ -35,7 +35,6 @@ import org.aopalliance.intercept.MethodInvocation;
* Method interceptor for atomic indexing of AVM entries
*
* @author andyh
*
*/
public class AVMSnapShotTriggeredIndexingMethodInterceptor implements MethodInterceptor
{
@@ -43,7 +42,11 @@ public class AVMSnapShotTriggeredIndexingMethodInterceptor implements MethodInte
private IndexerAndSearcher indexerAndSearcher;
private boolean enableIndexing = true;
public Object invoke(MethodInvocation mi) throws Throwable
{
if (enableIndexing)
{
if (mi.getMethod().getName().equals("createSnapshot"))
{
@@ -118,11 +121,16 @@ public class AVMSnapShotTriggeredIndexingMethodInterceptor implements MethodInte
{
return mi.proceed();
}
}
else
{
return mi.proceed();
}
}
/**
* Set the AVM service
*
* @param avmService
*/
public void setAvmService(AVMService avmService)
@@ -132,6 +140,7 @@ public class AVMSnapShotTriggeredIndexingMethodInterceptor implements MethodInte
/**
* Set the AVM indexer and searcher
*
* @param indexerAndSearcher
*/
public void setIndexerAndSearcher(IndexerAndSearcher indexerAndSearcher)
@@ -139,4 +148,16 @@ public class AVMSnapShotTriggeredIndexingMethodInterceptor implements MethodInte
this.indexerAndSearcher = indexerAndSearcher;
}
/**
* Enable or disable indexing
*
* @param enableIndexing
*/
public void setEnableIndexing(boolean enableIndexing)
{
this.enableIndexing = enableIndexing;
}
}