You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by cl...@apache.org on 2008/11/25 15:47:51 UTC

svn commit: r720508 - in /felix/trunk/ipojo: annotations/ annotations/src/main/java/org/apache/felix/ipojo/extender/ annotations/src/main/java/org/apache/felix/ipojo/handlers/event/ annotations/src/main/java/org/apache/felix/ipojo/whiteboard/ core/src/...

Author: clement
Date: Tue Nov 25 06:47:49 2008
New Revision: 720508

URL: http://svn.apache.org/viewvc?rev=720508&view=rev
Log:
Fix issue Felix-834.
Provides annotations for the whiteboard, extender and event admin handlers.

Added:
    felix/trunk/ipojo/annotations/src/main/java/org/apache/felix/ipojo/extender/
    felix/trunk/ipojo/annotations/src/main/java/org/apache/felix/ipojo/extender/Extender.java
    felix/trunk/ipojo/annotations/src/main/java/org/apache/felix/ipojo/handlers/event/
    felix/trunk/ipojo/annotations/src/main/java/org/apache/felix/ipojo/handlers/event/Publisher.java
    felix/trunk/ipojo/annotations/src/main/java/org/apache/felix/ipojo/handlers/event/Subscriber.java
    felix/trunk/ipojo/annotations/src/main/java/org/apache/felix/ipojo/whiteboard/
    felix/trunk/ipojo/annotations/src/main/java/org/apache/felix/ipojo/whiteboard/Wbp.java
    felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/EventAdmin.java
    felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Extender.java
    felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/WhiteBoard.java
    felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/event/
    felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/event/PubSub.java
    felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/extender/
    felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/extender/Extender.java
    felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/whiteboard/
    felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/whiteboard/WhiteBoardWIModification.java
    felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/whiteboard/WhiteBoardWOModification.java
Modified:
    felix/trunk/ipojo/annotations/pom.xml
    felix/trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedService.java
    felix/trunk/ipojo/handler/eventadmin/metadata.xml
    felix/trunk/ipojo/handler/eventadmin/obr.xml
    felix/trunk/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherHandler.java
    felix/trunk/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherMetadata.java
    felix/trunk/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberHandler.java
    felix/trunk/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberMetadata.java
    felix/trunk/ipojo/handler/eventadmin/src/main/resources/event-admin.xsd
    felix/trunk/ipojo/handler/whiteboard/metadata.xml
    felix/trunk/ipojo/handler/whiteboard/obr.xml
    felix/trunk/ipojo/handler/whiteboard/src/main/java/org/apache/felix/ipojo/handler/wbp/WhiteBoardPatternHandler.java
    felix/trunk/ipojo/handler/whiteboard/src/main/resources/whiteboard-pattern.xsd
    felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/CustomAnnotationVisitor.java
    felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/FieldCollector.java
    felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/MetadataCollector.java
    felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/MethodCollector.java
    felix/trunk/ipojo/manipulator/src/main/resources/event-admin.xsd
    felix/trunk/ipojo/manipulator/src/main/resources/whiteboard-pattern.xsd
    felix/trunk/ipojo/tests/core/annotations/pom.xml
    felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AnnotationsTestSuite.java
    felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/JMX.java
    felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/jmx/JMXSimple.java
    felix/trunk/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/BadTests.java
    felix/trunk/ipojo/tests/handler/eventadmin/src/main/resources/metadata.xml
    felix/trunk/ipojo/tests/handler/whiteboard/src/main/resources/metadata.xml

Modified: felix/trunk/ipojo/annotations/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/annotations/pom.xml?rev=720508&r1=720507&r2=720508&view=diff
==============================================================================
--- felix/trunk/ipojo/annotations/pom.xml (original)
+++ felix/trunk/ipojo/annotations/pom.xml Tue Nov 25 06:47:49 2008
@@ -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>

Added: felix/trunk/ipojo/annotations/src/main/java/org/apache/felix/ipojo/extender/Extender.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/annotations/src/main/java/org/apache/felix/ipojo/extender/Extender.java?rev=720508&view=auto
==============================================================================
--- felix/trunk/ipojo/annotations/src/main/java/org/apache/felix/ipojo/extender/Extender.java (added)
+++ felix/trunk/ipojo/annotations/src/main/java/org/apache/felix/ipojo/extender/Extender.java Tue Nov 25 06:47:49 2008
@@ -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();
+    
+}

Added: felix/trunk/ipojo/annotations/src/main/java/org/apache/felix/ipojo/handlers/event/Publisher.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/annotations/src/main/java/org/apache/felix/ipojo/handlers/event/Publisher.java?rev=720508&view=auto
==============================================================================
--- felix/trunk/ipojo/annotations/src/main/java/org/apache/felix/ipojo/handlers/event/Publisher.java (added)
+++ felix/trunk/ipojo/annotations/src/main/java/org/apache/felix/ipojo/handlers/event/Publisher.java Tue Nov 25 06:47:49 2008
@@ -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";
+
+}

Added: felix/trunk/ipojo/annotations/src/main/java/org/apache/felix/ipojo/handlers/event/Subscriber.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/annotations/src/main/java/org/apache/felix/ipojo/handlers/event/Subscriber.java?rev=720508&view=auto
==============================================================================
--- felix/trunk/ipojo/annotations/src/main/java/org/apache/felix/ipojo/handlers/event/Subscriber.java (added)
+++ felix/trunk/ipojo/annotations/src/main/java/org/apache/felix/ipojo/handlers/event/Subscriber.java Tue Nov 25 06:47:49 2008
@@ -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 "";
+
+}

Added: felix/trunk/ipojo/annotations/src/main/java/org/apache/felix/ipojo/whiteboard/Wbp.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/annotations/src/main/java/org/apache/felix/ipojo/whiteboard/Wbp.java?rev=720508&view=auto
==============================================================================
--- felix/trunk/ipojo/annotations/src/main/java/org/apache/felix/ipojo/whiteboard/Wbp.java (added)
+++ felix/trunk/ipojo/annotations/src/main/java/org/apache/felix/ipojo/whiteboard/Wbp.java Tue Nov 25 06:47:49 2008
@@ -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 "";
+}

Modified: felix/trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedService.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedService.java?rev=720508&r1=720507&r2=720508&view=diff
==============================================================================
--- felix/trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedService.java (original)
+++ felix/trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedService.java Tue Nov 25 06:47:49 2008
@@ -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() {

Modified: felix/trunk/ipojo/handler/eventadmin/metadata.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/eventadmin/metadata.xml?rev=720508&r1=720507&r2=720508&view=diff
==============================================================================
--- felix/trunk/ipojo/handler/eventadmin/metadata.xml (original)
+++ felix/trunk/ipojo/handler/eventadmin/metadata.xml Tue Nov 25 06:47:49 2008
@@ -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

Modified: felix/trunk/ipojo/handler/eventadmin/obr.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/eventadmin/obr.xml?rev=720508&r1=720507&r2=720508&view=diff
==============================================================================
--- felix/trunk/ipojo/handler/eventadmin/obr.xml (original)
+++ felix/trunk/ipojo/handler/eventadmin/obr.xml Tue Nov 25 06:47:49 2008
@@ -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>

Modified: felix/trunk/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherHandler.java?rev=720508&r1=720507&r2=720508&view=diff
==============================================================================
--- felix/trunk/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherHandler.java (original)
+++ felix/trunk/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherHandler.java Tue Nov 25 06:47:49 2008
@@ -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.

Modified: felix/trunk/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherMetadata.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherMetadata.java?rev=720508&r1=720507&r2=720508&view=diff
==============================================================================
--- felix/trunk/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherMetadata.java (original)
+++ felix/trunk/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherMetadata.java Tue Nov 25 06:47:49 2008
@@ -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;
         }

Modified: felix/trunk/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberHandler.java?rev=720508&r1=720507&r2=720508&view=diff
==============================================================================
--- felix/trunk/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberHandler.java (original)
+++ felix/trunk/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberHandler.java Tue Nov 25 06:47:49 2008
@@ -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.
 

Modified: felix/trunk/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberMetadata.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberMetadata.java?rev=720508&r1=720507&r2=720508&view=diff
==============================================================================
--- felix/trunk/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberMetadata.java (original)
+++ felix/trunk/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberMetadata.java Tue Nov 25 06:47:49 2008
@@ -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 {

Modified: felix/trunk/ipojo/handler/eventadmin/src/main/resources/event-admin.xsd
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/eventadmin/src/main/resources/event-admin.xsd?rev=720508&r1=720507&r2=720508&view=diff
==============================================================================
--- felix/trunk/ipojo/handler/eventadmin/src/main/resources/event-admin.xsd (original)
+++ felix/trunk/ipojo/handler/eventadmin/src/main/resources/event-admin.xsd Tue Nov 25 06:47:49 2008
@@ -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">	
 

Modified: felix/trunk/ipojo/handler/whiteboard/metadata.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/whiteboard/metadata.xml?rev=720508&r1=720507&r2=720508&view=diff
==============================================================================
--- felix/trunk/ipojo/handler/whiteboard/metadata.xml (original)
+++ felix/trunk/ipojo/handler/whiteboard/metadata.xml Tue Nov 25 06:47:49 2008
@@ -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

Modified: felix/trunk/ipojo/handler/whiteboard/obr.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/whiteboard/obr.xml?rev=720508&r1=720507&r2=720508&view=diff
==============================================================================
--- felix/trunk/ipojo/handler/whiteboard/obr.xml (original)
+++ felix/trunk/ipojo/handler/whiteboard/obr.xml Tue Nov 25 06:47:49 2008
@@ -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

Modified: felix/trunk/ipojo/handler/whiteboard/src/main/java/org/apache/felix/ipojo/handler/wbp/WhiteBoardPatternHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/whiteboard/src/main/java/org/apache/felix/ipojo/handler/wbp/WhiteBoardPatternHandler.java?rev=720508&r1=720507&r2=720508&view=diff
==============================================================================
--- felix/trunk/ipojo/handler/whiteboard/src/main/java/org/apache/felix/ipojo/handler/wbp/WhiteBoardPatternHandler.java (original)
+++ felix/trunk/ipojo/handler/whiteboard/src/main/java/org/apache/felix/ipojo/handler/wbp/WhiteBoardPatternHandler.java Tue Nov 25 06:47:49 2008
@@ -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. 

Modified: felix/trunk/ipojo/handler/whiteboard/src/main/resources/whiteboard-pattern.xsd
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/whiteboard/src/main/resources/whiteboard-pattern.xsd?rev=720508&r1=720507&r2=720508&view=diff
==============================================================================
--- felix/trunk/ipojo/handler/whiteboard/src/main/resources/whiteboard-pattern.xsd (original)
+++ felix/trunk/ipojo/handler/whiteboard/src/main/resources/whiteboard-pattern.xsd Tue Nov 25 06:47:49 2008
@@ -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>

Modified: felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/CustomAnnotationVisitor.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/CustomAnnotationVisitor.java?rev=720508&r1=720507&r2=720508&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/CustomAnnotationVisitor.java (original)
+++ felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/CustomAnnotationVisitor.java Tue Nov 25 06:47:49 2008
@@ -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);
         }
 
         /**

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=720508&r1=720507&r2=720508&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 Tue Nov 25 06:47:49 2008
@@ -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;

Modified: felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/MetadataCollector.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/MetadataCollector.java?rev=720508&r1=720507&r2=720508&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/MetadataCollector.java (original)
+++ felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/annotations/MetadataCollector.java Tue Nov 25 06:47:49 2008
@@ -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;

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=720508&r1=720507&r2=720508&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 Tue Nov 25 06:47:49 2008
@@ -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;

Modified: felix/trunk/ipojo/manipulator/src/main/resources/event-admin.xsd
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/src/main/resources/event-admin.xsd?rev=720508&r1=720507&r2=720508&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/src/main/resources/event-admin.xsd (original)
+++ felix/trunk/ipojo/manipulator/src/main/resources/event-admin.xsd Tue Nov 25 06:47:49 2008
@@ -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">	
 

Modified: felix/trunk/ipojo/manipulator/src/main/resources/whiteboard-pattern.xsd
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/src/main/resources/whiteboard-pattern.xsd?rev=720508&r1=720507&r2=720508&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/src/main/resources/whiteboard-pattern.xsd (original)
+++ felix/trunk/ipojo/manipulator/src/main/resources/whiteboard-pattern.xsd Tue Nov 25 06:47:49 2008
@@ -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>

Modified: felix/trunk/ipojo/tests/core/annotations/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/annotations/pom.xml?rev=720508&r1=720507&r2=720508&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/annotations/pom.xml (original)
+++ felix/trunk/ipojo/tests/core/annotations/pom.xml Tue Nov 25 06:47:49 2008
@@ -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>

Modified: felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AnnotationsTestSuite.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AnnotationsTestSuite.java?rev=720508&r1=720507&r2=720508&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AnnotationsTestSuite.java (original)
+++ felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AnnotationsTestSuite.java Tue Nov 25 06:47:49 2008
@@ -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;
     }
 

Added: felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/EventAdmin.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/EventAdmin.java?rev=720508&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/EventAdmin.java (added)
+++ felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/EventAdmin.java Tue Nov 25 06:47:49 2008
@@ -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);
+    }
+
+}

Added: felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Extender.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Extender.java?rev=720508&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Extender.java (added)
+++ felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Extender.java Tue Nov 25 06:47:49 2008
@@ -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);
+    }
+
+}

Modified: felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/JMX.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/JMX.java?rev=720508&r1=720507&r2=720508&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/JMX.java (original)
+++ felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/JMX.java Tue Nov 25 06:47:49 2008
@@ -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);
+        
+
+
     }
 
 }

Added: felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/WhiteBoard.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/WhiteBoard.java?rev=720508&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/WhiteBoard.java (added)
+++ felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/WhiteBoard.java Tue Nov 25 06:47:49 2008
@@ -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);
+
+    }
+
+}

Added: felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/event/PubSub.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/event/PubSub.java?rev=720508&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/event/PubSub.java (added)
+++ felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/event/PubSub.java Tue Nov 25 06:47:49 2008
@@ -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
+    }
+    
+    
+    
+}

Added: felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/extender/Extender.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/extender/Extender.java?rev=720508&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/extender/Extender.java (added)
+++ felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/extender/Extender.java Tue Nov 25 06:47:49 2008
@@ -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
+    }
+}

Modified: felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/jmx/JMXSimple.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/jmx/JMXSimple.java?rev=720508&r1=720507&r2=720508&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/jmx/JMXSimple.java (original)
+++ felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/jmx/JMXSimple.java Tue Nov 25 06:47:49 2008
@@ -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")

Added: felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/whiteboard/WhiteBoardWIModification.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/whiteboard/WhiteBoardWIModification.java?rev=720508&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/whiteboard/WhiteBoardWIModification.java (added)
+++ felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/whiteboard/WhiteBoardWIModification.java Tue Nov 25 06:47:49 2008
@@ -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
+    }
+
+}

Added: felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/whiteboard/WhiteBoardWOModification.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/whiteboard/WhiteBoardWOModification.java?rev=720508&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/whiteboard/WhiteBoardWOModification.java (added)
+++ felix/trunk/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/whiteboard/WhiteBoardWOModification.java Tue Nov 25 06:47:49 2008
@@ -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
+    }
+
+}

Modified: felix/trunk/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/BadTests.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/BadTests.java?rev=720508&r1=720507&r2=720508&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/BadTests.java (original)
+++ felix/trunk/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/BadTests.java Tue Nov 25 06:47:49 2008
@@ -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.
      */

Modified: felix/trunk/ipojo/tests/handler/eventadmin/src/main/resources/metadata.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/handler/eventadmin/src/main/resources/metadata.xml?rev=720508&r1=720507&r2=720508&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/handler/eventadmin/src/main/resources/metadata.xml (original)
+++ felix/trunk/ipojo/tests/handler/eventadmin/src/main/resources/metadata.xml Tue Nov 25 06:47:49 2008
@@ -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"

Modified: felix/trunk/ipojo/tests/handler/whiteboard/src/main/resources/metadata.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/handler/whiteboard/src/main/resources/metadata.xml?rev=720508&r1=720507&r2=720508&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/handler/whiteboard/src/main/resources/metadata.xml (original)
+++ felix/trunk/ipojo/tests/handler/whiteboard/src/main/resources/metadata.xml Tue Nov 25 06:47:49 2008
@@ -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"/>