felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r784057 - in /felix/trunk/scrplugin: pom.xml src/main/java/org/apache/felix/scrplugin/SCRDescriptorMojo.java src/main/java/org/apache/felix/scrplugin/om/metatype/Designate.java src/main/java/org/apache/felix/scrplugin/xml/MetaTypeIO.java
Date Fri, 12 Jun 2009 10:16:49 GMT
Author: cziegeler
Date: Fri Jun 12 10:16:49 2009
New Revision: 784057

URL: http://svn.apache.org/viewvc?rev=784057&view=rev
Log:
FELIX-1225 : Set factoryPid attribute of Designate element if component is a factory.

Modified:
    felix/trunk/scrplugin/pom.xml
    felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorMojo.java
    felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/om/metatype/Designate.java
    felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/xml/MetaTypeIO.java

Modified: felix/trunk/scrplugin/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/pom.xml?rev=784057&r1=784056&r2=784057&view=diff
==============================================================================
--- felix/trunk/scrplugin/pom.xml (original)
+++ felix/trunk/scrplugin/pom.xml Fri Jun 12 10:16:49 2009
@@ -109,7 +109,7 @@
 		<dependency>
 			<groupId>org.apache.felix</groupId>
 			<artifactId>org.apache.felix.scr.annotations</artifactId>
-			<version>0.9.1-SNAPSHOT</version>
+			<version>0.9.0</version>
 		</dependency>
 		
 	</dependencies>

Modified: felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorMojo.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorMojo.java?rev=784057&r1=784056&r2=784057&view=diff
==============================================================================
--- felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorMojo.java
(original)
+++ felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorMojo.java
Fri Jun 12 10:16:49 2009
@@ -434,7 +434,11 @@
             // designate
             final Designate designate = new Designate();
             metaData.addDesignate(designate);
-            designate.setPid(component.getName());
+            if ( component.getFactory() != null ) {
+                designate.setFactoryPid(component.getName());
+            } else {
+                designate.setPid(component.getName());
+            }
             // designate.object
             final MTObject mtobject = new MTObject();
             designate.setObject(mtobject);

Modified: felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/om/metatype/Designate.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/om/metatype/Designate.java?rev=784057&r1=784056&r2=784057&view=diff
==============================================================================
--- felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/om/metatype/Designate.java
(original)
+++ felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/om/metatype/Designate.java
Fri Jun 12 10:16:49 2009
@@ -22,6 +22,8 @@
 
     protected String pid;
 
+    protected String factoryPid;
+
     protected MTObject object;
 
     public String getPid() {
@@ -32,6 +34,14 @@
         this.pid = pid;
     }
 
+    public String getFactoryPid() {
+        return this.factoryPid;
+    }
+
+    public void setFactoryPid(String pid) {
+        this.factoryPid = pid;
+    }
+
     public MTObject getObject() {
         return this.object;
     }

Modified: felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/xml/MetaTypeIO.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/xml/MetaTypeIO.java?rev=784057&r1=784056&r2=784057&view=diff
==============================================================================
--- felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/xml/MetaTypeIO.java (original)
+++ felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/xml/MetaTypeIO.java Fri
Jun 12 10:16:49 2009
@@ -178,6 +178,7 @@
     throws SAXException {
         final AttributesImpl ai = new AttributesImpl();
         IOUtils.addAttribute(ai, "pid", designate.getPid());
+        IOUtils.addAttribute(ai, "factoryPid", designate.getFactoryPid());
         IOUtils.indent(contentHandler, 1);
         contentHandler.startElement(INNER_NAMESPACE_URI, DESIGNATE_ELEMENT, DESIGNATE_ELEMENT_QNAME,
ai);
         IOUtils.newline(contentHandler);



Mime
View raw message