Fix issue Felix-834.
Provides annotations for the whiteboard, extender and event admin handlers.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@720508 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/annotations/pom.xml b/ipojo/annotations/pom.xml
index 082b34f..b3f2cb3 100644
--- a/ipojo/annotations/pom.xml
+++ b/ipojo/annotations/pom.xml
@@ -52,7 +52,10 @@
<Bundle-Description> iPOJO Annotations </Bundle-Description>
<Export-Package> org.apache.felix.ipojo.annotations,
org.apache.felix.ipojo.handler.temporal,
- org.apache.felix.ipojo.handlers.jmx
+ org.apache.felix.ipojo.handlers.jmx,
+ org.apache.felix.ipojo.extender,
+ org.apache.felix.ipojo.whiteboard,
+ org.apache.felix.ipojo.handlers.event
</Export-Package>
<Include-Resource> META-INF/LICENCE=LICENSE,
META-INF/NOTICE=NOTICE </Include-Resource>
diff --git a/ipojo/annotations/src/main/java/org/apache/felix/ipojo/extender/Extender.java b/ipojo/annotations/src/main/java/org/apache/felix/ipojo/extender/Extender.java
new file mode 100644
index 0000000..6c1af00
--- /dev/null
+++ b/ipojo/annotations/src/main/java/org/apache/felix/ipojo/extender/Extender.java
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+package org.apache.felix.ipojo.extender;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+/**
+ * Extender pattern Handler annotation.
+ * Allows configuring an extender pattern.
+ * Be aware that despite is it provided in the annotations jar,
+ * it refers to an external handler.
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+@Target(ElementType.TYPE)
+public @interface Extender {
+
+ /**
+ * Sets the looked Manifest entry.
+ */
+ String extension();
+
+ /**
+ * Sets the on service arrival callback.
+ */
+ String onArrival();
+
+ /**
+ * Sets the on service departure callback.
+ */
+ String onDeparture();
+
+}
diff --git a/ipojo/annotations/src/main/java/org/apache/felix/ipojo/handlers/event/Publisher.java b/ipojo/annotations/src/main/java/org/apache/felix/ipojo/handlers/event/Publisher.java
new file mode 100644
index 0000000..3db2069
--- /dev/null
+++ b/ipojo/annotations/src/main/java/org/apache/felix/ipojo/handlers/event/Publisher.java
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ */
+package org.apache.felix.ipojo.handlers.event;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+
+/**
+ * Event Admin Publisher handler.
+ * Be aware that despite is it provided in the annotations jar,
+ * it refers to an external handler.
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+@Target(ElementType.FIELD)
+public @interface Publisher {
+
+ /**
+ * Sets the publisher name.
+ */
+ String name();
+
+ /**
+ * Sets topics on which event are sent.
+ * The topics are separated by a ',' such as in
+ * "foo, bar".
+ * Default : no topics (configured in the instance configuration)
+ */
+ String topics() default "";
+
+ /**
+ * Enables/Disables synchronous sending.
+ * Default : false (asynchronous)
+ */
+ boolean synchronous() default false;
+
+ /**
+ * Sets the data key in which the data is
+ * put.
+ * Default : user.data
+ */
+ String data_key() default "user.data";
+
+}
diff --git a/ipojo/annotations/src/main/java/org/apache/felix/ipojo/handlers/event/Subscriber.java b/ipojo/annotations/src/main/java/org/apache/felix/ipojo/handlers/event/Subscriber.java
new file mode 100644
index 0000000..b0b2372
--- /dev/null
+++ b/ipojo/annotations/src/main/java/org/apache/felix/ipojo/handlers/event/Subscriber.java
@@ -0,0 +1,68 @@
+/*
+ * 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.
+ */
+package org.apache.felix.ipojo.handlers.event;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+
+/**
+ * Event Admin Subscriber handler.
+ * Be aware that despite is it provided in the annotations jar,
+ * it refers to an external handler.
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+@Target(ElementType.METHOD)
+public @interface Subscriber {
+
+ /**
+ * Sets the subscriber name.
+ */
+ String name();
+
+ /**
+ * Sets topics on which event are received.
+ * The topics are separated by a ',' such as in
+ * "foo, bar".
+ * Default : no topics (configured in the instance configuration)
+ */
+ String topics() default "";
+
+ /**
+ * Sets the data key in which the data is
+ * stored.
+ * Default : no key
+ */
+ String data_key() default "";
+
+ /**
+ * Sets the data type (type of the received data).
+ * Default : no type.
+ */
+ String data_type() default "";
+
+
+ /**
+ * Sets the event filter. Only event matching with the
+ * specified LDAP filter are received.
+ * default : no filter;
+ */
+ String filter() default "";
+
+}
diff --git a/ipojo/annotations/src/main/java/org/apache/felix/ipojo/whiteboard/Wbp.java b/ipojo/annotations/src/main/java/org/apache/felix/ipojo/whiteboard/Wbp.java
new file mode 100644
index 0000000..570ade1
--- /dev/null
+++ b/ipojo/annotations/src/main/java/org/apache/felix/ipojo/whiteboard/Wbp.java
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ */
+package org.apache.felix.ipojo.whiteboard;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+/**
+ * Whiteboard pattern Handler annotation.
+ * Allows configuring a whiteboard pattern.
+ * Be aware that despite is it provided in the annotations jar,
+ * it refers to an external handler.
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+@Target(ElementType.TYPE)
+public @interface Wbp {
+
+ /**
+ * Sets the whiteboard pattern filter.
+ */
+ String filter();
+
+ /**
+ * Sets the on service arrival callback.
+ */
+ String onArrival();
+
+ /**
+ * Sets the on service departure callback.
+ */
+ String onDeparture();
+
+ /**
+ * Sets the on service modification callback.
+ * Default : no callback.
+ */
+ String onModification() default "";
+}
diff --git a/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedService.java b/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedService.java
index 2fb75d8..e8a0ff3 100644
--- a/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedService.java
+++ b/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedService.java
@@ -293,7 +293,7 @@
}
/**
- * Update the service properties. The new list of properties is sended to
+ * Update the service properties. The new list of properties is sent to
* the service registry.
*/
public synchronized void update() {
diff --git a/ipojo/handler/eventadmin/metadata.xml b/ipojo/handler/eventadmin/metadata.xml
index 1b373fd..945451e 100644
--- a/ipojo/handler/eventadmin/metadata.xml
+++ b/ipojo/handler/eventadmin/metadata.xml
@@ -20,7 +20,7 @@
<handler
classname="org.apache.felix.ipojo.handlers.event.subscriber.EventAdminSubscriberHandler"
name="subscriber"
- namespace="org.apache.felix.ipojo.handlers.event.EventAdminHandler">
+ namespace="org.apache.felix.ipojo.handlers.event">
<provides>
<property field="m_topics" name="event.topics"/>
</provides>
@@ -28,7 +28,7 @@
<handler classname="org.apache.felix.ipojo.handlers.event.publisher.EventAdminPublisherHandler"
name="publisher"
- namespace="org.apache.felix.ipojo.handlers.event.EventAdminHandler">
+ namespace="org.apache.felix.ipojo.handlers.event">
<requires field="m_ea"/>
</handler>
</ipojo>
\ No newline at end of file
diff --git a/ipojo/handler/eventadmin/obr.xml b/ipojo/handler/eventadmin/obr.xml
index 8d0ec1d..4e53bb3 100644
--- a/ipojo/handler/eventadmin/obr.xml
+++ b/ipojo/handler/eventadmin/obr.xml
@@ -19,12 +19,12 @@
<obr>
<capability name="ipojo.handler">
<p n="name" v="publisher"/>
- <p n="namespace" v="org.apache.felix.ipojo.handlers.event.EventAdminHandler"/>
+ <p n="namespace" v="org.apache.felix.ipojo.handlers.event"/>
<p n="type" v="primitive"/>
</capability>
<capability name="ipojo.handler">
<p n="name" v="subscriber"/>
- <p n="namespace" v="org.apache.felix.ipojo.handlers.event.EventAdminHandler"/>
+ <p n="namespace" v="org.apache.felix.ipojo.handlers.event"/>
<p n="type" v="primitive"/>
</capability>
<require extend="false" filter="(service=org.osgi.service.event.EventAdmin)" multiple="false" name="service" optional="false">Import Event Admin service</require>
diff --git a/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherHandler.java b/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherHandler.java
index bccba24..8880bf7 100644
--- a/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherHandler.java
+++ b/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherHandler.java
@@ -44,7 +44,7 @@
/**
* The handler Namespace.
*/
- public static final String NAMESPACE = "org.apache.felix.ipojo.handlers.event.EventAdminHandler";
+ public static final String NAMESPACE = "org.apache.felix.ipojo.handlers.event";
/**
* The names of instance configuration properties.
diff --git a/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherMetadata.java b/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherMetadata.java
index 72ec765..4358836 100644
--- a/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherMetadata.java
+++ b/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherMetadata.java
@@ -150,6 +150,8 @@
// DATA_KEY_ATTRIBUTE
if (publisher.containsAttribute(DATA_KEY_ATTRIBUTE)) {
m_dataKey = publisher.getAttribute(DATA_KEY_ATTRIBUTE);
+ } else if (publisher.containsAttribute("data_key")) {
+ m_dataKey = publisher.getAttribute("data_key");
} else {
m_dataKey = DEFAULT_DATA_KEY_VALUE;
}
diff --git a/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberHandler.java b/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberHandler.java
index 92e69ae..993934c 100644
--- a/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberHandler.java
+++ b/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberHandler.java
@@ -54,7 +54,7 @@
/**
* The handler namespace.
*/
- public static final String NAMESPACE = "org.apache.felix.ipojo.handlers.event.EventAdminHandler";
+ public static final String NAMESPACE = "org.apache.felix.ipojo.handlers.event";
// Names of instance configuration properties.
diff --git a/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberMetadata.java b/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberMetadata.java
index bf17914..e94d640 100644
--- a/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberMetadata.java
+++ b/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberMetadata.java
@@ -90,7 +90,7 @@
/**
* The key where user data are stored in the event dictionary.
*/
- private final String m_dataKey;
+ private String m_dataKey;
/**
* The type of received data.
@@ -135,6 +135,8 @@
// CALLBACK_ATTRIBUTE
if (subscriber.containsAttribute(CALLBACK_ATTRIBUTE)) {
m_callback = subscriber.getAttribute(CALLBACK_ATTRIBUTE);
+ } else if (subscriber.containsAttribute("method")) {
+ m_callback = subscriber.getAttribute("method");
} else {
throw new ConfigurationException(
"Missing required attribute in component configuration : "
@@ -156,14 +158,21 @@
// DATA_KEY_ATTRIBUTE
m_dataKey = subscriber.getAttribute(DATA_KEY_ATTRIBUTE);
- if (subscriber.containsAttribute(DATA_TYPE_ATTRIBUTE)) {
+ if (m_dataKey == null) { // Alternative configuration
+ m_dataKey = subscriber.getAttribute("data_key");
+ }
+
+ String t = subscriber.getAttribute(DATA_TYPE_ATTRIBUTE);
+ if (t == null) { // Alternative configuration
+ t = subscriber.getAttribute("data_type");
+ }
+ if (t != null) {
Class type;
- String typeName = subscriber.getAttribute(DATA_TYPE_ATTRIBUTE);
try {
- type = m_bundleContext.getBundle().loadClass(typeName);
+ type = m_bundleContext.getBundle().loadClass(t);
} catch (ClassNotFoundException e) {
throw new ConfigurationException("Data type class not found : "
- + typeName);
+ + t);
}
m_dataType = type;
} else {
diff --git a/ipojo/handler/eventadmin/src/main/resources/event-admin.xsd b/ipojo/handler/eventadmin/src/main/resources/event-admin.xsd
index 78406b3..b9c8271 100644
--- a/ipojo/handler/eventadmin/src/main/resources/event-admin.xsd
+++ b/ipojo/handler/eventadmin/src/main/resources/event-admin.xsd
@@ -16,8 +16,8 @@
specific language governing permissions and limitations
under the License.
-->
-<xs:schema targetNamespace="org.apache.felix.ipojo.handlers.event.EventAdminHandler"
- xmlns="org.apache.felix.ipojo.handlers.event.EventAdminHandler"
+<xs:schema targetNamespace="org.apache.felix.ipojo.handlers.event"
+ xmlns="org.apache.felix.ipojo.handlers.event"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
diff --git a/ipojo/handler/whiteboard/metadata.xml b/ipojo/handler/whiteboard/metadata.xml
index 7b4e837..d9c1c53 100644
--- a/ipojo/handler/whiteboard/metadata.xml
+++ b/ipojo/handler/whiteboard/metadata.xml
@@ -19,6 +19,6 @@
<ipojo>
<handler
classname="org.apache.felix.ipojo.handler.wbp.WhiteBoardPatternHandler"
- name="wbp" namespace="org.apache.felix.ipojo.white-board-pattern">
+ name="wbp" namespace="org.apache.felix.ipojo.whiteboard">
</handler>
</ipojo>
\ No newline at end of file
diff --git a/ipojo/handler/whiteboard/obr.xml b/ipojo/handler/whiteboard/obr.xml
index a8df6b8..2da24fa 100644
--- a/ipojo/handler/whiteboard/obr.xml
+++ b/ipojo/handler/whiteboard/obr.xml
@@ -19,7 +19,7 @@
<obr>
<capability name="ipojo.handler">
<p n="name" v="wbp"/>
- <p n="namespace" v="org.apache.felix.ipojo.white-board-pattern"/>
+ <p n="namespace" v="org.apache.felix.ipojo.whiteboard"/>
<p n="type" v="primitive"/>
</capability>
</obr>
\ No newline at end of file
diff --git a/ipojo/handler/whiteboard/src/main/java/org/apache/felix/ipojo/handler/wbp/WhiteBoardPatternHandler.java b/ipojo/handler/whiteboard/src/main/java/org/apache/felix/ipojo/handler/wbp/WhiteBoardPatternHandler.java
index d3d35a8..0f3e3d7 100644
--- a/ipojo/handler/whiteboard/src/main/java/org/apache/felix/ipojo/handler/wbp/WhiteBoardPatternHandler.java
+++ b/ipojo/handler/whiteboard/src/main/java/org/apache/felix/ipojo/handler/wbp/WhiteBoardPatternHandler.java
@@ -37,7 +37,7 @@
/**
* The handler namespace.
*/
- public static final String NAMESPACE = "org.apache.felix.ipojo.white-board-pattern";
+ public static final String NAMESPACE = "org.apache.felix.ipojo.whiteboard";
/**
* The white board pattern to manage. By default just one.
diff --git a/ipojo/handler/whiteboard/src/main/resources/whiteboard-pattern.xsd b/ipojo/handler/whiteboard/src/main/resources/whiteboard-pattern.xsd
index 85aad08..f02afde 100644
--- a/ipojo/handler/whiteboard/src/main/resources/whiteboard-pattern.xsd
+++ b/ipojo/handler/whiteboard/src/main/resources/whiteboard-pattern.xsd
@@ -16,8 +16,8 @@
specific language governing permissions and limitations
under the License.
-->
-<xs:schema targetNamespace="org.apache.felix.ipojo.white-board-pattern"
- xmlns="org.apache.felix.ipojo.white-board-pattern"
+<xs:schema targetNamespace="org.apache.felix.ipojo.whiteboard"
+ xmlns="org.apache.felix.ipojo.whiteboard"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:element name="wbp" type="WBPType"></xs:element>
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/CustomAnnotationVisitor.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/CustomAnnotationVisitor.java
index 9410430..fdd3ba2 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/CustomAnnotationVisitor.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/CustomAnnotationVisitor.java
@@ -34,7 +34,7 @@
//TODO manage enum annotations.
/**
- * PArent element.
+ * Parent element.
*/
private Element m_elem;
@@ -54,22 +54,29 @@
* Is the custom annotation a first-order annotation.
*/
private boolean m_root;
+
+ /**
+ * Is the visit annotation a class annotation?
+ */
+ private boolean m_classAnnotation;
/**
- * MEtadata collector.
+ * Metadata collector.
*/
private MetadataCollector m_collector;
/**
* Constructor.
- * @param elem : parent element
- * @param collector : metadata collector
- * @param root : is the annotation a root
+ * @param elem the parent element
+ * @param collector the metadata collector
+ * @param root is the annotation a root
+ * @param clazz the annotation is a class annotation.
*/
- public CustomAnnotationVisitor(Element elem, MetadataCollector collector, boolean root) {
+ public CustomAnnotationVisitor(Element elem, MetadataCollector collector, boolean root, boolean clazz) {
m_elem = elem;
m_root = root;
m_collector = collector;
+ m_classAnnotation = clazz;
}
/**
@@ -98,17 +105,7 @@
String namespace = s.substring(0, index);
return new Element(name, namespace);
}
-
- /**
- * Build the element object from the given descriptor.
- * @param desc : annotation descriptor
- * @return the package of the annotation
- */
- public static String getPackage(String desc) {
- String s = (desc.replace('/', '.')).substring(1, desc.length() - 1);
- int index = s.lastIndexOf('.');
- return s.substring(0, index);
- }
+
/**
* Visit a 'simple' annotation attribute.
@@ -155,7 +152,7 @@
// Sub annotations are mapped to sub-elements
Element elem = buildElement(arg1);
m_elem.addElement(elem);
- return new CustomAnnotationVisitor(elem, m_collector, false);
+ return new CustomAnnotationVisitor(elem, m_collector, false, false);
}
/**
@@ -189,7 +186,7 @@
if (m_id != null) {
m_collector.getIds().put(m_id, m_elem);
} else {
- if (! m_collector.getIds().containsKey(m_elem.getNameSpace())) {
+ if (! m_collector.getIds().containsKey(m_elem.getNameSpace()) && m_classAnnotation) {
// If the namespace is not already used, add the annotation as the
// root element of this namespace.
m_collector.getIds().put(m_elem.getNameSpace(), m_elem);
@@ -257,7 +254,7 @@
// Sub annotations are map to sub-elements
Element elem = buildElement(arg1);
m_elem.addElement(elem);
- return new CustomAnnotationVisitor(elem, m_collector, false);
+ return new CustomAnnotationVisitor(elem, m_collector, false, false);
}
/**
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/FieldCollector.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/FieldCollector.java
index bc9014c..a181605 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/FieldCollector.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/FieldCollector.java
@@ -94,7 +94,7 @@
if (CustomAnnotationVisitor.isCustomAnnotation(arg0)) {
Element elem = CustomAnnotationVisitor.buildElement(arg0);
elem.addAttribute(new Attribute("field", m_field)); // Add a field attribute
- return new CustomAnnotationVisitor(elem, m_collector, true);
+ return new CustomAnnotationVisitor(elem, m_collector, true, false);
}
return null;
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/MetadataCollector.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/MetadataCollector.java
index 11d0603..7874b9f 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/MetadataCollector.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/MetadataCollector.java
@@ -96,7 +96,7 @@
/**
* Visit class annotations.
- * This method detects @component, @provides and @Element annotations.
+ * This method detects @component and @provides annotations.
* @param desc : annotation descriptor.
* @param visible : is the annotation visible at runtime.
* @return the annotation visitor.
@@ -118,7 +118,7 @@
if (CustomAnnotationVisitor.isCustomAnnotation(desc)) {
Element elem = CustomAnnotationVisitor.buildElement(desc);
- return new CustomAnnotationVisitor(elem, this, true);
+ return new CustomAnnotationVisitor(elem, this, true, true);
}
return null;
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/MethodCollector.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/MethodCollector.java
index 7d20d59..b139231 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/MethodCollector.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/MethodCollector.java
@@ -80,7 +80,7 @@
if (CustomAnnotationVisitor.isCustomAnnotation(arg0)) {
Element elem = CustomAnnotationVisitor.buildElement(arg0);
elem.addAttribute(new Attribute("method", m_name));
- return new CustomAnnotationVisitor(elem, m_collector, true);
+ return new CustomAnnotationVisitor(elem, m_collector, true, false);
}
return null;
diff --git a/ipojo/manipulator/src/main/resources/event-admin.xsd b/ipojo/manipulator/src/main/resources/event-admin.xsd
index 78406b3..b9c8271 100644
--- a/ipojo/manipulator/src/main/resources/event-admin.xsd
+++ b/ipojo/manipulator/src/main/resources/event-admin.xsd
@@ -16,8 +16,8 @@
specific language governing permissions and limitations
under the License.
-->
-<xs:schema targetNamespace="org.apache.felix.ipojo.handlers.event.EventAdminHandler"
- xmlns="org.apache.felix.ipojo.handlers.event.EventAdminHandler"
+<xs:schema targetNamespace="org.apache.felix.ipojo.handlers.event"
+ xmlns="org.apache.felix.ipojo.handlers.event"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
diff --git a/ipojo/manipulator/src/main/resources/whiteboard-pattern.xsd b/ipojo/manipulator/src/main/resources/whiteboard-pattern.xsd
index 85aad08..f02afde 100644
--- a/ipojo/manipulator/src/main/resources/whiteboard-pattern.xsd
+++ b/ipojo/manipulator/src/main/resources/whiteboard-pattern.xsd
@@ -16,8 +16,8 @@
specific language governing permissions and limitations
under the License.
-->
-<xs:schema targetNamespace="org.apache.felix.ipojo.white-board-pattern"
- xmlns="org.apache.felix.ipojo.white-board-pattern"
+<xs:schema targetNamespace="org.apache.felix.ipojo.whiteboard"
+ xmlns="org.apache.felix.ipojo.whiteboard"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:element name="wbp" type="WBPType"></xs:element>
diff --git a/ipojo/tests/core/annotations/pom.xml b/ipojo/tests/core/annotations/pom.xml
index 92151fd..848d557 100644
--- a/ipojo/tests/core/annotations/pom.xml
+++ b/ipojo/tests/core/annotations/pom.xml
@@ -31,7 +31,8 @@
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.ipojo.metadata</artifactId>
+ <artifactId>org.apache.felix.ipojo.metadata
+ </artifactId>
<version>1.1.0-SNAPSHOT</version>
</dependency>
<dependency>
@@ -46,17 +47,24 @@
</dependency>
<dependency>
<groupId>ipojo.examples</groupId>
- <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
+ <artifactId>org.apache.felix.ipojo.junit4osgi
+ </artifactId>
<version>1.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.ipojo.annotations</artifactId>
+ <artifactId>org.apache.felix.ipojo.annotations
+ </artifactId>
<version>1.1.0-SNAPSHOT</version>
</dependency>
-
-
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.ipojo.handler.eventadmin
+ </artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ </dependency>
</dependencies>
+
<build>
<plugins>
<plugin>
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AnnotationsTestSuite.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AnnotationsTestSuite.java
index edea2a5..dc7d880 100644
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AnnotationsTestSuite.java
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AnnotationsTestSuite.java
@@ -44,6 +44,11 @@
// External handler annotations
ots.addTestSuite(TemporalDependencies.class);
ots.addTestSuite(JMX.class);
+ ots.addTestSuite(WhiteBoard.class);
+ ots.addTestSuite(Extender.class);
+ ots.addTestSuite(EventAdmin.class);
+
+
return ots;
}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/EventAdmin.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/EventAdmin.java
new file mode 100644
index 0000000..cc61cc3
--- /dev/null
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/EventAdmin.java
@@ -0,0 +1,114 @@
+package org.apache.felix.ipojo.test.scenarios.annotations;
+
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.metadata.Element;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+
+public class EventAdmin extends OSGiTestCase {
+ String type = "org.apache.felix.ipojo.test.scenarios.component.event.PubSub";
+ String namespace = "org.apache.felix.ipojo.handlers.event";
+
+ Element component;
+
+ public void setUp() {
+ component = Utils.getMetatadata(context, type);
+ assertNotNull("Check component", component);
+ }
+
+ public void tearDown() {
+ component = null;
+ }
+
+ public void testP1() {
+ //P1, synchronous
+ Element elem = getElementByName("p1");
+ checkPublisher(elem);
+ assertNull("Check topics", elem.getAttribute("topics"));
+ assertEquals("Check synchronous", "true", elem.getAttribute("synchronous"));
+ assertEquals("Check field", "publisher1", elem.getAttribute("field"));
+ assertNull("Check data_key", elem.getAttribute("data_key"));
+ }
+
+ public void testP2() {
+ //name="p2", synchronous=false, topics="foo,bar", data_key="data"
+ Element elem = getElementByName("p2");
+ checkPublisher(elem);
+ assertEquals("Check topics (" + elem.getAttribute("topics")+")", "foo,bar", elem.getAttribute("topics"));
+ assertEquals("Check synchronous", "false", elem.getAttribute("synchronous"));
+ assertEquals("Check field", "publisher2", elem.getAttribute("field"));
+ assertEquals("Check data_key", "data" ,elem.getAttribute("data_key"));
+ }
+
+ public void testP3() {
+ //name="p3", synchronous=true, topics="bar"
+ Element elem = getElementByName("p3");
+ checkPublisher(elem);
+ assertEquals("Check topics", "bar" ,elem.getAttribute("topics"));
+ assertEquals("Check synchronous", "true", elem.getAttribute("synchronous"));
+ assertEquals("Check field", "publisher3", elem.getAttribute("field"));
+ assertNull("Check data_key", elem.getAttribute("data_key"));
+ }
+
+ public void testS1() {
+ //name="s1", data_key="data"
+ Element elem = getElementByName("s1");
+ checkSubscriber(elem);
+ assertNull("Check topics",elem.getAttribute("topics"));
+ assertEquals("Check method", "receive1", elem.getAttribute("method"));
+ assertEquals("Check data_key", "data" ,elem.getAttribute("data_key"));
+ assertNull("Check data_type", elem.getAttribute("data_type"));
+ assertNull("Check filter", elem.getAttribute("filter"));
+ }
+
+ public void testS2() {
+ //name="s2", topics="foo,bar", filter="(foo=true)"
+ Element elem = getElementByName("s2");
+ checkSubscriber(elem);
+ assertEquals("Check topics", "foo,bar", elem.getAttribute("topics"));
+ assertEquals("Check method", "receive2", elem.getAttribute("method"));
+ assertNull("Check data_key" ,elem.getAttribute("data_key"));
+ assertNull("Check data_type", elem.getAttribute("data_type"));
+ assertEquals("Check filter","(foo=true)" , elem.getAttribute("filter"));
+ }
+
+ public void testS3() {
+ //name="s3", topics="foo", data_key="data", data_type="java.lang.String"
+ Element elem = getElementByName("s3");
+ checkSubscriber(elem);
+ assertEquals("Check topics", "foo", elem.getAttribute("topics"));
+ assertEquals("Check method", "receive3", elem.getAttribute("method"));
+ assertEquals("Check data_key", "data" ,elem.getAttribute("data_key"));
+ assertEquals("Check data_type", "java.lang.String", elem.getAttribute("data_type"));
+ assertNull("Check filter", elem.getAttribute("filter"));
+ }
+
+
+
+ public Element getElementByName(String name) {
+ Element [] elems = component.getElements();
+ for (int i = 0; i < elems.length; i++) {
+ if (elems[i].containsAttribute("name") && elems[i].getAttribute("name").equals(name)) {
+ return elems[i];
+ }
+ }
+ return null;
+ }
+
+ public void checkSubscriber(Element elem) {
+ assertNotNull("Can't check subscriber : null element",elem);
+ String ns = elem.getNameSpace();
+ String nm = elem.getName();
+ assertEquals("Elem is not a subscriber : bad namespace", namespace, ns);
+ assertEquals("Elem is not a subscriber : bad name", "subscriber", nm);
+
+ }
+
+ public void checkPublisher(Element elem) {
+ assertNotNull("Can't check publisher : null element",elem);
+ String ns = elem.getNameSpace();
+ String nm = elem.getName();
+ assertEquals("Elem is not a publisher : bad namespace", namespace, ns);
+ assertEquals("Elem is not a publisher : bad name", "publisher", nm);
+ }
+
+}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Extender.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Extender.java
new file mode 100644
index 0000000..28e9661
--- /dev/null
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Extender.java
@@ -0,0 +1,27 @@
+package org.apache.felix.ipojo.test.scenarios.annotations;
+
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.metadata.Element;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+
+public class Extender extends OSGiTestCase {
+
+ String type = "org.apache.felix.ipojo.test.scenarios.component.extender.Extender";
+ String namespace = "org.apache.felix.ipojo.extender";
+
+
+ public void testMetadata() {
+ Element meta = Utils.getMetatadata(context, type);
+ assertNotNull("Check meta", meta);
+ Element[] ext = meta.getElements("extender", namespace);
+ assertEquals("Check size", 1, ext.length);
+ String extension = ext[0].getAttribute("extension");
+ String onArr = ext[0].getAttribute("onArrival");
+ String onDep = ext[0].getAttribute("onDeparture");
+
+ assertEquals("Check extension", "foo", extension);
+ assertEquals("Check onArrival", "onArrival", onArr);
+ assertEquals("Check onDeparture", "onDeparture", onDep);
+ }
+
+}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/JMX.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/JMX.java
index 7714d3b..656d987 100644
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/JMX.java
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/JMX.java
@@ -8,7 +8,31 @@
public void testSimple() {
Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.jmx.JMXSimple");
- System.out.println("meta: " + meta);
+ /*
+ * org.apache.felix.ipojo.handlers.jmx:config domain="my-domain" usesmosgi="false"
+ org.apache.felix.ipojo.handlers.jmx:property field="m_foo" name="prop" rights="w" notification="true"
+ org.apache.felix.ipojo.handlers.jmx:method description="get the foo prop" method="getFoo"
+ org.apache.felix.ipojo.handlers.jmx:method description="set the foo prop" method="setFoo"
+ */
+
+ Element[] ele = meta.getElements("config", "org.apache.felix.ipojo.handlers.jmx");
+ assertNotNull("ele not null", ele);
+ assertEquals("Ele size", 1, ele.length);
+ String domain = ele[0].getAttribute("domain");
+ String mosgi = ele[0].getAttribute("usesmosgi");
+ assertEquals("domain", "my-domain", domain);
+ assertEquals("mosgi", "false", mosgi);
+
+ Element[] props = ele[0].getElements("property", "org.apache.felix.ipojo.handlers.jmx");
+ assertNotNull("props not null", props);
+ assertEquals("props size", 1, props.length);
+
+ Element[] methods = ele[0].getElements("method", "org.apache.felix.ipojo.handlers.jmx");
+ assertNotNull("methods not null", methods);
+ assertEquals("methods size", 2, methods.length);
+
+
+
}
}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/WhiteBoard.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/WhiteBoard.java
new file mode 100644
index 0000000..4f9022a
--- /dev/null
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/WhiteBoard.java
@@ -0,0 +1,49 @@
+package org.apache.felix.ipojo.test.scenarios.annotations;
+
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.metadata.Element;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+
+public class WhiteBoard extends OSGiTestCase {
+
+ String typeWI = "org.apache.felix.ipojo.test.scenarios.component.whiteboard.WhiteBoardWIModification";
+ String typeWO = "org.apache.felix.ipojo.test.scenarios.component.whiteboard.WhiteBoardWOModification";
+ String namespace = "org.apache.felix.ipojo.whiteboard";
+
+ public void testMetadataWithOnModification() {
+ Element meta = Utils.getMetatadata(context, typeWI);
+ assertNotNull("Check meta", meta);
+ Element[] ext = meta.getElements("wbp", namespace);
+ assertEquals("Check size", 1, ext.length);
+ String filter = ext[0].getAttribute("filter");
+ String onArr = ext[0].getAttribute("onArrival");
+ String onDep = ext[0].getAttribute("onDeparture");
+ String onMod = ext[0].getAttribute("onModification");
+
+
+ assertEquals("Check filter", "(foo=true)", filter);
+ assertEquals("Check onArrival", "onArrival", onArr);
+ assertEquals("Check onDeparture", "onDeparture", onDep);
+ assertEquals("Check onModification", "onModification", onMod);
+
+ }
+
+ public void testMetadataWithoutOnModification() {
+ Element meta = Utils.getMetatadata(context, typeWO);
+ assertNotNull("Check meta", meta);
+ Element[] ext = meta.getElements("wbp", namespace);
+ assertEquals("Check size", 1, ext.length);
+ String filter = ext[0].getAttribute("filter");
+ String onArr = ext[0].getAttribute("onArrival");
+ String onDep = ext[0].getAttribute("onDeparture");
+ String onMod = ext[0].getAttribute("onModification");
+
+
+ assertEquals("Check filter", "(foo=true)", filter);
+ assertEquals("Check onArrival", "onArrival", onArr);
+ assertEquals("Check onDeparture", "onDeparture", onDep);
+ assertNull("Check onModification", onMod);
+
+ }
+
+}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/event/PubSub.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/event/PubSub.java
new file mode 100644
index 0000000..be15ac2
--- /dev/null
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/event/PubSub.java
@@ -0,0 +1,37 @@
+package org.apache.felix.ipojo.test.scenarios.component.event;
+
+import org.apache.felix.ipojo.annotations.Component;
+import org.apache.felix.ipojo.handlers.event.Subscriber;
+import org.osgi.service.event.Event;
+
+
+@Component
+public class PubSub {
+ @org.apache.felix.ipojo.handlers.event.Publisher(name="p1", synchronous=true)
+ org.apache.felix.ipojo.handlers.event.publisher.Publisher publisher1;
+
+ @org.apache.felix.ipojo.handlers.event.Publisher(name="p2", synchronous=false, topics="foo,bar", data_key="data")
+ org.apache.felix.ipojo.handlers.event.publisher.Publisher publisher2;
+
+ @org.apache.felix.ipojo.handlers.event.Publisher(name="p3", synchronous=true, topics="bar")
+ org.apache.felix.ipojo.handlers.event.publisher.Publisher publisher3;
+
+ @Subscriber(name="s1", data_key="data")
+ public void receive1(Object foo) {
+ // Nothing
+ }
+
+ @Subscriber(name="s2", topics="foo,bar", filter="(foo=true)")
+ public void receive2(Event foo) {
+ // Nothing
+ }
+
+
+ @Subscriber(name="s3", topics="foo", data_key="data", data_type="java.lang.String")
+ public void receive3(String foo) {
+ // Nothing
+ }
+
+
+
+}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/extender/Extender.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/extender/Extender.java
new file mode 100644
index 0000000..230388a
--- /dev/null
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/extender/Extender.java
@@ -0,0 +1,18 @@
+package org.apache.felix.ipojo.test.scenarios.component.extender;
+
+import org.apache.felix.ipojo.annotations.Component;
+import org.osgi.framework.Bundle;
+
+
+@Component
+@org.apache.felix.ipojo.extender.Extender(extension="foo", onArrival="onArrival", onDeparture="onDeparture")
+public class Extender {
+
+ public void onArrival(Bundle bundle, String foo) {
+ // nothing
+ }
+
+ public void onDeparture(Bundle bundle) {
+ // nothing
+ }
+}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/jmx/JMXSimple.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/jmx/JMXSimple.java
index 7cbc1ae..54cbbe7 100644
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/jmx/JMXSimple.java
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/jmx/JMXSimple.java
@@ -1,11 +1,12 @@
package org.apache.felix.ipojo.test.scenarios.component.jmx;
import org.apache.felix.ipojo.annotations.Component;
+import org.apache.felix.ipojo.handlers.jmx.Config;
import org.apache.felix.ipojo.handlers.jmx.Method;
import org.apache.felix.ipojo.handlers.jmx.Property;
@Component
-@org.apache.felix.ipojo.handlers.jmx.Config(domain="my-domain", usesMOSGi=false)
+@Config(domain="my-domain", usesMOSGi=false)
public class JMXSimple {
@Property(name="prop", notification=true, rights="w")
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/whiteboard/WhiteBoardWIModification.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/whiteboard/WhiteBoardWIModification.java
new file mode 100644
index 0000000..840d899
--- /dev/null
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/whiteboard/WhiteBoardWIModification.java
@@ -0,0 +1,25 @@
+package org.apache.felix.ipojo.test.scenarios.component.whiteboard;
+
+import org.apache.felix.ipojo.annotations.Component;
+import org.osgi.framework.ServiceReference;
+
+@Component
+@org.apache.felix.ipojo.whiteboard.Wbp(filter="(foo=true)",
+ onArrival="onArrival",
+ onDeparture="onDeparture",
+ onModification="onModification")
+public class WhiteBoardWIModification {
+
+ public void onArrival(ServiceReference ref) {
+ // nothing
+ }
+
+ public void onDeparture(ServiceReference ref) {
+ // nothing
+ }
+
+ public void onModification(ServiceReference ref) {
+ // nothing
+ }
+
+}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/whiteboard/WhiteBoardWOModification.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/whiteboard/WhiteBoardWOModification.java
new file mode 100644
index 0000000..1424db1
--- /dev/null
+++ b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/whiteboard/WhiteBoardWOModification.java
@@ -0,0 +1,18 @@
+package org.apache.felix.ipojo.test.scenarios.component.whiteboard;
+
+import org.apache.felix.ipojo.annotations.Component;
+import org.osgi.framework.ServiceReference;
+
+@Component
+@org.apache.felix.ipojo.whiteboard.Wbp(filter="(foo=true)", onArrival="onArrival", onDeparture="onDeparture")
+public class WhiteBoardWOModification {
+
+ public void onArrival(ServiceReference ref) {
+ // nothing
+ }
+
+ public void onDeparture(ServiceReference ref) {
+ // nothing
+ }
+
+}
diff --git a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/BadTests.java b/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/BadTests.java
index 07eb675..e9e0063 100644
--- a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/BadTests.java
+++ b/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/BadTests.java
@@ -53,8 +53,8 @@
/**
* The namespace of the Event admin handler.
*/
- private static final String NAMESPACE = "org.apache.felix.ipojo.handlers.event.EventAdminHandler";
-
+ private static final String NAMESPACE = "org.apache.felix.ipojo.handlers.event";
+
/**
* The available components.
*/
diff --git a/ipojo/tests/handler/eventadmin/src/main/resources/metadata.xml b/ipojo/tests/handler/eventadmin/src/main/resources/metadata.xml
index bb0e571..4067176 100644
--- a/ipojo/tests/handler/eventadmin/src/main/resources/metadata.xml
+++ b/ipojo/tests/handler/eventadmin/src/main/resources/metadata.xml
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<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.handlers.event.EventAdminHandler http://people.apache.org/~clement/ipojo/schemas/event-admin.xsd"
+ org.apache.felix.ipojo.handlers.event http://people.apache.org/~clement/ipojo/schemas/event-admin.xsd"
xmlns="org.apache.felix.ipojo"
- xmlns:ev="org.apache.felix.ipojo.handlers.event.EventAdminHandler">
+ xmlns:ev="org.apache.felix.ipojo.handlers.event">
<!-- The (asynchronous) donut provider -->
<component classname="org.apache.felix.ipojo.test.donut.DonutProviderImpl"
diff --git a/ipojo/tests/handler/whiteboard/src/main/resources/metadata.xml b/ipojo/tests/handler/whiteboard/src/main/resources/metadata.xml
index 2e4666d..98f87d2 100644
--- a/ipojo/tests/handler/whiteboard/src/main/resources/metadata.xml
+++ b/ipojo/tests/handler/whiteboard/src/main/resources/metadata.xml
@@ -1,9 +1,9 @@
<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.white-board-pattern http://people.apache.org/~clement/ipojo/schemas/whiteboard-pattern.xsd"
+ org.apache.felix.ipojo.whiteboard http://people.apache.org/~clement/ipojo/schemas/whiteboard-pattern.xsd"
xmlns="org.apache.felix.ipojo"
- xmlns:wbp="org.apache.felix.ipojo.white-board-pattern">
+ xmlns:wbp="org.apache.felix.ipojo.whiteboard">
<component classname="org.apache.felix.ipojo.test.FooProvider" name="fooprovider">
<provides>
<property field="foo" value="foo"/>