PR: MRM-38

Submitted by: John Tolentino

patch for background task scheduler

git-svn-id: https://svn.apache.org/repos/asf/maven/repository-manager/trunk@380024 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Edwin L. Punzalan 2006-02-23 02:19:17 +00:00
parent 9f13396757
commit df04a57088
3 changed files with 50 additions and 4 deletions

View File

@ -25,6 +25,11 @@
<!-- TODO: actually, just exclude from WAR plugin -->
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-quartz</artifactId>
<version>1.0-alpha-2-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<finalName>maven-repository-webapp</finalName>

View File

@ -21,11 +21,11 @@
import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.apache.maven.repository.indexing.ArtifactRepositoryIndex;
import org.apache.maven.repository.indexing.DefaultRepositoryIndexSearcher;
import org.apache.maven.repository.indexing.RepositoryIndexException;
import org.apache.maven.repository.indexing.RepositoryIndexSearchException;
import org.apache.maven.repository.indexing.RepositoryIndexingFactory;
import org.apache.maven.repository.indexing.DefaultRepositoryIndexSearcher;
import org.apache.maven.repository.indexing.query.SinglePhraseQuery;
import org.codehaus.plexus.scheduler.Scheduler;
import java.io.File;
import java.net.MalformedURLException;
@ -44,6 +44,11 @@ public class PackageSearchAction
private String md5;
/**
* @plexus.requirement
*/
private Scheduler scheduler;
/**
* @plexus.requirement
*/
@ -92,8 +97,6 @@ else if ( md5 != null && md5.length() != 0 )
DefaultRepositoryIndexSearcher searcher = factory.createDefaultRepositoryIndexSearcher( index );
artifacts = searcher.search( new SinglePhraseQuery( key, searchTerm ) );
return SUCCESS;
}

View File

@ -0,0 +1,38 @@
<component-set>
<components>
<component>
<role>com.opensymphony.xwork.ActionSupport</role>
<role-hint>index</role-hint>
<implementation>org.apache.maven.repository.manager.web.action.PackageSearchAction</implementation>
<instantiation-strategy>per-lookup</instantiation-strategy>
</component>
<component>
<role>org.codehaus.plexus.scheduler.Scheduler</role>
<implementation>org.codehaus.plexus.scheduler.DefaultScheduler</implementation>
<configuration>
<properties>
<property>
<name>org.quartz.scheduler.instanceName</name>
<value>repositoryScheduler</value>
</property>
<property>
<name>org.quartz.threadPool.class</name>
<value>org.quartz.simpl.SimpleThreadPool</value>
</property>
<property>
<name>org.quartz.threadPool.threadCount</name>
<value>15</value>
</property>
<property>
<name>org.quartz.threadPool.threadPriority</name>
<value>4</value>
</property>
<property>
<name>org.quartz.jobStore.class</name>
<value>org.quartz.simpl.RAMJobStore</value>
</property>
</properties>
</configuration>
</component>
</components>
</component-set>