felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r893960 [2/7] - in /felix/trunk/ipojo: annotations/src/main/java/org/apache/felix/ipojo/annotations/ api/ api/src/main/java/org/apache/felix/ipojo/api/ arch/ composite/ composite/src/main/java/org/apache/felix/ipojo/composite/service/provid...
Date Sat, 26 Dec 2009 11:15:44 GMT
Modified: felix/trunk/ipojo/junit4osgi/junit4osgi/metadata.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/junit4osgi/junit4osgi/metadata.xml?rev=893960&r1=893959&r2=893960&view=diff
==============================================================================
--- felix/trunk/ipojo/junit4osgi/junit4osgi/metadata.xml (original)
+++ felix/trunk/ipojo/junit4osgi/junit4osgi/metadata.xml Sat Dec 26 11:15:42 2009
@@ -1,36 +1,36 @@
 <!--
-	Licensed to the Apache Software Foundation (ASF) under one
-	or more contributor license agreements.  See the NOTICE file
-	distributed with this work for additional information
-	regarding copyright ownership.  The ASF licenses this file
-	to you under the Apache License, Version 2.0 (the
-	"License"); you may not use this file except in compliance
-	with the License.  You may obtain a copy of the License at
-	
-	http://www.apache.org/licenses/LICENSE-2.0
-	
-	Unless required by applicable law or agreed to in writing,
-	software distributed under the License is distributed on an
-	"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-	KIND, either express or implied.  See the License for the
-	specific language governing permissions and limitations
-	under the License.
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
 -->
 <ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="org.apache.felix.ipojo http://people.apache.org/~clement/ipojo/schemas/core.xsd 
-	    org.apache.felix.ipojo.extender http://people.apache.org/~clement/ipojo/schemas/extender-pattern.xsd"
-	xmlns="org.apache.felix.ipojo"
-	xmlns:extender="org.apache.felix.ipojo.extender">
-	<component
-		classname="org.apache.felix.ipojo.junit4osgi.impl.JunitExtender">
-		<extender:extender extension="Test-Suite"
-			onArrival="onBundleArrival" onDeparture="onBundleDeparture" />
-		<callback transition="invalidate" method="stopping" />
-		<callback transition="validate" method="starting" />
-		<requires field="m_log" optional="true" 
-			default-implementation="org.apache.felix.ipojo.junit4osgi.impl.LogServiceImpl"/>
-		<provides />
-	</component>
-	<instance
-		component="org.apache.felix.ipojo.junit4osgi.impl.JunitExtender" />
-</ipojo>
\ No newline at end of file
+  xsi:schemaLocation="org.apache.felix.ipojo http://people.apache.org/~clement/ipojo/schemas/core.xsd 
+      org.apache.felix.ipojo.extender http://people.apache.org/~clement/ipojo/schemas/extender-pattern.xsd"
+  xmlns="org.apache.felix.ipojo"
+  xmlns:extender="org.apache.felix.ipojo.extender">
+  <component
+    classname="org.apache.felix.ipojo.junit4osgi.impl.JunitExtender">
+    <extender:extender extension="Test-Suite"
+      onArrival="onBundleArrival" onDeparture="onBundleDeparture" />
+    <callback transition="invalidate" method="stopping" />
+    <callback transition="validate" method="starting" />
+    <requires field="m_log" optional="true" 
+      default-implementation="org.apache.felix.ipojo.junit4osgi.impl.LogServiceImpl"/>
+    <provides />
+  </component>
+  <instance
+    component="org.apache.felix.ipojo.junit4osgi.impl.JunitExtender" />
+</ipojo>

Modified: felix/trunk/ipojo/junit4osgi/maven-junit4osgi-plugin/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/junit4osgi/maven-junit4osgi-plugin/pom.xml?rev=893960&r1=893959&r2=893960&view=diff
==============================================================================
--- felix/trunk/ipojo/junit4osgi/maven-junit4osgi-plugin/pom.xml (original)
+++ felix/trunk/ipojo/junit4osgi/maven-junit4osgi-plugin/pom.xml Sat Dec 26 11:15:42 2009
@@ -67,7 +67,6 @@
       <groupId>org.apache.felix</groupId>
       <artifactId>org.apache.felix.ipojo.handler.extender</artifactId>
       <version>1.5.0-SNAPSHOT</version>
-      <scope>runtime</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.felix</groupId>

Modified: felix/trunk/ipojo/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/Junit4osgiPlugin.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/Junit4osgiPlugin.java?rev=893960&r1=893959&r2=893960&view=diff
==============================================================================
--- felix/trunk/ipojo/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/Junit4osgiPlugin.java (original)
+++ felix/trunk/ipojo/junit4osgi/maven-junit4osgi-plugin/src/main/java/org/apache/felix/ipojo/junit4osgi/plugin/Junit4osgiPlugin.java Sat Dec 26 11:15:42 2009
@@ -1,4 +1,4 @@
-/* 
+/*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -24,6 +24,7 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -34,11 +35,13 @@
 
 import junit.framework.AssertionFailedError;
 import junit.framework.Test;
+import junit.framework.TestCase;
 import junit.framework.TestFailure;
 import junit.framework.TestListener;
 import junit.framework.TestResult;
 
 import org.apache.felix.framework.Felix;
+import org.apache.felix.ipojo.junit4osgi.OSGiJunitRunner;
 import org.apache.felix.ipojo.junit4osgi.plugin.log.LogServiceImpl;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.plugin.AbstractMojo;
@@ -52,153 +55,153 @@
 
 /**
  * Goal starting Felix and executing junit4osgi tests.
- *  
+ *
  * @goal test
  * @phase integration-test
  * @requiresDependencyResolution runtime
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- * 
+ *
  */
 public class Junit4osgiPlugin extends AbstractMojo {
 
     /**
      * The Maven project.
-     * 
+     *
      * @parameter expression="${project}"
      * @required
      * @readonly
      */
     private MavenProject m_project;
-    
+
     /**
-     * Dependencies of the current plugin. 
+     * Dependencies of the current plugin.
      * @parameter expression="${plugin.artifacts}"
      */
     private java.util.List m_pluginArtifacts;
-    
+
     /**
      * Base directory where all reports are written to.
-     * 
+     *
      * @parameter expression="${project.build.directory}/surefire-reports"
      */
     private File m_reportsDirectory;
-    
+
     /**
      * Base directory where all reports are written to.
-     * 
+     *
      * @parameter expression="${project.build.directory}"
      */
     private File m_targetDir;
-    
+
     /**
      * Must the current artifact be deployed?
-     * 
+     *
      * @parameter expression="${deployProjectArtifact}" default-value="true"
      */
     private boolean m_deployProjectArtifact;
-    
+
     /**
      * Required bundles.
-     * 
+     *
      * @parameter
      */
     private List bundles;
-    
+
     /**
      * Felix configuration.
-     * 
+     *
      * @parameter
      */
     private Map configuration;
-    
+
     /**
      * Enables / Disables the log service provided by the plugin.
-     * 
+     *
      * @parameter expression="${logService}" default-value="true"
      */
     private boolean m_logEnable;
-    
+
     /**
      * Number of executed test case.
      */
     private int m_total;
-    
+
     /**
      * Number of failing test case.
      */
     private int m_totalFailures;
-    
+
     /**
      * Number of test case in error .
      */
     private int m_totalErrors;
-    
+
     /**
      * Test results in error.
      */
     private List m_errors = new ArrayList();
-    
+
     /**
-     * Failing test results. 
+     * Failing test results.
      */
     private List m_failures = new ArrayList();
-    
+
     /**
      * Test results.
      */
     private List m_results = new ArrayList();
-    
+
     /**
      * Log Service exposed by the plug-in framework.
      */
     private LogServiceImpl m_logService;
-    
+
     /**
      * Set this to 'true' to bypass unit tests entirely. Its use is NOT RECOMMENDED, especially if you
      * enable it using the "maven.test.skip" property, because maven.test.skip disables both running the
      * tests and compiling the tests.  Consider using the skipTests parameter instead.
-     * 
+     *
      * @parameter expression="${maven.test.skip}"
      */
     private boolean skip;
-    
+
     /**
      * Set this to true to ignore a failure during testing. Its use is NOT RECOMMENDED, but quite convenient on
      * occasion.
-     * 
+     *
      * @parameter expression="${maven.test.failure.ignore}"
      */
     private boolean testFailureIgnore;
-    
+
     /**
      * Set this to avoid printing test execution trace on System.out and System.err. This will be written in the
      * reports.
-     * @parameter 
+     * @parameter
      */
     private boolean hideOutputs;
-    
+
     /**
      * Felix configuration.
      */
     private Map felixConf;
-    
-   
+
+
     /**
      * Executes the plug-in.
      * @throws MojoFailureException when the test execution failed.
      * @see org.apache.maven.plugin.AbstractMojo#execute()
      */
     public void execute() throws MojoFailureException {
-        
+
         if (skip) {
             getLog().info("Tests are skipped");
             return;
         }
-       
-        
+
+
         List bundles = parseBundleList();
         bundles.addAll(getTestBundle());
-        
+
         List activators = new ArrayList();
         m_logService = new LogServiceImpl();
         if (m_logEnable) { // Starts the log service if enabled
@@ -213,13 +216,13 @@
         felixConf.put("ipojo.log.level", "WARNING");
         // Use a boot delagation to share classes between the host and the embedded Felix.
         // The cobertura package is used during code coverage collection
-        //felixConf.put("org.osgi.framework.bootdelegation", "net.sourceforge.cobertura.coveragedata"); 
+        //felixConf.put("org.osgi.framework.bootdelegation", "net.sourceforge.cobertura.coveragedata");
         felixConf.put("org.osgi.framework.system.packages.extra", "org.osgi.service.log;version=1.3, junit.framework;version=1.3");
 
         //felixConf.put("org.osgi.framework.system.packages.extra", "org.osgi.service.log, junit.framework");
-        
-        felixConf.put("org.osgi.framework.storage", m_targetDir.getAbsolutePath() + "/felix-cache"); 
-        
+
+        felixConf.put("org.osgi.framework.storage", m_targetDir.getAbsolutePath() + "/felix-cache");
+
         felixConf.put(Constants.FRAMEWORK_BUNDLE_PARENT, Constants.FRAMEWORK_BUNDLE_PARENT_FRAMEWORK);
 
         if (configuration != null) {
@@ -236,25 +239,35 @@
 //                bd.concat(", net.sourceforge.cobertura.coveragedata");
 //            }
         }
-        
+
         System.out.println("");
         System.out.println("-------------------------------------------------------");
-        System.out.println(" T E S T S");        
+        System.out.println(" T E S T S");
         System.out.println("-------------------------------------------------------");
-        
+
         Felix felix = new Felix(felixConf);
         try {
             felix.start();
         } catch (BundleException e) {
             e.printStackTrace();
         }
-        
+
+        getLog().info("Felix started - Waiting for stability");
+
         waitForStability(felix.getBundleContext());
-        
+
+        getLog().info("Bundle Stability Reached - Waiting for runner service");
 
         Object runner = waitForRunnerService(felix.getBundleContext());
+
+        if (runner == null) {
+            throw new MojoFailureException("Cannot intialize the testing framework");
+        }
+
+        getLog().info("Runner Service available");
+
         invokeRun(runner, felix.getBundleContext());
-                
+
         try {
             felix.stop();
             felix.waitForStop(5000);
@@ -264,7 +277,7 @@
         } catch (Exception e) {
             getLog().error(e);
         }
-        
+
         if (m_totalErrors > 0 || m_totalFailures > 0) {
             if (! testFailureIgnore) {
             throw new MojoFailureException("There are test failures. \n\n"
@@ -278,7 +291,7 @@
         }
 
     }
-    
+
     /**
      * Waits for stability:
      * <ul>
@@ -303,13 +316,22 @@
             count++;
             bundleStability = getBundleStability(context);
         }
-        
+
         if (count == 500) {
             getLog().error("Bundle stability isn't reached after 500 tries");
             dumpBundles(context);
             throw new MojoFailureException("Cannot reach the bundle stability");
         }
-        
+
+        //DEBUG
+        Bundle[] bundles = context.getBundles();
+        getLog().debug("Bundles List");
+        for (int i = 0; i < bundles.length; i++) {
+            getLog().debug(bundles[i].getSymbolicName() + " - " + bundles[i].getVersion() + " - " + bundles[i].getState());
+        }
+        getLog().debug("--------------");
+        // END DEBUG
+
         boolean serviceStability = false;
         count = 0;
         int count1 = 0;
@@ -329,15 +351,30 @@
             }
             count++;
         }
-        
+
         if (count == 500) {
             getLog().error("Service stability isn't reached after 500 tries (" + count1 + " != " + count2);
             dumpBundles(context);
             throw new MojoFailureException("Cannot reach the service stability");
         }
-        
+
+        try {
+            ServiceReference[] refs = context.getServiceReferences(null, null);
+            getLog().debug("Service List");
+            for (int i = 0; i < refs.length; i++) {
+                String[] itfs = (String[]) refs[i].getProperty(Constants.OBJECTCLASS);
+                List list = Arrays.asList(itfs); 
+                if (list.contains("org.apache.felix.ipojo.architecture.Architecture")) {
+                    getLog().debug(list.toString() + " - " + refs[i].getProperty("architecture.instance"));
+                } else {
+                    getLog().debug(list.toString());
+                }
+            }
+            getLog().debug("--------------");
+        } catch (Exception e) {}
+
     }
-    
+
     /**
      * Are bundle stables.
      * @param bc the bundle context
@@ -362,7 +399,6 @@
         if (bundles == null) {
             return toDeploy;
         }
-        System.out.println("Deploy URL bundles " + bundles); // TODO
         for (int i = 0; i < bundles.size(); i++) {
             String bundle = (String) bundles.get(i);
             try {
@@ -373,12 +409,12 @@
                 getLog().error(bundle + " is not a valid url, bundle ignored");
             }
         }
-        
+
         return toDeploy;
     }
-    
+
     /**
-     * Computes the URL list of bundles to install from 
+     * Computes the URL list of bundles to install from
      * <code>test</code> scoped dependencies.
      * @return the list of url of bundles to install.
      */
@@ -394,7 +430,7 @@
                         if (file.getName().endsWith("jar")) {
                             JarFile jar = new JarFile(file);
                             if (jar.getManifest().getMainAttributes().getValue("Bundle-ManifestVersion") != null) {
-                                toDeploy.add(file.toURL());
+                                toDeploy.add(file.toURI().toURL());
                             }
                         } // else {
 //                            getLog().info("The artifact " + artifact.getFile().getName() + " is not a Jar file.");
@@ -409,7 +445,7 @@
         }
         return toDeploy;
     }
-    
+
     /**
      * Waits until the {@link OSGiJunitRunner} service
      * is published.
@@ -422,6 +458,7 @@
         while (ref == null && count < 1000) {
             try {
                 Thread.sleep(5);
+                count++;
             } catch (InterruptedException e) {
                 // Nothing to do
             }
@@ -433,7 +470,7 @@
         getLog().error("Junit Runner service unavailable");
         return null;
     }
-    
+
     /**
      * Executes tests by using reflection.
      * @param runner the {@link OSGiJunitRunner} service object
@@ -441,7 +478,7 @@
      */
     private void invokeRun(Object runner, BundleContext bc) {
         Method getTest;
-        
+
         try {
             getTest = runner.getClass().getMethod("getTests", new Class[0]);
             List tests = (List) getTest.invoke(runner, new Object[0]);
@@ -461,7 +498,7 @@
                     }
                 }
             }
-            
+
             if (m_failures.size() > 0) {
                 System.out.println("\nTests in error:");
                 for (int i = 0; i < m_errors.size(); i++) {
@@ -473,15 +510,15 @@
                     }
                 }
             }
-            
-            System.out.println("\nTests run: " + m_total + ", Failures: " + m_totalFailures + ", Errors:" + m_totalErrors + "\n");          
+
+            System.out.println("\nTests run: " + m_total + ", Failures: " + m_totalFailures + ", Errors:" + m_totalErrors + "\n");
         } catch (Exception e) {
             getLog().error(e);
-        } 
+        }
     }
-    
+
     /**
-     * Gets the {@link OSGiJunitRunner#run(long)} method from the 
+     * Gets the {@link OSGiJunitRunner#run(long)} method from the
      * {@link OSGiJunitRunner} service object.
      * @param runner the {@link OSGiJunitRunner} service object.
      * @return the Method object for the <code>run</code> method.
@@ -489,7 +526,7 @@
     private Method getRunMethod(Object runner) {
         Method[] methods = runner.getClass().getMethods();
         for (int i = 0; i < methods.length; i++) {
-            if (methods[i].getName().equals("run") 
+            if (methods[i].getName().equals("run")
                     && methods[i].getParameterTypes().length == 1
                     && ! methods[i].getParameterTypes()[0].equals(Long.TYPE)) {
                 return methods[i];
@@ -498,7 +535,7 @@
         getLog().error("Cannot find the run method");
         return null;
     }
-    
+
     /**
      * Computes the name of the given test.
      * This method calls the {@link TestCase#getName()}
@@ -519,9 +556,9 @@
             getLog().error(e);
             return null;
         }
-            
+
     }
-    
+
     /**
      * Executes the given test.
      * @param runner the {@link OSGiJunitRunner} service object
@@ -580,7 +617,7 @@
         }
 
     }
-    
+
     /**
      * Prints the bundle list.
      * @param bc the bundle context.
@@ -592,45 +629,45 @@
             getLog().info(bundles[i].getSymbolicName() + " - " + bundles[i].getState());
         }
     }
-    
+
     public LogServiceImpl getLogService() {
         return m_logService;
     }
-    
-    
+
+
     private class ResultListener implements TestListener {
-        
+
         /**
          * The XML Report.
          */
         private XMLReport m_report;
-        
+
         /**
          * Check if the test has failed or thrown an
          * error.
          */
         private boolean m_abort;
-        
+
         /**
          * Backup of the {@link System#out} stream.
          */
         private PrintStream m_outBackup = System.out;
-        
+
         /**
          * Backup of the {@link System#err} stream.
          */
         private PrintStream m_errBackup = System.err;
-        
+
         /**
-         * The output stream used during the test execution. 
+         * The output stream used during the test execution.
          */
         private StringOutputStream m_out = new StringOutputStream();
-        
+
         /**
-         * The error stream used during the test execution. 
+         * The error stream used during the test execution.
          */
         private StringOutputStream m_err = new StringOutputStream();;
-        
+
         /**
          * Creates a ResultListener.
          * @param report the XML report
@@ -660,7 +697,7 @@
                 AssertionFailedError assertionfailederror) {
             m_report.testFailed(test, assertionfailederror, m_out.toString(), m_err.toString(), getLogService().getLoggedMessages());
             m_abort = true;
-            
+
         }
 
         /**
@@ -689,7 +726,7 @@
             System.setOut(new ReportPrintStream(m_out, m_outBackup, hideOutputs));
             getLogService().enableOutputStream();
         }
-        
+
     }
-    
+
 }

Modified: felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/MethodCreator.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/MethodCreator.java?rev=893960&r1=893959&r2=893960&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/MethodCreator.java (original)
+++ felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/MethodCreator.java Sat Dec 26 11:15:42 2009
@@ -316,7 +316,6 @@
             }
         }
         
-        
         mv.visitMaxs(0, 0);
         mv.visitEnd();
     }
@@ -348,7 +347,7 @@
                 ad.visit(mv);
             }
         }
-        
+
         mv.visitMaxs(0, 0);
         mv.visitEnd();
     }
@@ -657,7 +656,6 @@
         }
 
         mv.visitLabel(endif2);
-
         mv.visitInsn(RETURN);
 
         mv.visitMaxs(0, 0);

Modified: felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/FieldCollector.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/FieldCollector.java?rev=893960&r1=893959&r2=893960&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/FieldCollector.java (original)
+++ felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/FieldCollector.java Sat Dec 26 11:15:42 2009
@@ -157,6 +157,11 @@
         private String m_from;
         
         /**
+         * Proxy attribute.
+         */
+        private String m_proxy;
+        
+        /**
          * Constructor.
          * @param name : field name.
          */
@@ -209,6 +214,10 @@
                 m_from = arg1.toString();
                 return;
             }
+            if (arg0.equals("proxy")) {
+                m_proxy = arg1.toString();
+                return;
+            }
         }
 
         /**
@@ -256,6 +265,9 @@
             if (m_from != null) {
                 req.addAttribute(new Attribute("from", m_from));
             }
+            if (m_proxy != null) {
+                req.addAttribute(new Attribute("proxy", m_proxy));
+            }
             
             if (m_id != null) { 
                 m_collector.getIds().put(m_id, req);

Modified: felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/MethodCollector.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/MethodCollector.java?rev=893960&r1=893959&r2=893960&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/MethodCollector.java (original)
+++ felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/MethodCollector.java Sat Dec 26 11:15:42 2009
@@ -211,7 +211,7 @@
          * From attribute.
          */
         private String m_from;
-
+        
         /**
          * Constructor.
          * @param bind : method name.
@@ -379,7 +379,6 @@
                         System.err.println("The from attribute is not always the same");
                         return;
                     }
-                    
                 }
                 
             }

Added: felix/trunk/ipojo/manipulator/src/main/resources/core.xsd
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/src/main/resources/core.xsd?rev=893960&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/src/main/resources/core.xsd (added)
+++ felix/trunk/ipojo/manipulator/src/main/resources/core.xsd Sat Dec 26 11:15:42 2009
@@ -0,0 +1,494 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<xs:schema elementFormDefault="qualified" targetNamespace="org.apache.felix.ipojo"
+  xmlns="org.apache.felix.ipojo" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+    <xs:annotation>
+      <xs:documentation>iPOJO Core XML-Schema. This grammars models iPOJO descriptor using core features. It provides several extensibility mechanism in order to compose this schema with external handlers and other component implementation type such as compositions.</xs:documentation></xs:annotation>
+    <xs:element name="ipojo">
+    <xs:complexType>
+            <xs:annotation>
+              <xs:documentation>iPOJO top level element.</xs:documentation>
+            </xs:annotation>
+            <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="handler" minOccurs="0" maxOccurs="unbounded">
+                    <xs:annotation>
+                      <xs:documentation>The handler declarations.</xs:documentation>
+                    </xs:annotation>
+        </xs:element>
+        <xs:element ref="instance" minOccurs="0" maxOccurs="unbounded">
+                    <xs:annotation>
+                      <xs:documentation>The instance declarations.</xs:documentation>
+                    </xs:annotation>
+        </xs:element>
+        <xs:element ref="component" minOccurs="0" maxOccurs="unbounded">
+                    <xs:annotation>
+                      <xs:documentation>The component type declarations.</xs:documentation>
+                    </xs:annotation>
+        </xs:element>
+        <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded">
+        </xs:any>
+      </xs:choice>
+    </xs:complexType>
+  </xs:element>
+  <xs:complexType name="HandlerType">
+        <xs:annotation>
+          <xs:documentation>Description of the handler.</xs:documentation>
+        </xs:annotation>
+        <xs:complexContent>
+      <xs:extension base="RootElementType">
+        <xs:sequence maxOccurs="unbounded" minOccurs="0">
+          <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##any"
+            processContents="skip">
+          </xs:any>
+        </xs:sequence>
+        <xs:attribute name="classname" type="xs:string" use="required">
+                    <xs:annotation>
+                      <xs:documentation>The implementation class of the handler. The specified class must implement (direcly or not) the "org.apache.felix.ipojo.Handler" interface.</xs:documentation>
+                    </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="name" type="xs:string" use="required">
+                    <xs:annotation>
+                      <xs:documentation>The name of the handler.</xs:documentation>
+                    </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="namespace" type="xs:string" use="optional">
+                    <xs:annotation>
+                      <xs:documentation>The XML namespace of the handler.</xs:documentation>
+                    </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="architecture" type="xs:boolean"
+          use="optional" fixed="false">
+                    <xs:annotation>
+                      <xs:documentation>Enables or disables the architecture exposition. By default, the architecture is not exposed. This allows handler introspection.</xs:documentation>
+                    </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="level" type="xs:int" use="optional">
+                    <xs:annotation>
+                      <xs:documentation>The start level of the handler.</xs:documentation>
+                    </xs:annotation>
+        </xs:attribute>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:complexType name="InstanceType">
+        <xs:annotation>
+          <xs:documentation>Describes an instance of a component.</xs:documentation>
+        </xs:annotation>
+        <xs:complexContent>
+      <xs:extension base="RootElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element name="property" type="InstancePropertyType">
+            <xs:annotation>
+              <xs:documentation>The instance properties.</xs:documentation>
+            </xs:annotation></xs:element>
+        </xs:sequence>
+        <xs:attribute name="component" type="xs:string">
+          <xs:annotation>
+            <xs:documentation>The name of the instance component type.</xs:documentation>
+          </xs:annotation></xs:attribute>
+        <xs:attribute name="name" type="xs:string" use="optional">
+                    <xs:annotation>
+                      <xs:documentation>The (unique) name of the instance.</xs:documentation>
+                    </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="version" type="xs:string" use="optional">
+                    <xs:annotation>
+                      <xs:documentation>The version of the factory to use.</xs:documentation>
+                    </xs:annotation>
+        </xs:attribute>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:complexType name="InstancePropertyType">
+        <xs:annotation>
+          <xs:documentation>Defines a property of an instance configuration.</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+      <xs:element name="property" type="InstancePropertyType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+    </xs:sequence>
+    <xs:attribute name="name" type="xs:string" use="optional">
+      <xs:annotation>
+        <xs:documentation>Name of the property. Can be optional if a property is inside a structure.
+The 'instance.name' property has a special semantic as it will be used as the instance name.</xs:documentation>
+      </xs:annotation></xs:attribute>
+    <xs:attribute name="value" type="xs:string" use="optional">
+      <xs:annotation>
+        <xs:documentation>Value of the property. Can be null for property containing other properties.</xs:documentation>
+      </xs:annotation></xs:attribute>
+    <xs:attribute name="type" type="xs:string" use="optional">
+      <xs:annotation>
+        <xs:documentation>Type of the property, used to create the adequate object. Supported values are list, array, dictionary and map.</xs:documentation>
+      </xs:annotation></xs:attribute>
+  </xs:complexType>
+  <xs:complexType name="RootElementType"></xs:complexType>
+  <xs:complexType name="ComponentType">
+    <xs:annotation>
+      <xs:documentation>Declares an atomic (i.e. primitive) component type.</xs:documentation>
+    </xs:annotation>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:element ref="callback" minOccurs="0"
+        maxOccurs="unbounded">
+                <xs:annotation>
+                  <xs:documentation>Describes the method(s) to invoke when the component's state changes.</xs:documentation>
+                </xs:annotation>
+      </xs:element>
+      <xs:element ref="provides" minOccurs="0"
+        maxOccurs="unbounded">
+                <xs:annotation>
+                  <xs:documentation>Indicates the component provided service(s). By default, all implemented interfaces are published.</xs:documentation>
+                </xs:annotation>
+      </xs:element>
+      <xs:element ref="requires" minOccurs="0"
+        maxOccurs="unbounded">
+                <xs:annotation>
+                  <xs:documentation>Indicates the service requirements of the component.</xs:documentation>
+                </xs:annotation>
+      </xs:element>
+      <xs:element ref="properties" minOccurs="0"
+        maxOccurs="unbounded">
+                <xs:annotation>
+                  <xs:documentation>Describes the properties of the component.</xs:documentation>
+                </xs:annotation>
+      </xs:element>
+      <xs:element ref="controller" minOccurs="0" maxOccurs="1">
+        <xs:annotation>
+          <xs:documentation>Lifecycle controller for this component.</xs:documentation>
+        </xs:annotation></xs:element>
+      <xs:any namespace="##other" processContents="lax"
+        minOccurs="0" maxOccurs="unbounded">
+      </xs:any>
+    </xs:choice>
+    <xs:attribute name="name" type="xs:string" use="optional">
+      <xs:annotation>
+        <xs:documentation>Specifies the name of the component type. This name is used to identify the factory attached to this 	type. If not specified, the factory name is the implementation class name.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="public" type="xs:boolean" use="optional">
+      <xs:annotation>
+        <xs:documentation>Determines if the component type is public or private. A public factory (default) can be used from any bundles.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="classname" type="xs:string"
+      use="required">
+      <xs:annotation>
+        <xs:documentation>Specifies the implementation class of the component type.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="architecture" type="xs:boolean"
+      use="optional">
+      <xs:annotation>
+        <xs:documentation>Enables or disables the architecture exposition. By default, the architecture is exposed. This allows instance introspection.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="immediate" type="xs:boolean"
+      use="optional">
+            <xs:annotation>
+              <xs:documentation>Creates the object of the component implementation type as soon as the component instance becomes valid. The default value is "true" if the component doesn't provide any service, "false" otherwise.</xs:documentation>
+            </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="factory-method" type="xs:string" use="optional">
+      <xs:annotation>
+        <xs:documentation>Factory method called to create POJO objects instead of the constructor. The specified method must be a static method of the implementation class returning an instance of this implementation class. The factory method can receive the bundle context in argument.</xs:documentation>
+      </xs:annotation></xs:attribute>
+    <xs:attribute name="version" type="xs:string" use="optional">
+      <xs:annotation>
+        <xs:documentation>Set the version of this component type</xs:documentation>
+      </xs:annotation></xs:attribute>
+  </xs:complexType>
+  <xs:complexType name="RequiresType">
+        <xs:annotation>
+          <xs:documentation>Description of component services requirements.</xs:documentation>
+        </xs:annotation>
+        <xs:complexContent>
+      <xs:extension base="ServiceDependencyType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element name="callback"
+            type="DependencyCallbackType">
+                        <xs:annotation>
+                          <xs:documentation>Service requirement method invocation description. Here can be specified a bind method called when a service appears and an unbind method called when a service disappears.</xs:documentation>
+                        </xs:annotation>
+          </xs:element>
+        </xs:sequence>
+
+        <xs:attribute name="interface" type="xs:string"
+            use="prohibited">
+                    <xs:annotation>
+                      <xs:documentation>The interface describing the required service type. This attribute is needed only when using aggregate dependencies with field injection and when the type of this field is a list, vector, collection and set. This attribute is deprecated, use 'specification'.</xs:documentation>
+                    </xs:annotation>
+        </xs:attribute>
+
+        <xs:attribute name="field" type="xs:string"
+          use="optional">
+                    <xs:annotation>
+                      <xs:documentation>The name of the field representing the service dependency in the implementation class.</xs:documentation>
+                    </xs:annotation>
+        </xs:attribute>
+
+        <xs:attribute name="nullable" type="xs:boolean"
+          use="optional">
+                    <xs:annotation>
+                      <xs:documentation>Enable or disable the Nullable pattern on optional service dependencies. By default, Nullable pattern is enabled. If disabled, iPOJO will inject null instead of a Nullable object.</xs:documentation>
+                    </xs:annotation>
+        </xs:attribute>
+
+        <xs:attribute name="default-implementation"
+          type="xs:string" use="optional">
+                    <xs:annotation>
+                      <xs:documentation>Specifies the default implementation class for an optional service dependency. If no providers are found, iPOJO creates an instance of the default-implementation (nullary constructor) and injects it. The given class must implement the required service interface.</xs:documentation>
+                    </xs:annotation>
+        </xs:attribute>
+
+        <xs:attribute name="from" type="xs:string"
+          use="optional">
+                    <xs:annotation>
+                      <xs:documentation>Specific service provider. The dependency can only be fulfilled by the component with the matching name, or by the service with a matching PID.</xs:documentation>
+                    </xs:annotation>
+        </xs:attribute>
+        
+        <xs:attribute name="proxy" type="xs:boolean"
+          use="optional">
+                    <xs:annotation>
+                      <xs:documentation>Enables or Disable the proxy injection (on field injection)</xs:documentation>
+                    </xs:annotation>
+        </xs:attribute>
+
+        <xs:attribute name="scope" use="optional">
+          <xs:simpleType>
+            <xs:restriction base="xs:string">
+              <xs:enumeration value="global"></xs:enumeration>
+              <xs:enumeration value="composite"></xs:enumeration>
+              <xs:enumeration value="composite+global"></xs:enumeration>
+            </xs:restriction>
+          </xs:simpleType>
+        </xs:attribute>
+
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:complexType name="DependencyCallbackType">
+        <xs:annotation>
+          <xs:documentation>Dependency callbacks are used to receive notification when service providers arrive and leave.</xs:documentation>
+        </xs:annotation>
+        <xs:attribute name="method" type="xs:string" use="required">
+          <xs:annotation>
+            <xs:documentation>Method to call</xs:documentation>
+          </xs:annotation></xs:attribute>
+    <xs:attribute name="type" use="required">
+            <xs:annotation>
+              <xs:documentation>
+                Type of callback (bind, unbind, or updated). Bind means that the method will be called when a provider arrives. Unbind means that the method will be called when a provider leaves.
+                Updated means that a service was modified but is still valid for the service dependency.
+              </xs:documentation>
+            </xs:annotation>
+            <xs:simpleType>
+        <xs:restriction base="xs:string">
+          <xs:enumeration value="bind"></xs:enumeration>
+          <xs:enumeration value="unbind"></xs:enumeration>
+          <xs:enumeration value="modified"></xs:enumeration>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:complexType>
+  <xs:complexType name="CallbackType">
+        <xs:annotation>
+          <xs:documentation>Lifecycle Callback. Allows a POJO to be notified when the instance becomes valid or invalid.</xs:documentation>
+        </xs:annotation>
+        <xs:attribute name="method" type="xs:string" use="required">
+          <xs:annotation>
+            <xs:documentation>Specifies the method to call on the transition.</xs:documentation>
+          </xs:annotation></xs:attribute>
+    <xs:attribute name="transition" use="required">
+            <xs:annotation>
+              <xs:documentation>Specifies the transition when the callback needs to be invoked.</xs:documentation>
+            </xs:annotation>
+            <xs:simpleType>
+                <xs:annotation>
+                  <xs:documentation>Lifecycle transition state. "validate" means that the component's instance was invalid and becomes valid, "invalidate" means that the component's intance was valid and becomes invalid.</xs:documentation>
+                </xs:annotation>
+                <xs:restriction base="xs:string">
+          <xs:enumeration value="validate"></xs:enumeration>
+          <xs:enumeration value="invalidate"></xs:enumeration>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+  </xs:complexType>
+  <xs:element name="provides" type="ProvidesType" id="provides"></xs:element>
+    <xs:complexType name="ProvidesType">
+        <xs:annotation>
+          <xs:documentation>Provided service(s) description.</xs:documentation>
+        </xs:annotation>
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+      <xs:element name="property" type="PropertyType">
+        <xs:annotation>
+          <xs:documentation>List of service specific properties.</xs:documentation>
+        </xs:annotation></xs:element>
+    </xs:sequence>
+    <xs:attribute name="interface" type="xs:string" use="prohibited">
+      <xs:annotation>
+        <xs:documentation>Deprecated attribute, use 'specifications' instead of 'interface'</xs:documentation>
+      </xs:annotation></xs:attribute>
+    <xs:attribute name="specifications" type="xs:string" use="optional">
+      <xs:annotation>
+        <xs:documentation>The list of service specifications (i.e. interfaces) to expose. By default, all interfaces implemented by the component implementation class are published.</xs:documentation>
+      </xs:annotation></xs:attribute>
+    <xs:attribute name="factory" type="xs:string" use="prohibited">
+      <xs:annotation>
+        <xs:documentation>Use 'strategy' instead of 'factory'</xs:documentation>
+      </xs:annotation></xs:attribute>
+    <xs:attribute name="strategy" type="xs:string" use="optional">
+      <xs:annotation>
+        <xs:documentation>POJO creation strategy. By default, the POJO object is created once (singleton). If the factory is set to "SERVICE", the creation policy follows the OSGi service factory policy (one object object per asking bundle).
+        INSTANCE allows creating one different POJO object per asking instance. Finally, a custom strategy can be used by specifying the qualified name of the class extending CreationPolicy</xs:documentation>
+      </xs:annotation></xs:attribute>
+  </xs:complexType>
+  <xs:complexType name="PropertyType">
+    <xs:annotation>
+      <xs:documentation>
+        Defines a component property.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name="field" type="xs:string" use="optional">
+      <xs:annotation>
+        <xs:documentation>
+          Field of the property
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="method" type="xs:string" use="optional">
+      <xs:annotation>
+        <xs:documentation>
+          Setter method of the property. This method is called
+          to inject property value.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="name" type="xs:string" use="optional">
+      <xs:annotation>
+        <xs:documentation>
+          Name of the property.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="value" type="xs:string" use="optional">
+      <xs:annotation>
+        <xs:documentation>
+          Default value of the property.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="type" type="xs:string" use="optional">
+      <xs:annotation>
+        <xs:documentation>
+          Type of the property.
+        </xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+        <xs:attribute name="mandatory" type="xs:boolean" use="optional" default="false">
+          <xs:annotation>
+            <xs:documentation>Set the property as mandatory. A mandatory property MUST receive a value either in the component type description or in the instance configuration. Properties are optional by default.</xs:documentation>
+          </xs:annotation></xs:attribute>
+    </xs:complexType>
+  <xs:element name="callback" type="CallbackType" id="callback"></xs:element>
+  <xs:element name="controller" type="ControllerType" id="controller">
+    <xs:annotation>
+      <xs:documentation></xs:documentation>
+    </xs:annotation></xs:element>
+  <xs:element name="requires" type="RequiresType" id="requires"></xs:element>
+  <xs:element name="component" type="ComponentType" id="component"></xs:element>
+  <xs:element name="handler" type="HandlerType" id="handler"></xs:element>
+  <xs:element name="instance" type="InstanceType" id="instance"></xs:element>
+
+    <xs:element name="properties" type="PropertiesType" id="properties"></xs:element>
+  <xs:complexType name="PropertiesType">
+        <xs:annotation>
+          <xs:documentation>List of component, instance or service properties. This field will receive the property value.</xs:documentation>
+        </xs:annotation>
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+      <xs:element name="property" type="PropertyType">
+        <xs:annotation>
+          <xs:documentation>The list of properties.</xs:documentation>
+        </xs:annotation></xs:element>
+    </xs:sequence>
+    <xs:attribute name="propagation" type="xs:boolean" use="optional">
+      <xs:annotation>
+        <xs:documentation>Propagation of the component properties to the provided services. If this parameter is set to "true", each time properties are reconfigured, they are propagated to each service published by the component.</xs:documentation>
+      </xs:annotation></xs:attribute>
+    <xs:attribute name="pid" type="xs:string" use="optional">
+      <xs:annotation>
+        <xs:documentation>Unique identifier used to reconfigure components properties (via  Managed Services) with the Configuration Admin.</xs:documentation>
+      </xs:annotation></xs:attribute>
+    <xs:attribute name="updated" type="xs:string" use="optional">
+      <xs:annotation>
+        <xs:documentation>Method called when a reconfiguration is done</xs:documentation>
+      </xs:annotation></xs:attribute>
+  </xs:complexType>
+
+  <xs:complexType name="ServiceDependencyType">
+      <xs:attribute name="specification" type="xs:string" use="optional">
+        <xs:annotation>
+          <xs:documentation>The specification describing the required service type. This attribute is needed only when using aggregate dependencies with field injection and when the type of this field is a list, vector, collection and set.</xs:documentation>
+        </xs:annotation></xs:attribute>
+    <xs:attribute name="optional" type="xs:boolean" use="optional">
+            <xs:annotation>
+              <xs:documentation>Sets the service dependency optionality</xs:documentation>
+            </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="aggregate" type="xs:boolean" use="optional">
+            <xs:annotation>
+              <xs:documentation>Sets the service dependency cardinality.</xs:documentation>
+            </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="policy" use="optional">
+            <xs:annotation>
+              <xs:documentation>Sets the binding policy of the dependency. Three policies are supported. The dynamic policy supports service providers dynamism. The static policy freezes the provider set as soon as the dependency is used. The dynamic-priority policy is an extension of the dynamic policy, but providers are ranked.</xs:documentation>
+            </xs:annotation>
+            <xs:simpleType>
+        <xs:restriction base="xs:string">
+          <xs:enumeration value="dynamic"></xs:enumeration>
+          <xs:enumeration value="static"></xs:enumeration>
+          <xs:enumeration value="dynamic-priority"></xs:enumeration>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="comparator" type="xs:string" use="optional">
+            <xs:annotation>
+              <xs:documentation>The comparator attribute allows specifying the class used to compare providers. This class must implemented the java.util.Comparator class and must support the comparison of service references.</xs:documentation>
+            </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="filter" type="xs:string" use="optional">
+      <xs:annotation>
+        <xs:documentation>LDAP filter used to filter providers</xs:documentation>
+      </xs:annotation></xs:attribute>
+    <xs:attribute name="id" type="xs:string" use="optional">
+      <xs:annotation>
+        <xs:documentation>id of the service dependency. The id allows to indentify and to refert to this dependency.</xs:documentation>
+      </xs:annotation></xs:attribute>
+  </xs:complexType>
+
+    <xs:complexType name="ControllerType">
+        <xs:annotation>
+          <xs:documentation>Specifies the lifecycle controller of a component, which allows to validate or invalidate component instances.</xs:documentation>
+        </xs:annotation>
+        <xs:attribute name="field" type="xs:string" use="required">
+            <xs:annotation>
+              <xs:documentation>The name of the component lifecycle controller field. The type of the specified field must be boolean. Setting the value of the specified field to "true" means the validation of the component instance while setting it to "false" means the invalidation of the component instance.</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+    </xs:complexType>
+</xs:schema>

Propchange: felix/trunk/ipojo/manipulator/src/main/resources/core.xsd
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: felix/trunk/ipojo/metadata/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/metadata/pom.xml?rev=893960&r1=893959&r2=893960&view=diff
==============================================================================
--- felix/trunk/ipojo/metadata/pom.xml (original)
+++ felix/trunk/ipojo/metadata/pom.xml Sat Dec 26 11:15:42 2009
@@ -43,6 +43,7 @@
         <extensions>true</extensions>
         <configuration>
           <instructions>
+            <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
             <Bundle-Name>iPOJO Metadata</Bundle-Name>
             <Bundle-Vendor> The Apache Software Foundation </Bundle-Vendor>
             <Bundle-Description> iPOJO Metadata </Bundle-Description>

Modified: felix/trunk/ipojo/tests/bundleAsiPOJO/helpers/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/bundleAsiPOJO/helpers/pom.xml?rev=893960&r1=893959&r2=893960&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/bundleAsiPOJO/helpers/pom.xml (original)
+++ felix/trunk/ipojo/tests/bundleAsiPOJO/helpers/pom.xml Sat Dec 26 11:15:42 2009
@@ -7,11 +7,13 @@
   <version>1.5.0-SNAPSHOT</version>
   <name>iPOJO Test Helpers</name>
 
+  
+
   <dependencies>
     <dependency>
       <groupId>org.apache.felix</groupId>
       <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${pom.version}</version>
+      <version>1.4.0</version>
     </dependency>
     <dependency>
       <groupId>org.osgi</groupId>
@@ -26,6 +28,11 @@
       <scope>compile</scope>
     </dependency>
   </dependencies>
+  <parent>
+    <artifactId>felix-parent</artifactId>
+    <groupId>org.apache.felix</groupId>
+    <version>1.2.0</version>
+  </parent>
 
   <build>
     <plugins>

Modified: felix/trunk/ipojo/tests/bundleAsiPOJO/helpers/src/main/java/org/apache/felix/ipojo/test/helpers/IPOJOHelper.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/bundleAsiPOJO/helpers/src/main/java/org/apache/felix/ipojo/test/helpers/IPOJOHelper.java?rev=893960&r1=893959&r2=893960&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/bundleAsiPOJO/helpers/src/main/java/org/apache/felix/ipojo/test/helpers/IPOJOHelper.java (original)
+++ felix/trunk/ipojo/tests/bundleAsiPOJO/helpers/src/main/java/org/apache/felix/ipojo/test/helpers/IPOJOHelper.java Sat Dec 26 11:15:42 2009
@@ -347,6 +347,17 @@
     public Element getMetadata(String component) {
         return getMetadata(m_context.getBundle(), component);
     }
+    
+    /**
+     * Returns the instance metadata of a component defined in this bundle.
+     * 
+     * @param component the name of the locally defined component.
+     * @return the list of instance metadata of the component with the given name,
+     *         defined in this given bundle, or {@code null} if not found.
+     */
+    public Element[] getInstanceMetadata(String component) {
+        return getInstanceMetadata(m_context.getBundle(), component);
+    }
 
     /**
      * Returns the component factory with the given name in the given bundle.
@@ -483,6 +494,53 @@
                             + bundle.getSymbolicName() + "): " + e.getMessage());
         }
     }
+    
+    /**
+     * Returns the instance metadatas of the component with the given name,
+     * defined in the given bundle.
+     * 
+     * @param bundle the bundle from which the component is defined.
+     * @param component the name of the defined component.
+     * @return the list of instance metadata of the component with the given name,
+     *         defined in the given bundle, or {@code null} if not found.
+     */
+    public static Element[] getInstanceMetadata(Bundle bundle, String component) {
+
+        // Retrieves the component description from the bundle's manifest.
+        String elem = (String) bundle.getHeaders().get("iPOJO-Components");
+        if (elem == null) {
+            throw new IllegalArgumentException(
+                    "Cannot find iPOJO-Components descriptor in the specified bundle ("
+                            + bundle.getSymbolicName()
+                            + "). Not an iPOJO bundle.");
+        }
+
+        // Parses the retrieved description and find the component with the
+        // given name.
+        List list = new ArrayList();
+        try {
+            Element element = ManifestMetadataParser.parseHeaderMetadata(elem);
+            Element[] childs = element.getElements("instance");
+            for (int i = 0; i < childs.length; i++) {
+                String name = childs[i].getAttribute("component");
+                if (name != null && name.equalsIgnoreCase(component)) {
+                    list.add(childs[i]);
+                }
+            }
+            
+            if (list.isEmpty()) {
+                // Component not found...
+                return null;
+            } else {
+                return (Element[]) list.toArray(new Element[list.size()]);
+            }
+
+        } catch (ParseException e) {
+            throw new IllegalStateException(
+                    "Cannot parse the components from specified bundle ("
+                            + bundle.getSymbolicName() + "): " + e.getMessage());
+        }
+    }
 
     /**
      * Returns the service object of a service registered in the specified

Modified: felix/trunk/ipojo/tests/bundleAsiPOJO/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/bundleAsiPOJO/pom.xml?rev=893960&r1=893959&r2=893960&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/bundleAsiPOJO/pom.xml (original)
+++ felix/trunk/ipojo/tests/bundleAsiPOJO/pom.xml Sat Dec 26 11:15:42 2009
@@ -24,7 +24,7 @@
   <name>Apache Felix iPOJO TinyBundles Extension</name>
   <packaging>pom</packaging>
   
-   <profiles>
+  <profiles>
   <profile>
     <id>java5</id>
     <activation>

Modified: felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Dependency.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Dependency.java?rev=893960&r1=893959&r2=893960&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Dependency.java (original)
+++ felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Dependency.java Sat Dec 26 11:15:42 2009
@@ -83,6 +83,10 @@
         assertEquals("Check mod unbind", "unbindMod", unbind);
         assertEquals("Check mod modified", "modifiedMod", mod);
         assertEquals("Check mod id", "mod", id);
+        
+        // Check not proxied
+        dep = getDependencyById(deps, "notproxied");
+        assertEquals("Check not proxied", "false", dep.getAttribute("proxy"));
     }
     
     private Element getDependencyById(Element[] deps, String name) {

Modified: felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Dependency.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Dependency.java?rev=893960&r1=893959&r2=893960&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Dependency.java (original)
+++ felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Dependency.java Sat Dec 26 11:15:42 2009
@@ -76,5 +76,8 @@
     }
     
     
+    @Requires(proxy=false, id="notproxied")
+    FooService myFoo;
+    
     
 }

Modified: felix/trunk/ipojo/tests/core/service-dependency-filter/src/main/resources/metadata.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/service-dependency-filter/src/main/resources/metadata.xml?rev=893960&r1=893959&r2=893960&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/service-dependency-filter/src/main/resources/metadata.xml (original)
+++ felix/trunk/ipojo/tests/core/service-dependency-filter/src/main/resources/metadata.xml Sat Dec 26 11:15:42 2009
@@ -3,120 +3,120 @@
     xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
     xmlns="org.apache.felix.ipojo">
 
-	<!--  Simple Filter Dependencies -->
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.FilterCheckProvider"
-		name="SimpleFilterCheckServiceProvider" architecture="true">
-		<provides>
-			<property field="m_toto" name="toto" value="A" />
-		</provides>
-	</component>
-
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.FilterCheckSubscriber"
-		name="SimpleFilterCheckServiceSubscriber" architecture="true">
-		<requires field="m_foo" filter="(toto=B)" id="id1">
-			<callback type="bind" method="Bind" />
-			<callback type="unbind" method="Unbind" />
-		</requires>
-		<provides />
-	</component>
-	
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.FilterCheckSubscriber"
-		name="SimpleFromCheckServiceSubscriber" architecture="true">
-		<requires field="m_foo" from="A" id="id1">
-			<callback type="bind" method="Bind" />
-			<callback type="unbind" method="Unbind" />
-		</requires>
-		<provides />
-	</component>
-	
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.FilterCheckProvider"
-		name="SimplePIDCheckServiceProvider" architecture="true">
-		<provides>
-			<property type="String" name="service.pid" />
-		</provides>
-	</component>
-
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.FilterCheckSubscriber"
-		name="SimpleFilterCheckServiceSubscriber2" architecture="true">
-		<requires field="m_foo" id="id2">
-			<callback type="bind" method="Bind" />
-			<callback type="unbind" method="Unbind" />
-		</requires>
-		<provides />
-	</component>
-
-	<!--  Optional Simple Filter Dependencies -->
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.FilterCheckSubscriber"
-		name="OptionalSimpleFilterCheckServiceSubscriber"
-		architecture="true">
-		<requires field="m_foo" filter="(toto=B)" id="id1"
-			optional="true">
-			<callback type="bind" method="Bind" />
-			<callback type="unbind" method="Unbind" />
-		</requires>
-		<provides />
-	</component>
-
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.FilterCheckSubscriber"
-		name="OptionalSimpleFilterCheckServiceSubscriber2"
-		architecture="true">
-		<requires field="m_foo" id="id2" optional="true">
-			<callback type="bind" method="Bind" />
-			<callback type="unbind" method="Unbind" />
-		</requires>
-		<provides />
-	</component>
-
-	<!-- Aggregate filter Dependencies-->
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.MultipleFilterCheckSubscriber"
-		name="MultipleFilterCheckServiceSubscriber" architecture="true">
-		<requires field="m_foo" filter="(toto=B)" id="id1">
-			<callback type="bind" method="Bind" />
-			<callback type="unbind" method="Unbind" />
-		</requires>
-		<provides />
-	</component>
-
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.MultipleFilterCheckSubscriber"
-		name="MultipleFilterCheckServiceSubscriber2" architecture="true">
-		<requires field="m_foo" id="id2">
-			<callback type="bind" method="Bind" />
-			<callback type="unbind" method="Unbind" />
-		</requires>
-		<provides />
-	</component>
-
-	<!--  Optional Aggregate Filter Dependencies -->
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.MultipleFilterCheckSubscriber"
-		name="OptionalMultipleFilterCheckServiceSubscriber"
-		architecture="true">
-		<requires field="m_foo" filter="(toto=B)" id="id1"
-			optional="true">
-			<callback type="bind" method="Bind" />
-			<callback type="unbind" method="Unbind" />
-		</requires>
-		<provides />
-	</component>
-
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.MultipleFilterCheckSubscriber"
-		name="OptionalMultipleFilterCheckServiceSubscriber2"
-		architecture="true">
-		<requires field="m_foo" id="id2" optional="true">
-			<callback type="bind" method="Bind" />
-			<callback type="unbind" method="Unbind" />
-		</requires>
-		<provides />
-	</component>
+  <!--  Simple Filter Dependencies -->
+  <component
+    classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.FilterCheckProvider"
+    name="SimpleFilterCheckServiceProvider" architecture="true">
+    <provides>
+      <property field="m_toto" name="toto" value="A" />
+    </provides>
+  </component>
+
+  <component
+    classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.FilterCheckSubscriber"
+    name="SimpleFilterCheckServiceSubscriber" architecture="true">
+    <requires field="m_foo" filter="(toto=B)" id="id1" proxy="false">
+      <callback type="bind" method="Bind" />
+      <callback type="unbind" method="Unbind" />
+    </requires>
+    <provides />
+  </component>
+  
+  <component
+    classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.FilterCheckSubscriber"
+    name="SimpleFromCheckServiceSubscriber" architecture="true">
+    <requires field="m_foo" from="A" id="id1" proxy="false">
+      <callback type="bind" method="Bind" />
+      <callback type="unbind" method="Unbind" />
+    </requires>
+    <provides />
+  </component>
+  
+  <component
+    classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.FilterCheckProvider"
+    name="SimplePIDCheckServiceProvider" architecture="true">
+    <provides>
+      <property type="String" name="service.pid" />
+    </provides>
+  </component>
+
+  <component
+    classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.FilterCheckSubscriber"
+    name="SimpleFilterCheckServiceSubscriber2" architecture="true">
+    <requires field="m_foo" id="id2" proxy="false">
+      <callback type="bind" method="Bind" />
+      <callback type="unbind" method="Unbind" />
+    </requires>
+    <provides />
+  </component>
+
+  <!--  Optional Simple Filter Dependencies -->
+  <component
+    classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.FilterCheckSubscriber"
+    name="OptionalSimpleFilterCheckServiceSubscriber"
+    architecture="true">
+    <requires field="m_foo" filter="(toto=B)" id="id1"
+      optional="true" proxy="false">
+      <callback type="bind" method="Bind" />
+      <callback type="unbind" method="Unbind" />
+    </requires>
+    <provides />
+  </component>
+
+  <component
+    classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.FilterCheckSubscriber"
+    name="OptionalSimpleFilterCheckServiceSubscriber2"
+    architecture="true">
+    <requires field="m_foo" id="id2" optional="true" proxy="false">
+      <callback type="bind" method="Bind" />
+      <callback type="unbind" method="Unbind" />
+    </requires>
+    <provides />
+  </component>
+
+  <!-- Aggregate filter Dependencies-->
+  <component
+    classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.MultipleFilterCheckSubscriber"
+    name="MultipleFilterCheckServiceSubscriber" architecture="true">
+    <requires field="m_foo" filter="(toto=B)" id="id1" proxy="false">
+      <callback type="bind" method="Bind" />
+      <callback type="unbind" method="Unbind" />
+    </requires>
+    <provides />
+  </component>
+
+  <component
+    classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.MultipleFilterCheckSubscriber"
+    name="MultipleFilterCheckServiceSubscriber2" architecture="true">
+    <requires field="m_foo" id="id2" proxy="false">
+      <callback type="bind" method="Bind" />
+      <callback type="unbind" method="Unbind" />
+    </requires>
+    <provides />
+  </component>
+
+  <!--  Optional Aggregate Filter Dependencies -->
+  <component
+    classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.MultipleFilterCheckSubscriber"
+    name="OptionalMultipleFilterCheckServiceSubscriber"
+    architecture="true">
+    <requires field="m_foo" filter="(toto=B)" id="id1" proxy="false"
+      optional="true">
+      <callback type="bind" method="Bind" />
+      <callback type="unbind" method="Unbind" />
+    </requires>
+    <provides />
+  </component>
+
+  <component
+    classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.MultipleFilterCheckSubscriber"
+    name="OptionalMultipleFilterCheckServiceSubscriber2"
+    architecture="true">
+    <requires field="m_foo" id="id2" optional="true" proxy="false">
+      <callback type="bind" method="Bind" />
+      <callback type="unbind" method="Unbind" />
+    </requires>
+    <provides />
+  </component>
 
 </ipojo>

Modified: felix/trunk/ipojo/tests/core/service-dependency/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/service-dependency/pom.xml?rev=893960&r1=893959&r2=893960&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/service-dependency/pom.xml (original)
+++ felix/trunk/ipojo/tests/core/service-dependency/pom.xml Sat Dec 26 11:15:42 2009
@@ -35,9 +35,9 @@
       <version>${pom.version}</version>
     </dependency>
     <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.osgi.core</artifactId>
-      <version>1.0.1</version>
+        <groupId>org.osgi</groupId>
+       <artifactId>org.osgi.core</artifactId>
+        <version>4.2.0</version>
     </dependency>
     <dependency>
       <groupId>junit</groupId>
@@ -98,7 +98,6 @@
         </configuration>
       </plugin>
       
-      <!--
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-junit4osgi-plugin</artifactId>
@@ -116,7 +115,6 @@
           </execution>
         </executions>
       </plugin>
-      -->
       </plugins>
   </build>
 </project>



Mime
View raw message