diff options
author | Brett Porter <brett@apache.org> | 2009-11-19 17:16:20 +0000 |
---|---|---|
committer | Brett Porter <brett@apache.org> | 2009-11-19 17:16:20 +0000 |
commit | 4102a4a916f8649dd12182f727b6cb45f4e356b2 (patch) | |
tree | 78b899dd447170dead4a05b24537ddbe59119a9e /archiva-modules/archiva-web/archiva-webdav | |
parent | 644537ee8b7b5620eed6aa14e3a1feb44bc59b5e (diff) | |
download | archiva-4102a4a916f8649dd12182f727b6cb45f4e356b2.tar.gz archiva-4102a4a916f8649dd12182f727b6cb45f4e356b2.zip |
[MRM-1025] split the scheduler into modules to isolate database and indexer dependent code
git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/MRM-1025@882207 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-web/archiva-webdav')
5 files changed, 20 insertions, 19 deletions
diff --git a/archiva-modules/archiva-web/archiva-webdav/pom.xml b/archiva-modules/archiva-web/archiva-webdav/pom.xml index 2a963b1e6..95341522e 100644 --- a/archiva-modules/archiva-web/archiva-webdav/pom.xml +++ b/archiva-modules/archiva-web/archiva-webdav/pom.xml @@ -43,10 +43,6 @@ <artifactId>archiva-repository-layer</artifactId> </dependency> <dependency> - <groupId>org.apache.archiva</groupId> - <artifactId>archiva-scheduled</artifactId> - </dependency> - <dependency> <groupId>org.apache.archiva</groupId> <artifactId>archiva-proxy</artifactId> </dependency> diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java index 113aba0e5..eff87127e 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java @@ -25,9 +25,11 @@ import java.io.FileOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.List; - import javax.servlet.http.HttpServletResponse; +import org.apache.archiva.scheduler.ArchivaTaskScheduler; +import org.apache.archiva.scheduler.repository.RepositoryArchivaTaskScheduler; +import org.apache.archiva.scheduler.repository.RepositoryTask; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.apache.jackrabbit.util.Text; @@ -56,9 +58,6 @@ import org.apache.jackrabbit.webdav.property.ResourceType; import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.maven.archiva.repository.audit.AuditEvent; import org.apache.maven.archiva.repository.audit.AuditListener; -import org.apache.maven.archiva.scheduled.ArchivaTaskScheduler; -import org.apache.maven.archiva.scheduled.tasks.RepositoryTask; -import org.apache.maven.archiva.scheduled.tasks.TaskCreator; import org.apache.maven.archiva.webdav.util.IndexWriter; import org.apache.maven.archiva.webdav.util.MimeTypes; import org.codehaus.plexus.taskqueue.TaskQueueException; @@ -108,7 +107,7 @@ public class ArchivaDavResource public ArchivaDavResource( String localResource, String logicalResource, ManagedRepositoryConfiguration repository, DavSession session, ArchivaDavResourceLocator locator, DavResourceFactory factory, MimeTypes mimeTypes, List<AuditListener> auditListeners, - ArchivaTaskScheduler scheduler ) + RepositoryArchivaTaskScheduler scheduler ) { this.localResource = new File( localResource ); this.logicalResource = logicalResource; @@ -128,7 +127,7 @@ public class ArchivaDavResource public ArchivaDavResource( String localResource, String logicalResource, ManagedRepositoryConfiguration repository, String remoteAddr, String principal, DavSession session, ArchivaDavResourceLocator locator, DavResourceFactory factory, MimeTypes mimeTypes, List<AuditListener> auditListeners, - ArchivaTaskScheduler scheduler ) + RepositoryArchivaTaskScheduler scheduler ) { this( localResource, logicalResource, repository, session, locator, factory, mimeTypes, auditListeners, scheduler ); @@ -645,11 +644,15 @@ public class ArchivaDavResource private void queueRepositoryTask( File localFile ) { - RepositoryTask task = TaskCreator.createRepositoryTask( repository.getId(), localFile, false, true ); - + RepositoryTask task = new RepositoryTask(); + task.setRepositoryId( repository.getId() ); + task.setResourceFile( localFile ); + task.setUpdateRelatedArtifacts( false ); + task.setScanAll( true ); + try { - scheduler.queueRepositoryTask( task ); + scheduler.queueTask( task ); } catch ( TaskQueueException e ) { diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java index 89c271238..ba7915913 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java @@ -27,6 +27,7 @@ import java.util.ArrayList; import java.util.List; import javax.servlet.http.HttpServletResponse; +import org.apache.archiva.scheduler.repository.RepositoryArchivaTaskScheduler; import org.apache.commons.io.FileUtils; import org.apache.commons.lang.StringUtils; import org.apache.jackrabbit.webdav.DavException; @@ -60,7 +61,6 @@ import org.apache.maven.archiva.repository.metadata.RepositoryMetadataException; import org.apache.maven.archiva.repository.metadata.RepositoryMetadataMerge; import org.apache.maven.archiva.repository.metadata.RepositoryMetadataReader; import org.apache.maven.archiva.repository.metadata.RepositoryMetadataWriter; -import org.apache.maven.archiva.scheduled.ArchivaTaskScheduler; import org.apache.maven.archiva.security.ServletAuthenticator; import org.apache.maven.archiva.webdav.util.MimeTypes; import org.apache.maven.archiva.webdav.util.RepositoryPathUtil; @@ -164,9 +164,9 @@ public class ArchivaDavResourceFactory private Digester digestMd5; /** - * @plexus.requirement + * @plexus.requirement role="org.apache.archiva.scheduler.ArchivaTaskScheduler" role-hint="repository" */ - private ArchivaTaskScheduler scheduler; + private RepositoryArchivaTaskScheduler scheduler; public DavResource createResource( final DavResourceLocator locator, final DavServletRequest request, final DavServletResponse response ) @@ -1068,7 +1068,7 @@ public class ArchivaDavResourceFactory this.httpAuth = httpAuth; } - public void setScheduler( ArchivaTaskScheduler scheduler ) + public void setScheduler( RepositoryArchivaTaskScheduler scheduler ) { this.scheduler = scheduler; } diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.xml b/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.xml index a370ddb5f..520a10d36 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.xml +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.xml @@ -149,7 +149,8 @@ <field-name>digestMd5</field-name> </requirement> <requirement> - <role>org.apache.maven.archiva.scheduled.ArchivaTaskScheduler</role> + <role>org.apache.archiva.scheduler.ArchivaTaskScheduler</role> + <role-hint>repository</role-hint> <field-name>scheduler</field-name> </requirement> </requirements> diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletTest.xml b/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletTest.xml index 71c3c0f41..78bdb75ab 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletTest.xml +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletTest.xml @@ -161,7 +161,8 @@ <field-name>digestMd5</field-name> </requirement> <requirement> - <role>org.apache.maven.archiva.scheduled.ArchivaTaskScheduler</role> + <role>org.apache.archiva.scheduler.ArchivaTaskScheduler</role> + <role-hint>repository</role-hint> <field-name>scheduler</field-name> </requirement> </requirements> |