FELIX-2298 : Component annotation: getConfigurationFactory should be named configurationFactory
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@936755 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scr-annotations/pom.xml b/scr-annotations/pom.xml
index 49fd861..52cf5b4 100644
--- a/scr-annotations/pom.xml
+++ b/scr-annotations/pom.xml
@@ -29,7 +29,7 @@
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.annotations</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Annotations for SCR</name>
diff --git a/scr-annotations/src/main/java/org/apache/felix/scr/annotations/Component.java b/scr-annotations/src/main/java/org/apache/felix/scr/annotations/Component.java
index 76db817..e67ba5c 100644
--- a/scr-annotations/src/main/java/org/apache/felix/scr/annotations/Component.java
+++ b/scr-annotations/src/main/java/org/apache/felix/scr/annotations/Component.java
@@ -125,10 +125,17 @@
/**
* Set the metatype factory pid property (only for non factory components).
* @since 1.0
+ * @deprecated Use {@link #configurationFactory()}
*/
boolean getConfigurationFactory() default false;
/**
+ * Set the metatype factory pid property (only for non factory components).
+ * @since 1.3
+ */
+ boolean configurationFactory() default false;
+
+ /**
* The configuration policy
* @since 1.0
*/
diff --git a/scrplugin/pom.xml b/scrplugin/pom.xml
index 78a120f..6c5bacc 100644
--- a/scrplugin/pom.xml
+++ b/scrplugin/pom.xml
@@ -67,7 +67,7 @@
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.annotations</artifactId>
- <version>1.2.0</version>
+ <version>1.3.0-SNAPSHOT</version>
</dependency>
<!-- Sling Servlet SCR Annotation -->
diff --git a/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/ComponentTag.java b/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/ComponentTag.java
index a36c63a..40c979d 100644
--- a/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/ComponentTag.java
+++ b/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/ComponentTag.java
@@ -99,6 +99,14 @@
return Util.getBooleanValue(annotation, "getConfigurationFactory", Component.class);
}
+ public boolean configurationFactory() {
+ final Object obj = annotation.getNamedParameter("configurationFactory");
+ if ( obj != null ) {
+ return Boolean.valueOf(obj.toString());
+ }
+ return getConfigurationFactory();
+ }
+
public Class<? extends java.lang.annotation.Annotation> annotationType() {
return null;
}
@@ -119,7 +127,7 @@
map.put(Constants.COMPONENT_DESCRIPTION, emptyToNull(this.annotation.description()));
map.put(Constants.COMPONENT_ENABLED, String.valueOf(this.annotation.enabled()));
map.put(Constants.COMPONENT_FACTORY, emptyToNull(this.annotation.factory()));
- map.put(Constants.COMPONENT_SET_METATYPE_FACTORY_PID, String.valueOf(this.annotation.getConfigurationFactory()));
+ map.put(Constants.COMPONENT_SET_METATYPE_FACTORY_PID, String.valueOf(this.annotation.configurationFactory()));
// FELIX-593: immediate attribute does not default to true all the
// times hence we only set it if declared in the tag