diff --git a/ipojo/event.admin.handler/LICENSE b/ipojo/event.admin.handler/LICENSE
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/ipojo/event.admin.handler/LICENSE
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.
diff --git a/ipojo/event.admin.handler/NOTICE b/ipojo/event.admin.handler/NOTICE
new file mode 100644
index 0000000..6b1c994
--- /dev/null
+++ b/ipojo/event.admin.handler/NOTICE
@@ -0,0 +1,18 @@
+Apache Felix iPOJO Event Admin Handler
+Copyright 2008 The Apache Software Foundation
+
+I. Included Software
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+Licensed under the Apache License 2.0.
+
+II. Used Software
+
+This product uses software developed at
+The OSGi Alliance (http://www.osgi.org/).
+Copyright 2006 The OSGi Alliance.
+Licensed under the Apache License 2.0.
+
+III. License Summary
+- Apache License 2.0
diff --git a/ipojo/event.admin.handler/metadata.xml b/ipojo/event.admin.handler/metadata.xml
new file mode 100644
index 0000000..db43296
--- /dev/null
+++ b/ipojo/event.admin.handler/metadata.xml
@@ -0,0 +1,15 @@
+<ipojo>
+	<handler
+		classname="org.apache.felix.ipojo.handlers.event.subscriber.EventAdminSubscriberHandler"
+		name="subscriber"
+		namespace="org.apache.felix.ipojo.handlers.event.EventAdminHandler">
+		<provides>
+			<property field="m_topics" name="event.topics" value=""/>
+		</provides>
+	</handler>
+	
+	<handler classname="org.apache.felix.ipojo.handlers.event.publisher.EventAdminPublisherHandler"
+		name="publisher"
+		namespace="org.apache.felix.ipojo.handlers.event.EventAdminHandler">
+	</handler>
+</ipojo>
\ No newline at end of file
diff --git a/ipojo/event.admin.handler/pom.xml b/ipojo/event.admin.handler/pom.xml
new file mode 100644
index 0000000..cbd5292
--- /dev/null
+++ b/ipojo/event.admin.handler/pom.xml
@@ -0,0 +1,90 @@
+<!--
+	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.
+-->
+<project>
+	<modelVersion>4.0.0</modelVersion>
+	<packaging>bundle</packaging>
+	<name>Apache Felix iPOJO Event Admin Handler</name>
+	<artifactId>org.apache.felix.ipojo.handler.event</artifactId>
+	<groupId>org.apache.felix</groupId>
+	<version>0.9.0-SNAPSHOT</version>
+	
+	<dependencies>
+		<dependency>
+			<groupId>org.apache.felix</groupId>
+			<artifactId>org.apache.felix.ipojo</artifactId>
+			<version>0.9.0-SNAPSHOT</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.felix</groupId>
+			<artifactId>org.apache.felix.ipojo.metadata</artifactId>
+			<version>0.9.0-SNAPSHOT</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.felix</groupId>
+			<artifactId>org.osgi.core</artifactId>
+			<version>1.0.0</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.felix</groupId>
+			<artifactId>org.osgi.compendium</artifactId>
+			<version>1.0.0</version>
+		</dependency>
+	</dependencies>
+	
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.felix</groupId>
+				<artifactId>maven-bundle-plugin</artifactId>
+				<version>1.4.0</version>
+				<extensions>true</extensions>
+				<configuration>
+					<instructions>
+						<Export-Package>org.apache.felix.ipojo.handlers.event.*;
+							version="0.9.0"</Export-Package>
+						<Bundle-Name>${pom.name}</Bundle-Name>
+						<Bundle-SymbolicName> ipojo.event.admin.handler
+							</Bundle-SymbolicName>
+						<Bundle-Vendor>The Apache Software
+							Foundation</Bundle-Vendor>
+						<Include-Resource>
+							META-INF/LICENCE=LICENSE,
+							META-INF/NOTICE=NOTICE
+						</Include-Resource>
+					</instructions>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.felix</groupId>
+				<artifactId>maven-ipojo-plugin</artifactId>
+				<version>0.9.0-SNAPSHOT</version>
+				<executions>
+					<execution>
+						<goals>
+							<goal>ipojo-bundle</goal>
+						</goals>
+						<configuration>
+							<metadata>metadata.xml</metadata>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
+</project>
diff --git a/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handler/event/EventAdminSubscriberHandler.java b/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handler/event/EventAdminSubscriberHandler.java
deleted file mode 100644
index 5c090c3..0000000
--- a/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handler/event/EventAdminSubscriberHandler.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/* 
- * 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.handler.event;
-
-import java.util.ArrayList;
-import java.util.Dictionary;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ConfigurationException;
-import org.apache.felix.ipojo.InstanceManager;
-import org.apache.felix.ipojo.PrimitiveHandler;
-import org.apache.felix.ipojo.architecture.ComponentTypeDescription;
-import org.apache.felix.ipojo.architecture.PropertyDescription;
-import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.parser.MethodMetadata;
-import org.apache.felix.ipojo.parser.ParseUtils;
-import org.apache.felix.ipojo.parser.PojoMetadata;
-import org.apache.felix.ipojo.util.Callback;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.service.event.Event;
-import org.osgi.service.event.EventHandler;
-
-/** 
- * Event Subscriber Handler.
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-public class EventAdminSubscriberHandler extends PrimitiveHandler implements EventHandler {
-
-    /**
-     * Handler Namespace. 
-     */
-    public static final String NAMESPACE = "org.apache.felix.ipojo.handler.event.EventAdminSubscriberHandler";
-
-    /**
-     * Instance Manager.
-     */
-    private InstanceManager m_manager;
-
-    /**
-     * List of subscriber.
-     */
-    private List m_subEvent = new ArrayList();
-
-    /**
-     * iPOJO Properties representing all the topics.
-     */
-    private String[] m_topics;
-
-    /**
-     * Initialize the component type.
-     * @param cd : component type description to populate.
-     * @param metadata : component type metadata.
-     * @throws ConfigurationException : metadata are incorrect.
-     * @see org.apache.felix.ipojo.Handler#initializeComponentFactory(org.apache.felix.ipojo.architecture.ComponentDescription, org.apache.felix.ipojo.metadata.Element)
-     */
-    public void initializeComponentFactory(ComponentTypeDescription cd, Element metadata) throws ConfigurationException {
-        // Update the current component description
-        Dictionary dict = new Properties();
-        cd.addProperty(new PropertyDescription("event.topics", Dictionary.class.getName(), dict.toString()));
-
-        // Update the current component description
-        dict = new Properties();
-        cd.addProperty(new PropertyDescription("event.filter", Dictionary.class.getName(), dict.toString()));
-
-    }
-
-    /**
-     * Constructor. 
-     * @param metadata : component type metadata
-     * @param conf : instance configuration
-     * @throws ConfigurationException : one event subscription is not correct
-     * @see org.apache.felix.ipojo.Handler#configure(org.apache.felix.ipojo.InstanceManager, org.apache.felix.ipojo.metadata.Element, java.util.Dictionary)
-     */
-    public void configure(Element metadata, Dictionary conf) throws ConfigurationException {
-
-        // Store the component manager
-        m_manager = getInstanceManager();
-        PojoMetadata mm = getFactory().getPojoMetadata();
-
-        // Get Metadata subscribers
-        Element[] subscribers = metadata.getElements("subscriber", NAMESPACE);
-        if (subscribers != null) {
-            // then check publishers are well formed and fill the publishers'
-            // map
-            for (int i = 0; i < subscribers.length; i++) {
-                EventAdminSubscriberMetadata eventAdminSubscriberMetadata = new EventAdminSubscriberMetadata(m_manager, subscribers[i]);
-
-                if (eventAdminSubscriberMetadata.getCallbackStr() != null) {
-                    if (mm.getMethod(eventAdminSubscriberMetadata.getCallbackStr(), new String[] {Event.class.getName()}) != null) {
-                        MethodMetadata methodMetadata = mm.getMethod(eventAdminSubscriberMetadata.getCallbackStr(), new String[] {Event.class.getName()});
-                        Callback cb = new Callback(methodMetadata, m_manager);
-                        eventAdminSubscriberMetadata.setCallback(cb);
-                    } else {
-                        warn(" EVENT HANDLER SUBSCRIBERS : malformed subscriber : the method " + eventAdminSubscriberMetadata.getCallbackStr() + "(Event myEvent) is not present in the component");
-                        throw new ConfigurationException("EVENT HANDLER SUBSCRIBERS : malformed subscriber : the method " + eventAdminSubscriberMetadata.getCallbackStr() + "(Event myEvent) is not present in the component");
-                    }
-                    m_subEvent.add(eventAdminSubscriberMetadata);
-                } else {
-                    warn(" EVENT HANDLER SUBSCRIBERS : malformed subscriber !");
-                    throw new ConfigurationException("EVENT HANDLER SUBSCRIBERS : malformed subscriber !");
-                }
-            }
-        } else {
-            error(" EVENT HANDLER SUBSCRIBERS : no Suscribers detected !");
-            throw new ConfigurationException(" EVENT HANDLER SUBSCRIBERS : no Suscribers detected !");
-        }
-
-        // if well formed publishers or subscribers found
-        if (!m_subEvent.isEmpty()) {
-            // register the handler
-            info(" EVENT HANDLER SUBSCRIBERS has been configured !");
-        } else {
-            return;
-        }
-
-        // Check if the configuration has a event.topics property and update the
-        // topic if needed
-        if (conf.get("event.topics") != null) {
-            // Map <callbackName, topics>
-            Dictionary d = (Dictionary) conf.get("event.topics");
-            Enumeration e = d.keys();
-            while (e.hasMoreElements()) {
-                String myName = (String) e.nextElement(); // name
-                for (int i = 0; i < m_subEvent.size(); i++) {
-                    EventAdminSubscriberMetadata met = (EventAdminSubscriberMetadata) (m_subEvent.get(i));
-                    if (met.getName().equals(myName)) {
-                        met.setTopics((String) d.get(myName));
-                        break;
-                    }
-                }
-            }
-        }
-        // Check if the configuration has a event.filter property and update the
-        // filter if needed
-        if (conf.get("event.filter") != null) {
-            // Map <callbackName, topics>
-            Dictionary d = (Dictionary) conf.get("event.filter");
-            Enumeration e = d.keys();
-            while (e.hasMoreElements()) {
-                String myName = (String) e.nextElement(); // name
-                for (int i = 0; i < m_subEvent.size(); i++) {
-                    EventAdminSubscriberMetadata met = (EventAdminSubscriberMetadata) (m_subEvent.get(i));
-                    if (met.getName().equals(myName)) {
-                        try {
-                            met.setFilter((String) d.get(myName));
-                        } catch (InvalidSyntaxException e1) {
-                            e1.printStackTrace();
-                        }
-                        break;
-                    }
-                }
-            }
-        }
-    }
-
-    /** 
-     * Handler start method.
-     * Expose the EventHandler service. 
-     * @see org.apache.felix.ipojo.Handler#start()
-     */
-    public void start() {
-        if (!m_subEvent.isEmpty()) {
-            // build the topic to listen
-            // Topics is a merge of all required topics by subscribers
-            String topics = "";
-
-            // for all subscribers
-            for (int i = 0; i < m_subEvent.size(); i++) {
-                EventAdminSubscriberMetadata sub = (EventAdminSubscriberMetadata) m_subEvent.get(i);
-                String stopics = sub.getTopics();
-                // gets its topic
-                if (topics.length() > 0 && stopics.length() > 0) {
-                    topics += ",";
-                }
-                // concat to the main topic
-                topics += stopics;
-            }
-
-            // Put the m_topics properties to the good value
-            m_topics = ParseUtils.split(topics, ",");
-        }
-    }
-
-    /***************************************************************************************************************************************************************************************************
-     * Handler lifecycle management
-     **************************************************************************************************************************************************************************************************/
-
-    /**
-     * Handler state change method.
-     * register or unregister the EventHandler service according to the new state. 
-     * @param state : new state
-     * @see org.apache.felix.ipojo.Handler#stateChanged(int)
-     */
-    public void stateChanged(int state) {
-        if (state == InstanceManager.VALID) {
-            start();
-            return;
-        }
-        if (state == InstanceManager.INVALID) {
-            stop();
-            return;
-        }
-    }
-
-    /***************************************************************************************************************************************************************************************************
-     * OSGi EventHandler management
-     **************************************************************************************************************************************************************************************************/
-
-    /** 
-     * Receive an event.
-     * The event is dispatch to attached subscribers.
-     * @param event : the received event.
-     * @see org.osgi.service.event.EventHandler#handleEvent(org.osgi.service.event.Event)
-     */
-    public void handleEvent(Event event) {
-        // for each subscribers
-        for (int i = 0; i < m_subEvent.size(); i++) {
-            EventAdminSubscriberMetadata eventSubscriberData = (EventAdminSubscriberMetadata) m_subEvent.get(i);
-            synchronized (this) {
-                // check if the subscribers topic match
-
-                if (eventSubscriberData.matchingTopic(event.getTopic()) && event.matches(eventSubscriberData.getFilter()) && m_manager.getState() == InstanceManager.VALID) {
-                    try {
-                        Callback c = eventSubscriberData.getCallback();
-                        if (c != null) {
-                            c.call(new Object[] { event });
-                        }
-                    } catch (Exception e) {
-                        error("EVENT HANDLER SUBSCRIBERS CALLBACK error : " + eventSubscriberData.getCallbackStr() + " exception :" + e.getMessage());
-                        // stop the component :
-                        m_manager.setState(InstanceManager.INVALID);
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * The stop method of a handler.
-     * @see org.apache.felix.ipojo.Handler#stop()
-     */
-    public void stop() {
-    }
-
-}
diff --git a/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handler/event/EventAdminSubscriberMetadata.java b/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handler/event/EventAdminSubscriberMetadata.java
deleted file mode 100644
index 826f547..0000000
--- a/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handler/event/EventAdminSubscriberMetadata.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/* 
- * 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.handler.event;
-
-import org.apache.felix.ipojo.InstanceManager;
-import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.parser.ParseUtils;
-import org.apache.felix.ipojo.util.Callback;
-import org.apache.felix.ipojo.util.Logger;
-import org.osgi.framework.Filter;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.service.event.Event;
-
-/**
- * Represent an subscriber.
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-class EventAdminSubscriberMetadata {
-
-    /**
-     * Name of the callback method.
-     */
-    private String m_callbackStr;
-
-    /**
-     * Callback method.
-     */
-    private Callback m_callback;
-
-    /**
-     * Listened topics.
-     */
-    private String m_topics;
-
-    /**
-     * String form of the event filter.
-     */
-    private String m_filterStr;
-
-    /**
-     * Event filter.
-     */
-    private Filter m_filter;
-
-    /**
-     * Event object.
-     */
-    private Event m_value;
-
-    /**
-     * The name which acts as an identifier.
-     */
-    private String m_name;
-
-    /**
-     * Ths Instance Manager.
-     */
-    private InstanceManager m_instanceManager;
-
-    /**
-     * Constructor.
-     * @param instanceManager : instance manager.
-     * @param subscriber : subscriber metadata.
-     */
-    public EventAdminSubscriberMetadata(InstanceManager instanceManager, Element subscriber) {
-        this.m_callbackStr = null;
-        this.m_topics = null;
-        this.m_filterStr = "";
-        this.m_filter = null;
-        this.m_value = null;
-        this.m_name = null;
-        this.m_instanceManager = instanceManager;
-        if (checkValidity(subscriber)) {
-            try {
-                if (subscriber.containsAttribute("topics")) {
-                    this.m_topics = subscriber.getAttribute("topics");
-                }
-                this.m_callbackStr = subscriber.getAttribute("callback");
-                if (subscriber.containsAttribute("filter")) {
-                    this.m_filterStr = subscriber.getAttribute("filter");
-                } else {
-                    this.m_filterStr = "(event.topics=*)";
-                }
-                this.m_filter = instanceManager.getContext().createFilter(this.m_filterStr);
-
-                this.m_name = subscriber.getAttribute("name");
-            } catch (InvalidSyntaxException e) {
-                instanceManager.getFactory().getLogger().log(Logger.WARNING, "===> EVENT handler : " + e.getMessage());
-            }
-        }
-
-    }
-
-    /**
-     * Does the topic match with the listenned topics ?
-     * @param topic : topic to test.
-     * @return true if the given topic is a listenned topic.
-     */
-    public boolean matchingTopic(String topic) {
-        return EventUtil.matches(topic, ParseUtils.split(m_topics, ","));
-    }
-
-    /**
-     * Is the subscriber metadata valid ? This method check only the existence of a callback and a name attribute.
-     * @param subscriber : metadata.
-     * @return true if the metadata is valid.
-     */
-    private boolean checkValidity(Element subscriber) {
-        return subscriber.containsAttribute("callback") && subscriber.containsAttribute("name");
-    }
-
-    /**
-     * Get the callback method name.
-     * @return the callback method name.
-     */
-    public String getCallbackStr() {
-        return m_callbackStr;
-    }
-
-    /**
-     * Get the callback object.
-     * @return the callback object.
-     */
-    public Callback getCallback() {
-        return m_callback;
-    }
-
-    /**
-     * Set the callback object.
-     * @param c : callback.
-     */
-    public void setCallback(Callback c) {
-        this.m_callback = c;
-    }
-
-    /**
-     * Get listened topics.
-     * @return the string form of the listened topics.
-     */
-    public String getTopics() {
-        return m_topics;
-    }
-
-    public Event getValue() {
-        return m_value;
-    }
-
-    public void setValue(Event value) {
-        this.m_value = value;
-    }
-
-    public Filter getFilter() {
-        return m_filter;
-    }
-
-    public void setTopics(String top) {
-        m_topics = top;
-    }
-
-    /**
-     * Create and set the filter. The filter is create from the given argument.
-     * @param filter : the String form of the LDAP filter.
-     * @throws InvalidSyntaxException : occurs when the given filter is invalid.
-     */
-    public void setFilter(String filter) throws InvalidSyntaxException {
-        this.m_filterStr = filter;
-        this.m_filter = m_instanceManager.getContext().createFilter(this.m_filterStr);
-    }
-
-    public String getName() {
-        return m_name;
-    }
-
-    public void setName(String name) {
-        this.m_name = name;
-    }
-
-}
diff --git a/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handler/event/EventUtil.java b/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handlers/event/EventUtil.java
similarity index 82%
rename from ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handler/event/EventUtil.java
rename to ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handlers/event/EventUtil.java
index 698e8fb..85b35f7 100644
--- a/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handler/event/EventUtil.java
+++ b/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handlers/event/EventUtil.java
@@ -16,23 +16,28 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.ipojo.handler.event;
-
+package org.apache.felix.ipojo.handlers.event;
 
 /**
  * Utility methods.
+ * 
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
 public class EventUtil {
 
     /**
      * Test that the given topic match with the given topic pattern.
-     * @param topic : topic to test.
-     * @param topicPattern : topic pattern
+     * 
+     * @param topic :
+     *            topic to test.
+     * @param topicPattern :
+     *            topic pattern
      * @return true if it matches.
      */
     public static boolean matches(String topic, String topicPattern) {
-        if (topicPattern.equals("*")) { return true; }
+        if (topicPattern.equals("*")) {
+            return true;
+        }
         int star;
         if ((star = topicPattern.indexOf("*")) > 0) {
             return topic.startsWith(topicPattern.substring(0, star - 1));
@@ -43,8 +48,11 @@
 
     /**
      * Test that the given topic match with the given topic patterns.
-     * @param topic : topic to test.
-     * @param topicPatterns : topic patterns
+     * 
+     * @param topic :
+     *            topic to test.
+     * @param topicPatterns :
+     *            topic patterns
      * @return true if it matches.
      */
     public static boolean matches(String topic, String[] topicPatterns) {
diff --git a/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherHandler.java b/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherHandler.java
new file mode 100644
index 0000000..e77924d
--- /dev/null
+++ b/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherHandler.java
@@ -0,0 +1,323 @@
+/* 
+ * 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.publisher;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.felix.ipojo.ConfigurationException;
+import org.apache.felix.ipojo.InstanceManager;
+import org.apache.felix.ipojo.PrimitiveHandler;
+import org.apache.felix.ipojo.architecture.ComponentTypeDescription;
+import org.apache.felix.ipojo.architecture.PropertyDescription;
+import org.apache.felix.ipojo.metadata.Element;
+import org.apache.felix.ipojo.parser.FieldMetadata;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceEvent;
+import org.osgi.framework.ServiceListener;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.event.EventAdmin;
+
+/**
+ * Event Publisher Handler.
+ * 
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+public class EventAdminPublisherHandler extends PrimitiveHandler implements
+        ServiceListener {
+
+    /**
+     * Handler Namespace.
+     */
+    public static final String NAMESPACE = "org.apache.felix.ipojo.handlers.event.EventAdminHandler";
+
+    /**
+     * Names of instance configuration properties.
+     */
+    public static final String TOPICS_PROPERTY = "event.topics";
+
+    /**
+     * Prefix for logged messages.
+     */
+    private static final String LOG_PREFIX = "EVENT ADMIN PUBLISHER HANDLER : ";
+
+    /**
+     * The Instance Manager.
+     */
+    private InstanceManager m_manager;
+
+    /**
+     * The bundle context.
+     */
+    private BundleContext m_context;
+
+    /**
+     * The current Event Admin service reference.
+     */
+    private ServiceReference m_eaReference;
+
+    /**
+     * The current Event Admin service.
+     */
+    private EventAdmin m_ea;
+
+    /**
+     * The publishers accessible by their names.
+     */
+    private Map m_publishersByName = new Hashtable();
+
+    /**
+     * The publishers accessible by their fields.
+     */
+    private Map m_publishersByField = new Hashtable();
+
+    /**
+     * Initialize the component type.
+     * 
+     * @param cd :
+     *            component type description to populate.
+     * @param metadata :
+     *            component type metadata.
+     * @throws ConfigurationException :
+     *             metadata are incorrect.
+     * @see org.apache.felix.ipojo.Handler#initializeComponentFactory(org.apache.felix.ipojo.architecture.ComponentDescription,
+     *      org.apache.felix.ipojo.metadata.Element)
+     */
+    // @Override
+    public void initializeComponentFactory(ComponentTypeDescription cd,
+            Element metadata)
+        throws ConfigurationException {
+
+        // Update the current component description
+        Dictionary dict = new Properties();
+        cd.addProperty(new PropertyDescription(TOPICS_PROPERTY,
+                Dictionary.class.getName(), dict.toString()));
+    }
+
+    /**
+     * Constructor.
+     * 
+     * @param metadata :
+     *            component type metadata
+     * @param conf :
+     *            instance configuration
+     * @throws ConfigurationException :
+     *             one event publication is not correct
+     * @see org.apache.felix.ipojo.Handler#configure(org.apache.felix.ipojo.InstanceManager,
+     *      org.apache.felix.ipojo.metadata.Element, java.util.Dictionary)
+     */
+    // @Override
+    public void configure(Element metadata, Dictionary conf)
+        throws ConfigurationException {
+
+        // Store the component manager
+        m_manager = getInstanceManager();
+
+        // Get Metadata publishers
+        Element[] publishers = metadata.getElements("publisher", NAMESPACE);
+
+        if (publishers != null) {
+            // then check publishers are well formed and fill the publishers'
+            // map
+            for (int i = 0; i < publishers.length; i++) {
+
+                try {
+                    // Extract the publisher configuration
+                    EventAdminPublisherMetadata publisherMetadata = new EventAdminPublisherMetadata(
+                            publishers[i], conf);
+                    String name = publisherMetadata.getName();
+                    info(LOG_PREFIX + "configuring publisher " + name);
+
+                    // Create the associated Publisher
+                    Publisher publisher = new PublisherImpl(this,
+                            publisherMetadata.getTopics(), publisherMetadata
+                                    .isSynchronous(), publisherMetadata
+                                    .getDataKey(), m_manager.getInstanceName());
+
+                    // Check field existence and type
+                    String field = publisherMetadata.getField();
+                    FieldMetadata fieldMetadata = getPojoMetadata().getField(
+                            publisherMetadata.getField(),
+                            Publisher.class.getName());
+                    if (fieldMetadata == null) {
+                        throw new ConfigurationException(
+                                "Field not found in the component : "
+                                        + Publisher.class.getName() + " "
+                                        + field);
+                    }
+
+                    // Insert in the publisher tables.
+                    Object old;
+                    if ((old = m_publishersByName.put(name, publisher)) != null) {
+                        m_publishersByName.put(name, old);
+                        throw new ConfigurationException("The publisher "
+                                + name + "already exists");
+                    }
+                    if ((old = m_publishersByField.put(field, publisher)) != null) {
+                        m_publishersByField.put(field, old);
+                        m_publishersByName.remove(name);
+                        throw new ConfigurationException("The field " + field
+                                + " is already associated to a publisher");
+                    }
+
+                    // Register the callback that return the publisher
+                    // reference when the specified field is read by the
+                    // POJO.
+                    m_manager.register(fieldMetadata, this);
+
+                } catch (Exception e) {
+                    // Ignore invalid publishers
+                    warn(LOG_PREFIX
+                            + "Ignoring publisher : Error in configuration", e);
+                }
+            }
+        } else {
+            info(LOG_PREFIX + "no publisher detected !");
+        }
+    }
+
+    /**
+     * Start the handler instance. This method tries to get an initial reference
+     * of the EventAdmin service.
+     */
+    // @Override
+    public void start() {
+        info(LOG_PREFIX + "STARTING");
+
+        // Look for the EventAdmin service at startup
+        m_context = m_manager.getContext();
+        m_eaReference = m_context.getServiceReference(EventAdmin.class
+                .getName());
+        if (m_eaReference != null) {
+            m_ea = (EventAdmin) m_context.getService(m_eaReference);
+            if (m_ea != null) {
+                info(LOG_PREFIX + "EventAdmin service caught");
+            }
+        }
+
+        // Update handler validity
+        setValidity(m_ea != null);
+
+        // Register service listener for EventAdmin services
+        try {
+            m_context.addServiceListener(this, "(OBJECTCLASS="
+                    + EventAdmin.class.getName() + ")");
+        } catch (InvalidSyntaxException e) {
+            error(LOG_PREFIX + "Cannot register ServiceListener", e);
+        }
+        info(LOG_PREFIX + "STARTED");
+    }
+
+    /**
+     * Stop the handler instance. This method release the used EventAdmin
+     * service (if any).
+     */
+    // @Override
+    public void stop() {
+        info(LOG_PREFIX + "STOPPING");
+
+        // Unregister service
+        if (m_ea != null) {
+            m_ea = null;
+            m_context.ungetService(m_eaReference);
+            info(LOG_PREFIX + "EventAdmin service released");
+        }
+
+        info(LOG_PREFIX + "STOPPED");
+    }
+
+    /***************************************************************************
+     * OSGi ServiceListener callback
+     **************************************************************************/
+
+    /**
+     * Service listener callback. This method check the
+     * registration/unregistration of EventAdmin services and update the
+     * valididy of the handler.
+     * 
+     * @param event
+     *            the concerned service reference
+     */
+    // @Override
+    public void serviceChanged(ServiceEvent event) {
+        warn(LOG_PREFIX + "serviceChanged()");
+
+        if (m_eaReference == null && event.getType() == ServiceEvent.REGISTERED) {
+            // An EventAdmin service appeared and was expected
+            m_eaReference = event.getServiceReference();
+            m_ea = (EventAdmin) m_context.getService(m_eaReference);
+            info(LOG_PREFIX + "EventAdmin service caught");
+        } else if (m_eaReference != null
+                && event.getType() == ServiceEvent.UNREGISTERING
+                && m_eaReference == event.getServiceReference()) {
+            // The used EventAdmin service disappeared
+            m_ea = null;
+            m_context.ungetService(m_eaReference);
+            info(LOG_PREFIX + "EventAdmin service released");
+
+            // Find another EventAdmin service if available
+            m_eaReference = m_context.getServiceReference(EventAdmin.class
+                    .getName());
+            if (m_eaReference != null) {
+                m_ea = (EventAdmin) m_context.getService(m_eaReference);
+                info(LOG_PREFIX + "EventAdmin service caught");
+            }
+        }
+
+        // Update handler validity
+        setValidity(m_ea != null);
+    }
+
+    /**
+     * Field interceptor callback. This method is called when the component
+     * attempt to one of its Publisher field.
+     * 
+     * @param pojo
+     *            the accessed field
+     * @param fieldName
+     *            the name of the accessed field
+     * @param value
+     *            the value of the field (useless here)
+     * 
+     * @return the Publisher associated with the accessed field's name
+     */
+    // @Override
+    public Object onGet(Object pojo, String fieldName, Object value) {
+        // Retrieve the publisher associated to the given field name
+        Publisher pub = (Publisher) m_publishersByField.get(fieldName);
+        if (pub == null) {
+            error(LOG_PREFIX + "No publisher associated to the field "
+                    + fieldName);
+        }
+        return pub;
+    }
+
+    /**
+     * This method is called by managed publishers to obtain the current
+     * EventAdmin service.
+     * 
+     * @return the current EventAdmin service or {@code null} if unavailable.
+     */
+    public EventAdmin getEventAdminService() {
+        return m_ea;
+    }
+}
diff --git a/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherMetadata.java b/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherMetadata.java
new file mode 100644
index 0000000..0408abf
--- /dev/null
+++ b/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherMetadata.java
@@ -0,0 +1,225 @@
+/* 
+ * 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.publisher;
+
+import java.util.Dictionary;
+import java.util.Enumeration;
+
+import org.apache.felix.ipojo.ConfigurationException;
+import org.apache.felix.ipojo.handlers.event.subscriber.EventAdminSubscriberHandler;
+import org.apache.felix.ipojo.metadata.Element;
+import org.apache.felix.ipojo.parser.ParseUtils;
+
+/**
+ * Represent a publisher.
+ * 
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+class EventAdminPublisherMetadata {
+
+    // Names of metadata attributes
+
+    /**
+     * The name attribute in the component metadata.
+     */
+    public static final String NAME_ATTRIBUTE = "name";
+
+    /**
+     * The field attribute in the component metadata.
+     */
+    public static final String FIELD_ATTRIBUTE = "field";
+
+    /**
+     * The topics attribute in the component metadata.
+     */
+    public static final String TOPICS_ATTRIBUTE = "topics";
+
+    /**
+     * The synchronous attribute in the component metadata.
+     */
+    public static final String SYNCHRONOUS_ATTRIBUTE = "synchronous";
+
+    /**
+     * The data key attribute in the component metadata.
+     */
+    public static final String DATA_KEY_ATTRIBUTE = "data-key";
+
+    // Default values
+
+    /**
+     * The data key attribute's default value.
+     */
+    public static final String DEFAULT_DATA_KEY_VALUE = "user.data";
+
+    /**
+     * The synchronous attribute's default value.
+     */
+    public static final boolean DEFAULT_SYNCHRONOUS_VALUE = false;
+
+    /**
+     * The name which acts as an identifier.
+     */
+    private final String m_name;
+
+    /**
+     * The name of the field representing the publisher in the component.
+     */
+    private final String m_field;
+
+    /**
+     * Topics to which events are sent.
+     */
+    private final String[] m_topics;
+
+    /**
+     * Events sending mode.
+     */
+    private final boolean m_synchronous;
+
+    /**
+     * The key where user data are stored in the event dictionary.
+     */
+    private final String m_dataKey;
+
+    /**
+     * Construct a publisher from its metadata description.
+     * 
+     * @param publisher :
+     *            publisher metadata description.
+     * @param instanceConf :
+     *            the configuration of the component instance
+     * @throws ConfigurationException
+     *             if the configuration of the component or the instance is
+     *             invalid.
+     */
+    public EventAdminPublisherMetadata(Element publisher,
+            Dictionary instanceConf) throws ConfigurationException {
+
+        /**
+         * Setup required attributes
+         */
+
+        // NAME_ATTRIBUTE
+        if (publisher.containsAttribute(NAME_ATTRIBUTE)) {
+            m_name = publisher.getAttribute(NAME_ATTRIBUTE);
+        } else {
+            throw new ConfigurationException(
+                    "Missing required attribute in component configuration : "
+                            + NAME_ATTRIBUTE);
+        }
+
+        // FIELD_ATTRIBUTE
+        if (publisher.containsAttribute(FIELD_ATTRIBUTE)) {
+            m_field = publisher.getAttribute(FIELD_ATTRIBUTE);
+        } else {
+            throw new ConfigurationException(
+                    "Missing required attribute in component configuration : "
+                            + FIELD_ATTRIBUTE);
+        }
+
+        // TOPICS_ATTRIBUTE
+        String topicsString = null;
+        if (publisher.containsAttribute(TOPICS_ATTRIBUTE)) {
+            topicsString = publisher.getAttribute(TOPICS_ATTRIBUTE);
+        }
+        // Check TOPICS_PROPERTY in the instance configuration
+        Dictionary instanceTopics = (Dictionary) instanceConf
+                .get(EventAdminSubscriberHandler.TOPICS_PROPERTY);
+        if (instanceTopics != null) {
+            Enumeration e = instanceTopics.keys();
+            while (e.hasMoreElements()) {
+                String myName = (String) e.nextElement(); // name
+                if (m_name.equals(myName)) {
+                    topicsString = (String) instanceTopics.get(myName);
+                    break;
+                }
+            }
+        }
+        if (topicsString != null) {
+            m_topics = ParseUtils.split(topicsString, ",");
+        } else {
+            throw new ConfigurationException(
+                    "Missing required attribute in component or instance configuration : "
+                            + TOPICS_ATTRIBUTE);
+        }
+
+        /**
+         * Setup optional attributes
+         */
+        // SYNCHRONOUS_ATTRIBUTE
+        if (publisher.containsAttribute(SYNCHRONOUS_ATTRIBUTE)) {
+            m_synchronous = "true".equalsIgnoreCase(publisher
+                    .getAttribute(SYNCHRONOUS_ATTRIBUTE));
+        } else {
+            m_synchronous = DEFAULT_SYNCHRONOUS_VALUE;
+        }
+
+        // DATA_KEY_ATTRIBUTE
+        if (publisher.containsAttribute(DATA_KEY_ATTRIBUTE)) {
+            m_dataKey = publisher.getAttribute(DATA_KEY_ATTRIBUTE);
+        } else {
+            m_dataKey = DEFAULT_DATA_KEY_VALUE;
+        }
+    }
+
+    /**
+     * Get the name attribute of the publisher.
+     * 
+     * @return the name
+     */
+    public String getName() {
+        return m_name;
+    }
+
+    /**
+     * Get the field attribute of the publisher.
+     * 
+     * @return the field
+     */
+    public String getField() {
+        return m_field;
+    }
+
+    /**
+     * Get the topics attribute of the publisher.
+     * 
+     * @return the topics
+     */
+    public String[] getTopics() {
+        return m_topics;
+    }
+
+    /**
+     * Get the synchronous attribute of the publisher.
+     * 
+     * @return the synchronous
+     */
+    public boolean isSynchronous() {
+        return m_synchronous;
+    }
+
+    /**
+     * Get the dataKey attribute of the publisher.
+     * 
+     * @return the dataKey
+     */
+    public String getDataKey() {
+        return m_dataKey;
+    }
+}
diff --git a/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/Publisher.java b/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/Publisher.java
new file mode 100644
index 0000000..c9cdfdb
--- /dev/null
+++ b/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/Publisher.java
@@ -0,0 +1,47 @@
+/* 
+ * 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.publisher;
+
+import java.util.Dictionary;
+
+/**
+ * An Publisher is the interface between the EventAdminPublisherHandler and a
+ * component instance. The POJO can send event through the handler by calling a
+ * {@code send} method.
+ * 
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+public interface Publisher {
+
+    /**
+     * Send an event with the specified content.
+     * 
+     * @param content
+     *            the content of the event
+     */
+    void send(Dictionary content);
+
+    /**
+     * Send a data event.
+     * 
+     * @param o
+     *            the data to send
+     */
+    void sendData(Object o);
+}
diff --git a/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/PublisherImpl.java b/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/PublisherImpl.java
new file mode 100644
index 0000000..265c0a5
--- /dev/null
+++ b/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/PublisherImpl.java
@@ -0,0 +1,139 @@
+/* 
+ * 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.publisher;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import org.osgi.service.event.Event;
+
+/**
+ * The PublisherImpl class is the implementation of the Publisher object used by
+ * components to send events.
+ * 
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+public class PublisherImpl implements Publisher {
+
+    /**
+     * The key where the component instance name is stored.
+     */
+    public static final String INSTANCE_NAME_PROPERTY = "publisher.instance.name";
+
+    /**
+     * The managing handler.
+     */
+    private EventAdminPublisherHandler m_handler;
+
+    /**
+     * The topics of sent events.
+     */
+    private final String[] m_topics;
+
+    /**
+     * The sending mode of events.
+     */
+    private final boolean m_synchronous;
+
+    /**
+     * The key, in the content of the event, where user data are stored.
+     */
+    private final String m_dataKey;
+
+    /**
+     * The name of the component instance using this publisher.
+     */
+    private final String m_instanceName;
+
+    /**
+     * Construct an Publisher with given parameters.
+     * 
+     * @param handler
+     *            the handler that will manage this publisher
+     * @param topics
+     *            the topics on which events are sent
+     * @param synchronous
+     *            the sending mode of events
+     * @param dataKey
+     *            The key, in the content of the event, where user data are
+     *            stored (may be {@code null})
+     * @param instanceName
+     *            the name of the instance creating this publisher.
+     */
+    public PublisherImpl(EventAdminPublisherHandler handler, String[] topics,
+            boolean synchronous, String dataKey, String instanceName) {
+
+        // Check parameters
+        if (topics.length == 0) {
+            throw new IllegalArgumentException(
+                    "At least one topic must be specified");
+        }
+        // Test validity of each topic
+        for (int i = 0; i < topics.length; i++) {
+            try {
+                new Event(topics[i], null);
+            } catch (IllegalArgumentException e) {
+                throw new IllegalArgumentException("Malformed topic : "
+                        + e.getMessage());
+            }
+        }
+
+        // Initialize the publisher's fields
+        m_handler = handler;
+        m_topics = topics;
+        m_synchronous = synchronous;
+        m_dataKey = dataKey;
+        m_instanceName = instanceName;
+    }
+
+    /**
+     * Send an event with the specified content.
+     * 
+     * @param content
+     *            the content of the event
+     */
+    public void send(Dictionary content) {
+        // Add instance information in the event
+        content.put(INSTANCE_NAME_PROPERTY, m_instanceName);
+        // We sent the event on each topic
+        for (int i = 0; i < m_topics.length; i++) {
+            // Create an event with the given topic and content
+            Event e = new Event(m_topics[i], content);
+            // Send the event, depending on the sending mode
+            if (!m_synchronous) {
+                m_handler.getEventAdminService().postEvent(e); // Asynchronous
+            } else {
+                m_handler.getEventAdminService().sendEvent(e); // Synchronous
+            }
+        }
+    }
+
+    /**
+     * Send a data event.
+     * 
+     * @param object
+     *            the data to send
+     */
+    public void sendData(Object object) {
+        // Construct the content of the event with the given object
+        Dictionary content = new Hashtable();
+        content.put(m_dataKey, object);
+        send(content);
+    }
+}
diff --git a/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberHandler.java b/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberHandler.java
new file mode 100644
index 0000000..d9e6cdc
--- /dev/null
+++ b/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberHandler.java
@@ -0,0 +1,343 @@
+/* 
+ * 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.subscriber;
+
+import java.util.Collection;
+import java.util.Dictionary;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.apache.felix.ipojo.ConfigurationException;
+import org.apache.felix.ipojo.InstanceManager;
+import org.apache.felix.ipojo.PrimitiveHandler;
+import org.apache.felix.ipojo.architecture.ComponentTypeDescription;
+import org.apache.felix.ipojo.architecture.PropertyDescription;
+import org.apache.felix.ipojo.handlers.event.EventUtil;
+import org.apache.felix.ipojo.metadata.Element;
+import org.apache.felix.ipojo.parser.MethodMetadata;
+import org.apache.felix.ipojo.parser.PojoMetadata;
+import org.apache.felix.ipojo.util.Callback;
+import org.osgi.framework.Filter;
+import org.osgi.service.event.Event;
+import org.osgi.service.event.EventHandler;
+
+/**
+ * Event Subscriber Handler.
+ * 
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+public class EventAdminSubscriberHandler extends PrimitiveHandler implements
+        EventHandler {
+
+    /**
+     * Handler Namespace.
+     */
+    public static final String NAMESPACE = "org.apache.felix.ipojo.handlers.event.EventAdminHandler";
+
+    // Names of instance configuration properties.
+
+    /**
+     * The event's topics instance configuration property.
+     */
+    public static final String TOPICS_PROPERTY = "event.topics";
+
+    /**
+     * The event's filter instance configuration property.
+     */
+    public static final String FILTER_PROPERTY = "event.filter";
+
+    /**
+     * Prefix for logged messages.
+     */
+    private static final String LOG_PREFIX = "EVENT ADMIN SUBSCRIBER HANDLER : ";
+
+    /**
+     * Instance Manager.
+     */
+    private InstanceManager m_manager;
+
+    /**
+     * List of subscriber accessible by name.
+     */
+    private Map m_subscribersByName = new HashMap();
+
+    /**
+     * List of callbacks accessible by subscribers' names.
+     */
+    private Map m_callbacks = new Hashtable();
+
+    /**
+     * iPOJO Properties representing all the topics.
+     */
+    private String[] m_topics;
+
+    /**
+     * Initialize the component type.
+     * 
+     * @param cd :
+     *            component type description to populate.
+     * @param metadata :
+     *            component type metadata.
+     * @throws ConfigurationException :
+     *             metadata are incorrect.
+     * @see org.apache.felix.ipojo.Handler#initializeComponentFactory(org.apache.felix.ipojo.architecture.ComponentDescription,
+     *      org.apache.felix.ipojo.metadata.Element)
+     */
+    // @Override
+    public void initializeComponentFactory(ComponentTypeDescription cd,
+            Element metadata)
+        throws ConfigurationException {
+
+        // Update the current component description
+        Dictionary dict = new Properties();
+        cd.addProperty(new PropertyDescription(TOPICS_PROPERTY,
+                Dictionary.class.getName(), dict.toString()));
+        dict = new Properties();
+        cd.addProperty(new PropertyDescription(FILTER_PROPERTY,
+                Dictionary.class.getName(), dict.toString()));
+    }
+
+    /**
+     * Constructor.
+     * 
+     * @param metadata :
+     *            component type metadata
+     * @param conf :
+     *            instance configuration
+     * @throws ConfigurationException :
+     *             one event subscription is not correct
+     * @see org.apache.felix.ipojo.Handler#configure(org.apache.felix.ipojo.InstanceManager,
+     *      org.apache.felix.ipojo.metadata.Element, java.util.Dictionary)
+     */
+    // @Override
+    public void configure(Element metadata, Dictionary conf)
+        throws ConfigurationException {
+
+        // Store the component manager
+        m_manager = getInstanceManager();
+
+        // Get Metadata subscribers
+        Element[] subscribers = metadata.getElements("subscriber", NAMESPACE);
+
+        if (subscribers != null) {
+
+            // then check subscribers are well formed and fill the subscriber'
+            // map
+            for (int i = 0; i < subscribers.length; i++) {
+
+                try {
+                    // Extract the subscriber configuration
+                    EventAdminSubscriberMetadata subscriberMetadata = new EventAdminSubscriberMetadata(
+                            m_manager, subscribers[i], conf);
+                    String subscriberName = subscriberMetadata.getName();
+                    info(LOG_PREFIX + "configuring subscriber "
+                            + subscriberName);
+
+                    // Determine the callback prototype
+                    PojoMetadata pojoMetadata = getFactory().getPojoMetadata();
+                    String callbackType;
+                    if (subscriberMetadata.getDataKey() == null) {
+                        callbackType = Event.class.getName();
+                    } else {
+                        callbackType = subscriberMetadata.getDataType()
+                                .getName();
+                    }
+
+                    // Find the specified callback
+                    MethodMetadata methodMetadata = pojoMetadata.getMethod(
+                            subscriberMetadata.getCallback(),
+                            new String[] { callbackType });
+                    if (methodMetadata == null) {
+                        throw new ConfigurationException(
+                                "Unable to find callback "
+                                        + subscriberMetadata.getCallback()
+                                        + "(" + callbackType + ")");
+                    }
+                    Callback callback = new Callback(methodMetadata, m_manager);
+
+                    // Add the subscriber to the subscriber list and
+                    // register callback
+                    Object old;
+                    if ((old = m_subscribersByName.put(subscriberName,
+                            subscriberMetadata)) != null) {
+                        m_subscribersByName.put(subscriberName, old);
+                        throw new ConfigurationException("The subscriber "
+                                + subscriberName + "already exists");
+                    }
+                    m_callbacks.put(subscriberName, callback);
+
+                } catch (Exception e) {
+                    // Ignore invalid subscribers
+                    warn(LOG_PREFIX
+                            + "Ignoring subscriber : Error in configuration", e);
+                }
+            }
+        } else {
+            info(LOG_PREFIX + "no subscriber detected !");
+        }
+    }
+
+    /**
+     * Handler start method.
+     * 
+     * @see org.apache.felix.ipojo.Handler#start()
+     */
+    // @Override
+    public void start() {
+
+        Set topics = new TreeSet();
+
+        // Build the topic to listen
+        // Topics is a merge of all required topics by subscribers
+        if (!m_subscribersByName.isEmpty()) {
+            Collection subscribers = m_subscribersByName.values();
+            for (Iterator i = subscribers.iterator(); i.hasNext();) {
+                String[] subTopics = ((EventAdminSubscriberMetadata) i.next())
+                        .getTopics();
+                for (int j = 0; j < subTopics.length; j++) {
+                    topics.add(subTopics[j]);
+                }
+            }
+        }
+
+        m_topics = new String[topics.size()];
+        int i = 0;
+        for (Iterator iterator = topics.iterator(); iterator.hasNext();) {
+            String tmp = (String) iterator.next();
+            m_topics[i++] = tmp;
+        }
+    }
+
+    /**
+     * Handler stop method.
+     * 
+     * @see org.apache.felix.ipojo.Handler#stop()
+     */
+    // @Override
+    public void stop() {
+    }
+
+    /***************************************************************************
+     * OSGi EventHandler callback
+     **************************************************************************/
+
+    /**
+     * Receive an event. The event is dispatch to attached subscribers.
+     * 
+     * @param event :
+     *            the received event.
+     * @see org.osgi.service.event.EventHandler#handleEvent(org.osgi.service.event.Event)
+     */
+    public void handleEvent(Event event) {
+
+        // Retrieve the event's topic
+        String topic = event.getTopic();
+
+        // For each subscribers
+        Collection subscribers = m_subscribersByName.values();
+        for (Iterator i = subscribers.iterator(); i.hasNext();) {
+            EventAdminSubscriberMetadata subscriberMetadata = (EventAdminSubscriberMetadata) i
+                    .next();
+
+            synchronized (this) {
+                // Check if the subscriber's topic and filter match
+                Filter filter = subscriberMetadata.getFilter();
+
+                if (EventUtil.matches(topic, subscriberMetadata.getTopics())
+                        && (filter == null || event.matches(filter))) {
+
+                    String name = subscriberMetadata.getName();
+                    String dataKey = subscriberMetadata.getDataKey();
+                    Callback callback = (Callback) m_callbacks.get(name);
+                    Object callbackParam;
+
+                    try {
+                        // Depending on the subscriber type...
+                        if (dataKey == null) {
+
+                            // Generic event subscriber : pass the event to the
+                            // registered
+                            // callback
+                            callbackParam = event;
+
+                        } else {
+
+                            // Check for a data key in the event
+                            boolean dataKeyPresent = false;
+                            String[] properties = event.getPropertyNames();
+                            for (int j = 0; j < properties.length
+                                    && !dataKeyPresent; j++) {
+                                if (dataKey.equals(properties[j])) {
+                                    dataKeyPresent = true;
+                                }
+                            }
+
+                            if (dataKeyPresent) {
+                                // Data event : check type compatibility and
+                                // pass the given object to the registered
+                                // callback
+                                Object data = event.getProperty(dataKey);
+                                Class dataType = subscriberMetadata
+                                        .getDataType();
+                                Class dataClazz = data.getClass();
+                                if (dataType.isAssignableFrom(dataClazz)) {
+                                    callbackParam = data;
+                                } else {
+                                    throw new ClassCastException(
+                                            "Cannot convert "
+                                                    + dataClazz.getName()
+                                                    + " to "
+                                                    + dataType.getName());
+                                }
+
+                            } else {
+                                throw new java.lang.NoSuchFieldException(
+                                        dataKey);
+                            }
+                        }
+
+                        // Run the callback
+                        callback.call(new Object[] { callbackParam });
+
+                    } catch (ClassCastException e) {
+                        // Ignore the data event if type doesn't match
+                        warn(
+                                LOG_PREFIX
+                                        + "Ignoring data event : Bad data type",
+                                e);
+                    } catch (NoSuchFieldException e) {
+                        // Ignore events without data field for data events
+                        // subscriber
+                        warn(LOG_PREFIX + "Ignoring data event : No data", e);
+                    } catch (Exception e) {
+                        // Unexpected exception
+                        error(LOG_PREFIX
+                                + "Unexpected exception when calling callback",
+                                e);
+                    }
+                }
+            }
+        }
+    }
+}
diff --git a/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberMetadata.java b/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberMetadata.java
new file mode 100644
index 0000000..de221f4
--- /dev/null
+++ b/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberMetadata.java
@@ -0,0 +1,295 @@
+/* 
+ * 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.subscriber;
+
+import java.util.Dictionary;
+import java.util.Enumeration;
+
+import org.apache.felix.ipojo.ConfigurationException;
+import org.apache.felix.ipojo.InstanceManager;
+import org.apache.felix.ipojo.metadata.Element;
+import org.apache.felix.ipojo.parser.ParseUtils;
+import org.apache.felix.ipojo.util.Logger;
+import org.osgi.framework.Filter;
+import org.osgi.framework.InvalidSyntaxException;
+
+/**
+ * Represent an subscriber.
+ * 
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+class EventAdminSubscriberMetadata {
+
+    // Names of metadata attributes
+
+    /**
+     * The name attribute in the component metadata.
+     */
+    public static final String NAME_ATTRIBUTE = "name";
+
+    /**
+     * The callback attribute in the component metadata.
+     */
+    public static final String CALLBACK_ATTRIBUTE = "callback";
+
+    /**
+     * The topics attribute in the component metadata.
+     */
+    public static final String TOPICS_ATTRIBUTE = "topics";
+
+    /**
+     * The data key attribute in the component metadata.
+     */
+    public static final String DATA_KEY_ATTRIBUTE = "data-key";
+
+    /**
+     * The data type attribute in the component metadata.
+     */
+    public static final String DATA_TYPE_ATTRIBUTE = "data-type";
+
+    /**
+     * The filter attribute in the component metadata.
+     */
+    public static final String FILTER_ATTRIBUTE = "filter";
+
+    // Default values
+
+    /**
+     * The data type atttribute's default value.
+     */
+    public static final Class DEFAULT_DATA_TYPE_VALUE = java.lang.Object.class;
+
+    /**
+     * The name which acts as an identifier.
+     */
+    private final String m_name;
+
+    /**
+     * Name of the callback method.
+     */
+    private final String m_callback;
+
+    /**
+     * Listened topics.
+     */
+    private final String[] m_topics;
+
+    /**
+     * The key where user data are stored in the event dictionary.
+     */
+    private final String m_dataKey;
+
+    /**
+     * The type of received data.
+     */
+    private final Class m_dataType;
+
+    /**
+     * Event filter.
+     */
+    private final Filter m_filter;
+
+    /**
+     * The Instance Manager.
+     */
+    private final InstanceManager m_instanceManager;
+
+    /**
+     * Constructor.
+     * 
+     * @param instanceManager :
+     *            instance manager.
+     * @param subscriber :
+     *            subscriber metadata.
+     * @param instanceConf :
+     *            the configuration of the component instance
+     * @throws ConfigurationException
+     *             if the configuration of the component or the instance is
+     *             invalid.
+     */
+    public EventAdminSubscriberMetadata(InstanceManager instanceManager,
+            Element subscriber, Dictionary instanceConf)
+        throws ConfigurationException {
+
+        m_instanceManager = instanceManager;
+
+        /**
+         * Setup required attributes
+         */
+
+        // NAME_ATTRIBUTE
+        if (subscriber.containsAttribute(NAME_ATTRIBUTE)) {
+            m_name = subscriber.getAttribute(NAME_ATTRIBUTE);
+        } else {
+            throw new ConfigurationException(
+                    "Missing required attribute in component configuration : "
+                            + NAME_ATTRIBUTE);
+        }
+
+        // CALLBACK_ATTRIBUTE
+        if (subscriber.containsAttribute(CALLBACK_ATTRIBUTE)) {
+            m_callback = subscriber.getAttribute(CALLBACK_ATTRIBUTE);
+        } else {
+            throw new ConfigurationException(
+                    "Missing required attribute in component configuration : "
+                            + CALLBACK_ATTRIBUTE);
+        }
+
+        // TOPICS_ATTRIBUTE
+        String topicsString = null;
+        if (subscriber.containsAttribute(TOPICS_ATTRIBUTE)) {
+            topicsString = subscriber.getAttribute(TOPICS_ATTRIBUTE);
+        }
+        // Check TOPICS_PROPERTY in the instance configuration
+        Dictionary instanceTopics = (Dictionary) instanceConf
+                .get(EventAdminSubscriberHandler.TOPICS_PROPERTY);
+        if (instanceTopics != null) {
+            Enumeration e = instanceTopics.keys();
+            while (e.hasMoreElements()) {
+                String myName = (String) e.nextElement(); // name
+                if (m_name.equals(myName)) {
+                    topicsString = (String) instanceTopics.get(myName);
+                    break;
+                }
+            }
+        }
+        if (topicsString != null) {
+            m_topics = ParseUtils.split(topicsString, ",");
+        } else {
+            throw new ConfigurationException(
+                    "Missing required attribute in component or instance configuration : "
+                            + TOPICS_ATTRIBUTE);
+        }
+
+        /**
+         * Setup optional attributes
+         */
+
+        // DATA_KEY_ATTRIBUTE
+        m_dataKey = subscriber.getAttribute(DATA_KEY_ATTRIBUTE);
+        if (subscriber.containsAttribute(DATA_TYPE_ATTRIBUTE)) {
+            Class type;
+            try {
+                type = m_instanceManager.getContext().getBundle().loadClass(
+                        subscriber.getAttribute(DATA_TYPE_ATTRIBUTE));
+            } catch (ClassNotFoundException e) {
+                m_instanceManager
+                        .getFactory()
+                        .getLogger()
+                        .log(
+                                Logger.WARNING,
+                                "Ignoring data-type (using default) : Malformed attribute in metadata",
+                                e);
+                type = DEFAULT_DATA_TYPE_VALUE;
+            }
+            m_dataType = type;
+        } else {
+            m_dataType = DEFAULT_DATA_TYPE_VALUE;
+        }
+
+        // FILTER_ATTRIBUTE
+        String filterString = null;
+        if (subscriber.containsAttribute(FILTER_ATTRIBUTE)) {
+            filterString = subscriber.getAttribute(FILTER_ATTRIBUTE);
+        }
+        // Check FILTER_PROPERTY in the instance configuration
+        Dictionary instanceFilter = (Dictionary) instanceConf
+                .get(EventAdminSubscriberHandler.FILTER_PROPERTY);
+        if (instanceFilter != null) {
+            Enumeration e = instanceFilter.keys();
+            while (e.hasMoreElements()) {
+                String myName = (String) e.nextElement(); // name
+                if (m_name.equals(myName)) {
+                    filterString = (String) instanceFilter.get(myName);
+                    break;
+                }
+            }
+        }
+        Filter filter;
+        if (filterString != null) {
+            try {
+                filter = m_instanceManager.getContext().createFilter(
+                        filterString);
+            } catch (InvalidSyntaxException e) {
+                // Ignore filter if malformed
+                m_instanceManager.getFactory().getLogger().log(Logger.WARNING,
+                        "Ignoring filter : Malformed attribute in metadata", e);
+                filter = null;
+            }
+        } else {
+            filter = null;
+        }
+        m_filter = filter;
+    }
+
+    /**
+     * Get the name attribute of the subscriber.
+     * 
+     * @return the name
+     */
+    public String getName() {
+        return m_name;
+    }
+
+    /**
+     * Get the topics attribute of the subscriber.
+     * 
+     * @return the topics
+     */
+    public String[] getTopics() {
+        return m_topics;
+    }
+
+    /**
+     * Get the callback attribute of the subscriber.
+     * 
+     * @return the callback
+     */
+    public String getCallback() {
+        return m_callback;
+    }
+
+    /**
+     * Get the data key attribute of the subscriber.
+     * 
+     * @return the dataKey
+     */
+    public String getDataKey() {
+        return m_dataKey;
+    }
+
+    /**
+     * Get the data type attribute of the subscriber.
+     * 
+     * @return the dataType
+     */
+    public Class getDataType() {
+        return m_dataType;
+    }
+
+    /**
+     * Get the filter attribute of the subscriber.
+     * 
+     * @return the filter
+     */
+    public Filter getFilter() {
+        return m_filter;
+    }
+
+}
diff --git a/ipojo/event.admin.handler/src/main/resources/metadata.xml b/ipojo/event.admin.handler/src/main/resources/metadata.xml
deleted file mode 100644
index 0c11767..0000000
--- a/ipojo/event.admin.handler/src/main/resources/metadata.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<ipojo>
-<!-- Primitives handler -->
-<handler classname="org.apache.felix.ipojo.handler.event.EventAdminSubscriberHandler" name="subscriber" namespace="org.apache.felix.ipojo.handler.event.EventAdminSubscriberHandler">
-	<provides>
-		<property field="m_topics" name="event.topics" value=""/>
-	</provides>
-</handler>
-</ipojo>
\ No newline at end of file
