]> source.dussan.org Git - archiva.git/commitdiff
PR: MRM-38
authorEdwin L. Punzalan <epunzalan@apache.org>
Thu, 23 Feb 2006 02:19:17 +0000 (02:19 +0000)
committerEdwin L. Punzalan <epunzalan@apache.org>
Thu, 23 Feb 2006 02:19:17 +0000 (02:19 +0000)
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

maven-repository-webapp/pom.xml
maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/PackageSearchAction.java
maven-repository-webapp/src/main/resources/plexus/components.xml [new file with mode: 0644]

index 6dc4c77fefe56fb8f7595bb2eee0fe9e0d9b19b7..d3df67b13a406b85ee7597d939edd937eac60943 100644 (file)
       <!-- 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>
index 5f6acc812efa8abb745f7438195f383736938a69..75d05a35781195ad81099f2f3eb2e7e27f051b64 100644 (file)
@@ -21,11 +21,11 @@ import org.apache.maven.artifact.repository.ArtifactRepository;
 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 @@ public class PackageSearchAction
 
         DefaultRepositoryIndexSearcher searcher = factory.createDefaultRepositoryIndexSearcher( index );
 
-        artifacts = searcher.search( new SinglePhraseQuery( key, searchTerm ) );
-
         return SUCCESS;
     }
 
diff --git a/maven-repository-webapp/src/main/resources/plexus/components.xml b/maven-repository-webapp/src/main/resources/plexus/components.xml
new file mode 100644 (file)
index 0000000..f3f6415
--- /dev/null
@@ -0,0 +1,38 @@
+<component-set>\r
+  <components>\r
+    <component>\r
+      <role>com.opensymphony.xwork.ActionSupport</role>\r
+      <role-hint>index</role-hint>\r
+      <implementation>org.apache.maven.repository.manager.web.action.PackageSearchAction</implementation>\r
+      <instantiation-strategy>per-lookup</instantiation-strategy>\r
+    </component>\r
+    <component>\r
+      <role>org.codehaus.plexus.scheduler.Scheduler</role>\r
+      <implementation>org.codehaus.plexus.scheduler.DefaultScheduler</implementation>\r
+      <configuration>\r
+        <properties>\r
+          <property>\r
+            <name>org.quartz.scheduler.instanceName</name>\r
+            <value>repositoryScheduler</value>\r
+          </property>\r
+          <property>\r
+            <name>org.quartz.threadPool.class</name>\r
+            <value>org.quartz.simpl.SimpleThreadPool</value>\r
+          </property>\r
+          <property>\r
+            <name>org.quartz.threadPool.threadCount</name>\r
+            <value>15</value>\r
+          </property>\r
+          <property>\r
+            <name>org.quartz.threadPool.threadPriority</name>\r
+            <value>4</value>\r
+          </property>\r
+          <property>\r
+            <name>org.quartz.jobStore.class</name>\r
+            <value>org.quartz.simpl.RAMJobStore</value>\r
+          </property>\r
+        </properties>\r
+      </configuration>\r
+    </component>\r
+  </components>\r
+</component-set>\r