fix spring annotations for missing checksum consumer

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1179635 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2011-10-06 14:13:37 +00:00
parent 4515893178
commit d66e72fcd2
2 changed files with 48 additions and 64 deletions

View File

@ -34,6 +34,7 @@ import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import javax.inject.Inject;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
@ -51,9 +52,9 @@ public class ArtifactMissingChecksumsConsumer
extends AbstractMonitoredConsumer extends AbstractMonitoredConsumer
implements KnownRepositoryContentConsumer, RegistryListener implements KnownRepositoryContentConsumer, RegistryListener
{ {
private String id; private String id = "create-missing-checksums";
private String description; private String description = "Create Missing and/or Fix Invalid Checksums (.sha1, .md5)";
private ArchivaConfiguration configuration; private ArchivaConfiguration configuration;
@ -71,12 +72,10 @@ public class ArtifactMissingChecksumsConsumer
private List<String> includes = new ArrayList<String>( ); private List<String> includes = new ArrayList<String>( );
public ArtifactMissingChecksumsConsumer(String id, @Inject
String description, public ArtifactMissingChecksumsConsumer( ArchivaConfiguration configuration,
ArchivaConfiguration configuration, FileTypes filetypes )
FileTypes filetypes) { {
this.id = id;
this.description = description;
this.configuration = configuration; this.configuration = configuration;
this.filetypes = filetypes; this.filetypes = filetypes;

View File

@ -30,19 +30,4 @@
<context:annotation-config/> <context:annotation-config/>
<context:component-scan base-package="org.apache.archiva.consumers.core"/> <context:component-scan base-package="org.apache.archiva.consumers.core"/>
<bean id="artifactMissingChecksumsConsumer" class="org.apache.archiva.consumers.core.ArtifactMissingChecksumsConsumer" scope="prototype">
<constructor-arg>
<value>create-missing-checksums</value>
</constructor-arg>
<constructor-arg>
<value>Create Missing and/or Fix Invalid Checksums (.sha1, .md5)</value>
</constructor-arg>
<constructor-arg>
<ref bean="archivaConfiguration"/>
</constructor-arg>
<constructor-arg>
<ref bean="fileTypes"/>
</constructor-arg>
</bean>
<alias name="artifactMissingChecksumsConsumer" alias="knownRepositoryContentConsumer#artifact-missing-checksums-consumer"/>
</beans> </beans>