Browse Source

[MRM-1837] so as it's only prototype we can assume configuration will not change during the use of the bean

tags/archiva-2.1.0
Olivier Lamy 10 years ago
parent
commit
011e7b0ee8

+ 11
- 5
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java View File

@@ -50,7 +50,9 @@ import java.util.List;
@Scope( "prototype" )
public class ArtifactMissingChecksumsConsumer
extends AbstractMonitoredConsumer
implements KnownRepositoryContentConsumer, RegistryListener
implements KnownRepositoryContentConsumer
// it's prototype bean so we assume configuration won't change during a run
//, RegistryListener
{
private String id = "create-missing-checksums";

@@ -78,7 +80,7 @@ public class ArtifactMissingChecksumsConsumer
this.configuration = configuration;
this.filetypes = filetypes;

configuration.addChangeListener( this );
//configuration.addChangeListener( this );

initIncludes();
}
@@ -197,6 +199,7 @@ public class ArtifactMissingChecksumsConsumer
}
}

/*
@Override
public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue )
{
@@ -206,22 +209,25 @@ public class ArtifactMissingChecksumsConsumer
}
}


@Override
public void beforeConfigurationChange( Registry registry, String propertyName, Object propertyValue )
{
/* do nothing */
// do nothing
}

*/

private void initIncludes()
{
includes = new ArrayList<String>( filetypes.getFileTypePatterns( FileTypes.ARTIFACTS ) );
includes = new ArrayList<>( filetypes.getFileTypePatterns( FileTypes.ARTIFACTS ) );

}

@PostConstruct
public void initialize()
{
configuration.addChangeListener( this );
//configuration.addChangeListener( this );

initIncludes();
}

+ 8
- 4
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/MetadataUpdaterConsumer.java View File

@@ -61,7 +61,9 @@ import java.util.List;
@Scope( "prototype" )
public class MetadataUpdaterConsumer
extends AbstractMonitoredConsumer
implements KnownRepositoryContentConsumer, RegistryListener
implements KnownRepositoryContentConsumer
// it's prototype bean so we assume configuration won't change during a run
//, RegistryListener
{
private Logger log = LoggerFactory.getLogger( MetadataUpdaterConsumer.class );

@@ -292,6 +294,7 @@ public class MetadataUpdaterConsumer
return false;
}

/*
@Override
public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue )
{
@@ -304,18 +307,19 @@ public class MetadataUpdaterConsumer
@Override
public void beforeConfigurationChange( Registry registry, String propertyName, Object propertyValue )
{
/* do nothing here */
// do nothing here
}
*/

private void initIncludes()
{
includes = new ArrayList<String>( filetypes.getFileTypePatterns( FileTypes.ARTIFACTS ) );
includes = new ArrayList<>( filetypes.getFileTypePatterns( FileTypes.ARTIFACTS ) );
}

@PostConstruct
public void initialize()
{
configuration.addChangeListener( this );
//configuration.addChangeListener( this );

initIncludes();
}

Loading…
Cancel
Save