import org.apache.archiva.admin.model.runtime.RedbackRuntimeConfigurationAdmin;
import org.apache.archiva.configuration.ArchivaConfiguration;
import org.apache.archiva.configuration.Configuration;
+import org.apache.archiva.configuration.ConfigurationEvent;
+import org.apache.archiva.configuration.ConfigurationListener;
import org.apache.archiva.configuration.IndeterminateConfigurationException;
import org.apache.archiva.redback.components.cache.Cache;
import org.apache.archiva.redback.components.registry.RegistryException;
*/
@Service( "userConfiguration#archiva" )
public class DefaultRedbackRuntimeConfigurationAdmin
- implements RedbackRuntimeConfigurationAdmin, UserConfiguration
+ implements RedbackRuntimeConfigurationAdmin, UserConfiguration, ConfigurationListener
{
protected Logger log = LoggerFactory.getLogger( getClass() );
public RedbackRuntimeConfiguration getRedbackRuntimeConfiguration()
{
- return build( archivaConfiguration.getConfiguration().getRedbackRuntimeConfiguration() );
+ return build( archivaConfiguration.getConfiguration().getRedbackRuntimeConfiguration(), false );
}
public void updateRedbackRuntimeConfiguration( RedbackRuntimeConfiguration redbackRuntimeConfiguration )
}
private RedbackRuntimeConfiguration build(
- org.apache.archiva.configuration.RedbackRuntimeConfiguration runtimeConfiguration )
+ org.apache.archiva.configuration.RedbackRuntimeConfiguration runtimeConfiguration, boolean force )
{
- if ( this.currentRedbackRuntimeConfiguration != null )
+ if ( this.currentRedbackRuntimeConfiguration != null && !force )
{
return this.currentRedbackRuntimeConfiguration;
}
return keysSet;
}
+
+ public void configurationEvent( ConfigurationEvent event )
+ {
+ build( archivaConfiguration.getConfiguration().getRedbackRuntimeConfiguration(), true );
+ }
}