You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ol...@apache.org on 2013/01/08 21:08:13 UTC
svn commit: r1430476 - in
/archiva/redback/redback-components/trunk/spring-registry:
spring-registry-api/src/main/java/org/apache/archiva/redback/components/registry/
spring-registry-commons/src/main/java/org/apache/archiva/redback/components/registry/...
Author: olamy
Date: Tue Jan 8 20:08:12 2013
New Revision: 1430476
URL: http://svn.apache.org/viewvc?rev=1430476&view=rev
Log:
add getFullKeys to get keys with full level
Modified:
archiva/redback/redback-components/trunk/spring-registry/spring-registry-api/src/main/java/org/apache/archiva/redback/components/registry/Registry.java
archiva/redback/redback-components/trunk/spring-registry/spring-registry-commons/src/main/java/org/apache/archiva/redback/components/registry/commons/CommonsConfigurationRegistry.java
Modified: archiva/redback/redback-components/trunk/spring-registry/spring-registry-api/src/main/java/org/apache/archiva/redback/components/registry/Registry.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-registry/spring-registry-api/src/main/java/org/apache/archiva/redback/components/registry/Registry.java?rev=1430476&r1=1430475&r2=1430476&view=diff
==============================================================================
--- archiva/redback/redback-components/trunk/spring-registry/spring-registry-api/src/main/java/org/apache/archiva/redback/components/registry/Registry.java (original)
+++ archiva/redback/redback-components/trunk/spring-registry/spring-registry-api/src/main/java/org/apache/archiva/redback/components/registry/Registry.java Tue Jan 8 20:08:12 2013
@@ -228,7 +228,14 @@ public interface Registry
*
* @return the set of keys
*/
- Collection getKeys();
+ Collection<String> getKeys();
+
+ /**
+ * Get all the keys in this registry.
+ *
+ * @return the set of keys
+ */
+ Collection<String> getFullKeys();
/**
* Remove a keyed element from the registry.
Modified: archiva/redback/redback-components/trunk/spring-registry/spring-registry-commons/src/main/java/org/apache/archiva/redback/components/registry/commons/CommonsConfigurationRegistry.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-registry/spring-registry-commons/src/main/java/org/apache/archiva/redback/components/registry/commons/CommonsConfigurationRegistry.java?rev=1430476&r1=1430475&r2=1430476&view=diff
==============================================================================
--- archiva/redback/redback-components/trunk/spring-registry/spring-registry-commons/src/main/java/org/apache/archiva/redback/components/registry/commons/CommonsConfigurationRegistry.java (original)
+++ archiva/redback/redback-components/trunk/spring-registry/spring-registry-commons/src/main/java/org/apache/archiva/redback/components/registry/commons/CommonsConfigurationRegistry.java Tue Jan 8 20:08:12 2013
@@ -60,9 +60,8 @@ import java.util.Set;
* the format of an input to the Commons Configuration
* <a href="http://jakarta.apache.org/commons/configuration/howto_configurationbuilder.html">configuration
* builder</a>.
- *
*/
-@Service("commons-configuration")
+@Service( "commons-configuration" )
public class CommonsConfigurationRegistry
implements Registry
{
@@ -73,7 +72,7 @@ public class CommonsConfigurationRegistr
private Logger logger = LoggerFactory.getLogger( getClass() );
- private String propertyDelimiter = "@@";
+ private String propertyDelimiter = ".";
/**
* The configuration properties for the registry. This should take the format of an input to the Commons
@@ -191,13 +190,13 @@ public class CommonsConfigurationRegistr
configuration.addConfigurationListener( new ConfigurationListenerDelegate( listener, this ) );
}
- public Collection getKeys()
+ public Collection<String> getKeys()
{
- Set keys = new HashSet();
+ Set<String> keys = new HashSet<String>();
- for ( Iterator i = configuration.getKeys(); i.hasNext(); )
+ for ( Iterator<String> i = configuration.getKeys(); i.hasNext(); )
{
- String key = (String) i.next();
+ String key = i.next();
int index = key.indexOf( '.' );
if ( index < 0 )
@@ -213,6 +212,18 @@ public class CommonsConfigurationRegistr
return keys;
}
+ public Collection getFullKeys()
+ {
+ Set<String> keys = new HashSet<String>();
+
+ for ( Iterator<String> i = configuration.getKeys(); i.hasNext(); )
+ {
+ keys.add( i.next() );
+ }
+
+ return keys;
+ }
+
public void remove( String key )
{
configuration.clearProperty( key );
@@ -371,7 +382,7 @@ public class CommonsConfigurationRegistr
try
{
CombinedConfiguration configuration;
- if ( StringUtils.isNotBlank( properties) )
+ if ( StringUtils.isNotBlank( properties ) )
{
try
{
@@ -386,9 +397,11 @@ public class CommonsConfigurationRegistr
String interpolatedProps = interpolator.interpolate( properties );
- logger.debug( "Loading configuration into commons-configuration, xml {}",interpolatedProps );
+ logger.debug( "Loading configuration into commons-configuration, xml {}", interpolatedProps );
builder.load( new StringReader( interpolatedProps ) );
configuration = builder.getConfiguration( false );
+ configuration.setExpressionEngine( expressionEngine );
+ //configuration.set
}
catch ( InterpolationException e )
{