summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/MergedRemoteIndexesTask.java (renamed from archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/MergedRemoteIndexesTaskJob.java)25
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java13
2 files changed, 26 insertions, 12 deletions
diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/MergedRemoteIndexesTaskJob.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/MergedRemoteIndexesTask.java
index 5fe748871..2e19eb640 100644
--- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/MergedRemoteIndexesTaskJob.java
+++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/MergedRemoteIndexesTask.java
@@ -32,20 +32,33 @@ import java.io.File;
* @author Olivier Lamy
* @since 2.0.0
*/
-public class MergedRemoteIndexesTaskJob
- extends AbstractJob
+public class MergedRemoteIndexesTask
+ implements Runnable
{
private Logger logger = LoggerFactory.getLogger( getClass() );
- @Override
- public void execute( JobExecutionContext context )
- throws JobExecutionException
+ private MergedRemoteIndexesTaskRequest mergedRemoteIndexesTaskRequest;
+
+ public MergedRemoteIndexesTask( MergedRemoteIndexesTaskRequest mergedRemoteIndexesTaskRequest )
{
+ this.mergedRemoteIndexesTaskRequest = mergedRemoteIndexesTaskRequest;
+ }
+ @Override
+ public void run()
+ {
+ try
+ {
+ this.execute();
+ }
+ catch ( IndexMergerException e )
+ {
+ logger.error( e.getMessage(), e );
+ }
}
- public MergedRemoteIndexesTaskResult execute( MergedRemoteIndexesTaskRequest mergedRemoteIndexesTaskRequest )
+ public MergedRemoteIndexesTaskResult execute( )
throws IndexMergerException
{
IndexMerger indexMerger = mergedRemoteIndexesTaskRequest.indexMerger;
diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java
index b6af5e3f9..cbe1172ba 100644
--- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java
+++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java
@@ -38,7 +38,7 @@ import org.apache.archiva.configuration.RepositoryGroupConfiguration;
import org.apache.archiva.indexer.merger.IndexMerger;
import org.apache.archiva.indexer.merger.IndexMergerException;
import org.apache.archiva.indexer.merger.IndexMergerRequest;
-import org.apache.archiva.indexer.merger.MergedRemoteIndexesTaskJob;
+import org.apache.archiva.indexer.merger.MergedRemoteIndexesTask;
import org.apache.archiva.indexer.merger.TemporaryGroupIndex;
import org.apache.archiva.indexer.search.RepositorySearch;
import org.apache.archiva.maven2.metadata.MavenMetadataReader;
@@ -72,7 +72,6 @@ import org.apache.archiva.repository.metadata.RepositoryMetadataWriter;
import org.apache.archiva.scheduler.repository.model.RepositoryArchivaTaskScheduler;
import org.apache.archiva.security.ServletAuthenticator;
import org.apache.archiva.webdav.util.MimeTypes;
-import org.apache.archiva.webdav.util.RepositoryPathUtil;
import org.apache.archiva.webdav.util.TemporaryGroupIndexSessionCleaner;
import org.apache.archiva.webdav.util.WebdavMethodUtil;
import org.apache.archiva.xml.XMLException;
@@ -1317,12 +1316,14 @@ public class ArchivaDavResourceFactory
repositoryGroupConfiguration.getMergedIndexTtl() ).mergedIndexDirectory(
tempRepoFile );
- MergedRemoteIndexesTaskJob job = new MergedRemoteIndexesTaskJob();
- MergedRemoteIndexesTaskJob.MergedRemoteIndexesTaskRequest taskRequest =
- new MergedRemoteIndexesTaskJob.MergedRemoteIndexesTaskRequest(indexMergerRequest, indexMerger);
- IndexingContext indexingContext = job.execute( taskRequest ).getIndexingContext();
+ MergedRemoteIndexesTask.MergedRemoteIndexesTaskRequest taskRequest =
+ new MergedRemoteIndexesTask.MergedRemoteIndexesTaskRequest(indexMergerRequest, indexMerger);
+
+ MergedRemoteIndexesTask job = new MergedRemoteIndexesTask( taskRequest );
+
+ IndexingContext indexingContext = job.execute().getIndexingContext();
File mergedRepoDir = indexingContext.getIndexDirectoryFile();
TemporaryGroupIndex temporaryGroupIndex =