|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.maven.archiva.configuration.DefaultArchivaConfiguration
public class DefaultArchivaConfiguration
Implementation of configuration holder that retrieves it from the registry.
The registry layers and merges the 2 configuration files: user, and application server.
Instead of relying on the model defaults, if the registry is empty a default configuration file is loaded and applied from a resource. The defaults are not loaded into the registry as the lists (eg repositories) could no longer be removed if that was the case.
When saving the configuration, it is saved to the location it was read from. If it was read from the defaults, it will be saved to the user location. However, if the configuration contains information from both sources, an exception is raised as this is currently unsupported. The reason for this is that it is not possible to identify where to re-save elements, and can result in list configurations (eg repositories) becoming inconsistent.
If the configuration is outdated, it will be upgraded when it is loaded. This is done by checking the version flag before reading it from the registry.
Field Summary |
---|
Fields inherited from interface org.apache.maven.archiva.configuration.ArchivaConfiguration |
---|
ROLE |
Constructor Summary | |
---|---|
DefaultArchivaConfiguration()
|
Method Summary | |
---|---|
void |
addChangeListener(org.codehaus.plexus.registry.RegistryListener listener)
Add a registry listener to notify of events in plexus-registry. |
void |
addListener(ConfigurationListener listener)
Add a configuration listener to notify of changes to the configuration. |
void |
afterConfigurationChange(org.codehaus.plexus.registry.Registry registry,
java.lang.String propertyName,
java.lang.Object propertyValue)
|
void |
beforeConfigurationChange(org.codehaus.plexus.registry.Registry registry,
java.lang.String propertyName,
java.lang.Object propertyValue)
|
java.lang.String |
getAltConfigFilename()
|
org.apache.maven.archiva.configuration.Configuration |
getConfiguration()
Get the configuration. |
java.lang.String |
getUserConfigFilename()
|
void |
initialize()
|
boolean |
isDefaulted()
Determines if the configuration in use was as a result of a defaulted configuration. |
void |
removeListener(ConfigurationListener listener)
Remove a configuration listener to stop notifications of changes to the configuration. |
void |
save(org.apache.maven.archiva.configuration.Configuration configuration)
Save any updated configuration. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultArchivaConfiguration()
Method Detail |
---|
public org.apache.maven.archiva.configuration.Configuration getConfiguration()
ArchivaConfiguration
getConfiguration
in interface ArchivaConfiguration
public void save(org.apache.maven.archiva.configuration.Configuration configuration) throws org.codehaus.plexus.registry.RegistryException, IndeterminateConfigurationException
ArchivaConfiguration
save
in interface ArchivaConfiguration
configuration
- the configuration to save
org.codehaus.plexus.registry.RegistryException
- if there is a problem saving the registry data
IndeterminateConfigurationException
- if the configuration cannot be saved because it was read from two sourcespublic void addListener(ConfigurationListener listener)
ArchivaConfiguration
addListener
in interface ArchivaConfiguration
listener
- the listenerpublic void removeListener(ConfigurationListener listener)
ArchivaConfiguration
removeListener
in interface ArchivaConfiguration
listener
- the listenerpublic void addChangeListener(org.codehaus.plexus.registry.RegistryListener listener)
ArchivaConfiguration
addChangeListener
in interface ArchivaConfiguration
listener
- the listener
TODO: Remove in future.public void initialize() throws org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException
initialize
in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable
org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException
public void beforeConfigurationChange(org.codehaus.plexus.registry.Registry registry, java.lang.String propertyName, java.lang.Object propertyValue)
beforeConfigurationChange
in interface org.codehaus.plexus.registry.RegistryListener
public void afterConfigurationChange(org.codehaus.plexus.registry.Registry registry, java.lang.String propertyName, java.lang.Object propertyValue)
afterConfigurationChange
in interface org.codehaus.plexus.registry.RegistryListener
public java.lang.String getUserConfigFilename()
public java.lang.String getAltConfigFilename()
public boolean isDefaulted()
ArchivaConfiguration
isDefaulted
in interface ArchivaConfiguration
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |