* Fix FELIX-1427
Service dependencies are not able to be injected as smart proxies (generated in bytecode). However the proxies ensure the service object set synchronization.
By default fields now receive proxies (default behavior can be set with the ipojo.depednency.proxy-enabled|disabled system property).
* Fix an interception bug on constructors
* Fix import / package packages of composites and temporal handler as now the core embeds ASM
* Add a classloading issue in the temporal dependencies (Bad classloader)
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@893960 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/tests/bundleAsiPOJO/helpers/pom.xml b/ipojo/tests/bundleAsiPOJO/helpers/pom.xml
index 906263f..647d632 100644
--- a/ipojo/tests/bundleAsiPOJO/helpers/pom.xml
+++ b/ipojo/tests/bundleAsiPOJO/helpers/pom.xml
@@ -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>
diff --git a/ipojo/tests/bundleAsiPOJO/helpers/src/main/java/org/apache/felix/ipojo/test/helpers/IPOJOHelper.java b/ipojo/tests/bundleAsiPOJO/helpers/src/main/java/org/apache/felix/ipojo/test/helpers/IPOJOHelper.java
index bb1cd4d..e723f9f 100644
--- a/ipojo/tests/bundleAsiPOJO/helpers/src/main/java/org/apache/felix/ipojo/test/helpers/IPOJOHelper.java
+++ b/ipojo/tests/bundleAsiPOJO/helpers/src/main/java/org/apache/felix/ipojo/test/helpers/IPOJOHelper.java
@@ -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