Apply the patch provided by Mario (FELIX-2711 The event admin handler should provides a Handler Description)


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1044689 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherHandler.java b/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherHandler.java
index 2338be7..d89f6f1 100644
--- a/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherHandler.java
+++ b/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherHandler.java
@@ -29,6 +29,7 @@
 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.HandlerDescription;
 import org.apache.felix.ipojo.architecture.PropertyDescription;
 import org.apache.felix.ipojo.metadata.Element;
 import org.apache.felix.ipojo.parser.FieldMetadata;
@@ -72,6 +73,11 @@
     private Map m_publishersByField = new Hashtable();
 
     /**
+     * The handler description
+     */
+    private EventAdminPublisherHandlerDescription m_description;
+
+    /**
      * Initializes the component type.
      *
      * @param cd the component type description to populate
@@ -80,7 +86,6 @@
      * @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 {
@@ -96,7 +101,7 @@
 
         // if publisher is null, look for 'publishes' elements
         if (publishers == null  || publishers.length == 0) {
-        	publishers = metadata.getElements("publishes", NAMESPACE);
+            publishers = metadata.getElements("publishes", NAMESPACE);
         }
 
         if (publishers != null) {
@@ -152,7 +157,6 @@
      * @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 {
 
@@ -167,7 +171,7 @@
 
         // if publisher is null, look for 'publishes' elements
         if (publishers == null  || publishers.length == 0) {
-        	publishers = metadata.getElements("publishes", NAMESPACE);
+            publishers = metadata.getElements("publishes", NAMESPACE);
         }
 
         if (publishers != null) {
@@ -208,10 +212,17 @@
                         .getField(publisherMetadata.getField(),
                                 Publisher.class.getName());
                 m_manager.register(fieldMetadata, this);
+
             }
         } else {
             info(LOG_PREFIX + "No publisher to configure");
         }
+
+        setValidity(true);
+
+        debug(LOG_PREFIX+ "Setup description....");
+        m_description = new EventAdminPublisherHandlerDescription(this, m_publishersByField.values()); // Initialize the description.
+
     }
 
     /**
@@ -219,7 +230,6 @@
      *
      * This method does nothing.
      */
-    // @Override
     public void start() {
     }
 
@@ -228,7 +238,6 @@
      *
      * This method does nothing.
      */
-    // @Override
     public void stop() {
     }
 
@@ -242,7 +251,6 @@
      *
      * @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);
@@ -262,4 +270,14 @@
     public EventAdmin getEventAdminService() {
         return m_ea;
     }
+
+    /**
+     * Gets the handler description
+     * @see org.apache.felix.ipojo.Handler#getDescription()
+     */
+    public HandlerDescription getDescription() {
+        return m_description;
+    }
+
+
 }
diff --git a/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherHandlerDescription.java b/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherHandlerDescription.java
new file mode 100644
index 0000000..3069766
--- /dev/null
+++ b/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherHandlerDescription.java
@@ -0,0 +1,102 @@
+/*
+ * 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.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.felix.ipojo.Handler;
+import org.apache.felix.ipojo.architecture.HandlerDescription;
+import org.apache.felix.ipojo.metadata.Attribute;
+import org.apache.felix.ipojo.metadata.Element;
+
+/**
+ * Handler Description for Event Admin Publisher.
+ *
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+public class EventAdminPublisherHandlerDescription extends HandlerDescription {
+
+    /**
+     * The list of publishers.
+     */
+    List/*<PublisherDescription>*/ m_publishersDescriptions;
+
+    // FIXME : Add listener interface for
+    //       : onServiceArrival, onServiceDeparture, onServiceBound, onServiceUnbound
+    //       : methods.
+
+    /**
+     * Creates the {@link EventAdminPublisherHandlerDescription}.
+     * @param handler the handler
+     * @param publishers the list of publishers
+     */
+    public EventAdminPublisherHandlerDescription(Handler handler, Collection/*<Publisher>*/ publishers) {
+        super(handler);
+
+        m_publishersDescriptions = new ArrayList/*<PublisherDescription>*/();
+        if (publishers != null) {
+            Iterator iterator = publishers.iterator();
+            while (iterator.hasNext()){
+                Publisher p = (Publisher) iterator.next();
+                m_publishersDescriptions.add(new PublisherDescription(p));
+            }
+        }
+
+    }
+
+    /**
+     * Gets the publisher descriptions.
+     * @return the descriptions.
+     */
+    public PublisherDescription[] getPublisherDescriptions() {
+        return (PublisherDescription[])
+            m_publishersDescriptions.toArray(new PublisherDescription[m_publishersDescriptions.size()]);
+    }
+
+    /**
+     * Gets the handler description.
+     * @see org.apache.felix.ipojo.architecture.HandlerDescription#getHandlerInfo()
+     */
+    public Element getHandlerInfo() {
+        Element root = super.getHandlerInfo();
+        for (int i = 0; i < m_publishersDescriptions.size(); i++) {
+            PublisherDescription p = (PublisherDescription) m_publishersDescriptions.get(i);
+            Element publisher = new Element("Publisher", "");
+            publisher.addAttribute(new Attribute("name", p.getName()));
+            publisher.addAttribute(new Attribute("synchronous", String.valueOf(p.isSynchronous())));
+            publisher.addAttribute(new Attribute("data_key", p.getDataKey()));
+            Element topics = new Element("Topics", "");
+            if (p.getTopics() != null) {
+                for (int j = 0; j < p.getTopics().length; j++) {
+                    String topic = p.getTopics()[j];
+                    Element e_topic = new Element("topic","");
+                    topics.addElement(e_topic);
+                    e_topic.addAttribute(new Attribute("name",topic));
+                }
+            }
+            publisher.addElement(topics);
+            root.addElement(publisher);
+        }
+        return root;
+    }
+
+}
diff --git a/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherMetadata.java b/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherMetadata.java
index 1c210ea..224117e 100644
--- a/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherMetadata.java
+++ b/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/EventAdminPublisherMetadata.java
@@ -151,11 +151,11 @@
         if (publisher.containsAttribute(DATA_KEY_ATTRIBUTE)) {
             m_dataKey = publisher.getAttribute(DATA_KEY_ATTRIBUTE);
         } else if (publisher.containsAttribute("data_key")) {
-        	// XML Case
+            // XML Case
             m_dataKey = publisher.getAttribute("data_key");
         } else if (publisher.containsAttribute("dataKey")) {
-        	// Annotation case.
-        	m_dataKey = publisher.getAttribute("dataKey");
+            // Annotation case.
+            m_dataKey = publisher.getAttribute("dataKey");
         } else {
             m_dataKey = DEFAULT_DATA_KEY_VALUE;
         }
diff --git a/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/Publisher.java b/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/Publisher.java
index 8c79e5c..7b25196 100644
--- a/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/Publisher.java
+++ b/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/Publisher.java
@@ -1,4 +1,4 @@
-/* 
+/*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -24,22 +24,47 @@
  * 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 {
 
     /**
      * Sends an event with the specified content.
-     * 
+     *
      * @param content the content of the event
      */
     void send(Dictionary content);
 
     /**
      * Sends a data event.
-     * 
+     *
      * @param o the data to send
      */
     void sendData(Object o);
+
+    /**
+     * Gets the published topics.
+     * @return the list of topics.
+     */
+    String[] getTopics();
+
+    /**
+     * Checks is the publisher send data synchronously.
+     * @return <code>true</code> if the publisher is synchronous.
+     */
+    boolean isSynchronous();
+
+    /**
+     * Gets the data key if used.
+     * @return the data key or <code>null</code>
+     */
+    String  getDataKey();
+
+    /**
+     * Gets the publisher name if any.
+     * @return the publisher name
+     */
+    String  getName();
+
 }
diff --git a/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/PublisherDescription.java b/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/PublisherDescription.java
new file mode 100644
index 0000000..c25f37b
--- /dev/null
+++ b/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/PublisherDescription.java
@@ -0,0 +1,76 @@
+/*
+ * 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;
+
+/**
+ * Publisher Description.
+ *
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+public class PublisherDescription {
+
+    /**
+     * The described publisher
+     */
+    private Publisher m_publisher;
+
+    /**
+     * Creates a {@link PublisherDescription} based
+     * on the given {@link Publisher}
+     * @param p the publisher
+     */
+    public PublisherDescription(Publisher p) {
+        m_publisher = p;
+    }
+
+
+    /**
+     * Gets the topic list.
+     * @return the list of published topics
+     */
+    public String[] getTopics() {
+        return m_publisher.getTopics();
+    }
+
+    /**
+     * Checks if the publisher is synchronous.
+     * @return <code>true</code> if the publisher is synchronous
+     */
+    public boolean isSynchronous() {
+        return m_publisher.isSynchronous();
+    }
+
+    /**
+     * Gets the data key if used.
+     * @return the data key
+     */
+    public String getDataKey() {
+        return m_publisher.getDataKey();
+    }
+
+    /**
+     * Gets the publisher name if any.
+     * @return the publisher name
+     */
+    public String getName() {
+        return m_publisher.getName();
+    }
+
+
+}
diff --git a/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/PublisherImpl.java b/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/PublisherImpl.java
index 8a2d6c5..1cdcc89 100644
--- a/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/PublisherImpl.java
+++ b/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/publisher/PublisherImpl.java
@@ -1,4 +1,4 @@
-/* 
+/*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -26,7 +26,7 @@
 /**
  * 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 {
@@ -63,7 +63,7 @@
 
     /**
      * Constructs 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
@@ -84,7 +84,7 @@
 
     /**
      * Sends an event with the specified content.
-     * 
+     *
      * @param content the content of the event
      */
     public void send(Dictionary content) {
@@ -105,7 +105,7 @@
 
     /**
      * Sends a data event.
-     * 
+     *
      * @param object the data to send
      */
     public void sendData(Object object) {
@@ -114,4 +114,32 @@
         content.put(m_dataKey, object);
         send(content);
     }
+
+    /**
+     * @see org.apache.felix.ipojo.handlers.event.publisher.Publisher#getTopics()
+     */
+    public String[] getTopics() {
+        return m_topics;
+    }
+
+    /**
+     * @see org.apache.felix.ipojo.handlers.event.publisher.Publisher#isSynchronous()
+     */
+    public boolean isSynchronous() {
+        return m_synchronous;
+    }
+
+    /**
+     * @see org.apache.felix.ipojo.handlers.event.publisher.Publisher#getDataKey()
+     */
+    public String getDataKey() {
+        return m_dataKey;
+    }
+
+    /**
+     * @see org.apache.felix.ipojo.handlers.event.publisher.Publisher#getName()
+     */
+    public String getName() {
+        return m_instanceName;
+    }
 }
diff --git a/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberHandler.java b/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberHandler.java
index 3ce2eb5..86748b4 100644
--- a/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberHandler.java
+++ b/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberHandler.java
@@ -34,6 +34,7 @@
 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.HandlerDescription;
 import org.apache.felix.ipojo.architecture.PropertyDescription;
 import org.apache.felix.ipojo.handlers.event.EventUtil;
 import org.apache.felix.ipojo.metadata.Element;
@@ -101,6 +102,11 @@
     private boolean m_isListening;
 
     /**
+     * The handler description
+     */
+    private EventAdminSubscriberHandlerDescription m_description;
+
+    /**
      * Initializes the component type.
      *
      * @param cd component type description to populate.
@@ -109,7 +115,6 @@
      * @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 {
@@ -177,6 +182,10 @@
                 }
                 nameSet.add(name);
             }
+
+            m_description = new EventAdminSubscriberHandlerDescription(this,
+                    subscribers);
+
         } else {
             info(LOG_PREFIX + "No subscriber to check");
         }
@@ -191,7 +200,6 @@
      * @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 {
 
@@ -278,7 +286,6 @@
      *
      * @see org.apache.felix.ipojo.Handler#start()
      */
-    // @Override
     public synchronized void start() {
         m_isListening = true;
     }
@@ -288,11 +295,17 @@
      *
      * @see org.apache.felix.ipojo.Handler#stop()
      */
-    // @Override
     public synchronized void stop() {
         m_isListening = false;
     }
 
+    /**
+     * @see org.apache.felix.ipojo.Handler#getDescription()
+     */
+    public HandlerDescription getDescription() {
+        return m_description;
+    }
+
     /***************************************************************************
      * OSGi EventHandler callback
      **************************************************************************/
@@ -304,7 +317,7 @@
      * @see org.osgi.service.event.EventHandler#handleEvent(org.osgi.service.event.Event)
      */
     public void handleEvent(final Event event) {
-    	EventAdminSubscriberMetadata subscriberMetadata = null;
+        EventAdminSubscriberMetadata subscriberMetadata = null;
         // Retrieve the event's topic
         String topic = event.getTopic();
 
@@ -320,8 +333,8 @@
             Callback callback = null;
 
             synchronized (this) {
-            	isListening = m_isListening;
-			}
+                isListening = m_isListening;
+            }
 
             // Check if the subscriber's topic and filter match
             Filter filter = subscriberMetadata.getFilter();
@@ -335,7 +348,7 @@
                 try {
                     // Depending on the subscriber type...
                     callbackParam = getCallbackParameter(event,
-							subscriberMetadata);
+                            subscriberMetadata);
                 } catch (ClassCastException e) {
                     // Ignore the data event if type doesn't match
                     warn(LOG_PREFIX + "Ignoring data event : Bad data type", e);
@@ -351,65 +364,65 @@
             // NullPointerExceptions)
             if (isListening  && callback != null  && callbackParam != null) {
                 try {
-					callback.call(new Object[] { callbackParam });
-				} catch (InvocationTargetException e) {
-					error(LOG_PREFIX
+                    callback.call(new Object[] { callbackParam });
+                } catch (InvocationTargetException e) {
+                    error(LOG_PREFIX
                             + "The callback has thrown an exception",
                             e.getTargetException());
-				} catch (Exception e) {
-					error(LOG_PREFIX
+                } catch (Exception e) {
+                    error(LOG_PREFIX
                             + "Unexpected exception when calling callback",
                             e);
-				}
+                }
             }
 
         }
     }
 
-	/**
-	 * Computes the callback parameter.
-	 * @param event the event
-	 * @param subscriberMetadata the subscribe metadata
-	 * @param dataKey the data key
-	 * @return the parameter of the callback
-	 * @throws ClassCastException the data class does not match the found value.
-	 * @throws NoSuchFieldException the datakey is not present in the event.
-	 */
-	private Object getCallbackParameter(final Event event,
-			final EventAdminSubscriberMetadata subscriberMetadata
-			) throws ClassCastException,NoSuchFieldException {
-		String dataKey = subscriberMetadata.getDataKey();
-		if (dataKey == null) {
-		    // Generic event subscriber : pass the event to the
-		    // registered callback
-		    return 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;
-		        }
-		    }
+    /**
+     * Computes the callback parameter.
+     * @param event the event
+     * @param subscriberMetadata the subscribe metadata
+     * @param dataKey the data key
+     * @return the parameter of the callback
+     * @throws ClassCastException the data class does not match the found value.
+     * @throws NoSuchFieldException the datakey is not present in the event.
+     */
+    private Object getCallbackParameter(final Event event,
+            final EventAdminSubscriberMetadata subscriberMetadata
+            ) throws ClassCastException,NoSuchFieldException {
+        String dataKey = subscriberMetadata.getDataKey();
+        if (dataKey == null) {
+            // Generic event subscriber : pass the event to the
+            // registered callback
+            return 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)) {
-		            return data;
-		        } else {
-		            throw new ClassCastException("Cannot convert " + dataClazz.getName() + " to "
-		                            + dataType.getName());
-		        }
-		    } else {
-		        throw new java.lang.NoSuchFieldException(dataKey);
-		    }
+            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)) {
+                    return data;
+                } else {
+                    throw new ClassCastException("Cannot convert " + dataClazz.getName() + " to "
+                                    + dataType.getName());
+                }
+            } else {
+                throw new java.lang.NoSuchFieldException(dataKey);
+            }
 
-		}
-	}
+        }
+    }
 }
diff --git a/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberHandlerDescription.java b/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberHandlerDescription.java
new file mode 100644
index 0000000..1f9e41f
--- /dev/null
+++ b/ipojo/handler/eventadmin/src/main/java/org/apache/felix/ipojo/handlers/event/subscriber/EventAdminSubscriberHandlerDescription.java
@@ -0,0 +1,61 @@
+/*
+ * 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 org.apache.felix.ipojo.Handler;
+import org.apache.felix.ipojo.architecture.HandlerDescription;
+import org.apache.felix.ipojo.metadata.Element;
+
+/**
+ * Event Admin Subscriber Handler Description.
+ *
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+public class EventAdminSubscriberHandlerDescription extends HandlerDescription {
+
+    /**
+     * List of subscribers.
+     */
+    private Element[] m_subscribersDescriptions;
+
+    /**
+     * Creates a {@link EventAdminSubscriberHandlerDescription}
+     * @param handler the handler
+     * @param subscribers the subscribers
+     */
+    public EventAdminSubscriberHandlerDescription(Handler handler, Element[] subscribers) {
+        super(handler);
+         m_subscribersDescriptions = subscribers;
+    }
+
+    /**
+     * Gets the handler info.
+     * @see org.apache.felix.ipojo.architecture.HandlerDescription#getHandlerInfo()
+     */
+    public Element getHandlerInfo() {
+        Element root = super.getHandlerInfo();
+        if (m_subscribersDescriptions != null) {
+            for (int i = 0; i < m_subscribersDescriptions.length; i++) {
+                Element description = m_subscribersDescriptions[i];
+                root.addElement(description);
+            }
+        }
+        return root;
+    }
+}