/**
* Initialize the standard publishing component (based on the
* asynchronous donut provider).
*/
m_provider = new Element("component", "");
m_provider.addAttribute(new Attribute("className",
"org.apache.felix.ipojo.handler.eventadmin.test.donut.DonutProviderImpl"));
m_provider.addAttribute(new Attribute("name",
"standard donut provider for bad tests"));
// The provided service of the publisher
Element providesDonutProvider = new Element("provides", "");
providesDonutProvider.addAttribute(new Attribute("interface",
"org.apache.felix.ipojo.handler.eventadmin.test.donut.DonutProvider"));
Element providesDonutProviderProperty = new Element("property", "");
providesDonutProviderProperty
.addAttribute(new Attribute("name", "name"));
providesDonutProviderProperty.addAttribute(new Attribute("field",
"m_name"));
providesDonutProviderProperty.addAttribute(new Attribute("value",
"Unknown donut vendor"));
providesDonutProvider.addElement(providesDonutProviderProperty);
m_provider.addElement(providesDonutProvider);
// The event publisher, corresponding to the following description :
// <ev:publisher name="donut-publisher" field="m_publisher"
// topics="food/donuts" data-key="food" synchronous="false"/>
m_publisher = new Element("publisher", NAMESPACE);
m_publisherName = new Attribute("name", "donut-publisher");
m_publisherField = new Attribute("field", "m_publisher");
m_publisherTopics = new Attribute("topics", "food/donuts");
m_publisherDataKey = new Attribute("data-key", "food");
m_publisherSynchronous = new Attribute("synchronous", "false");
m_publisher.addAttribute(m_publisherName);
m_publisher.addAttribute(m_publisherField);
m_publisher.addAttribute(m_publisherTopics);
m_publisher.addAttribute(m_publisherDataKey);
m_publisher.addAttribute(m_publisherSynchronous);
m_provider.addElement(m_publisher);
m_provider.addElement(getManipulationForComponent("donut-provider"));
/**
* Initialize the standard subscribing component (based on the donut
* consumer).
*/
m_consumer = new Element("component", "");
m_consumer.addAttribute(new Attribute("className",
"org.apache.felix.ipojo.handler.eventadmin.test.donut.DonutConsumerImpl"));
m_consumer.addAttribute(new Attribute("name",
"standard donut consumer for bad tests"));
// The provided service of the publisher
Element providesDonutConsumer = new Element("provides", "");
providesDonutConsumer.addAttribute(new Attribute("interface",
"org.apache.felix.ipojo.handler.eventadmin.test.donut.DonutConsumer"));
Element providesDonutConsumerNameProperty = new Element("property", "");
providesDonutConsumerNameProperty.addAttribute(new Attribute("name",
"name"));
providesDonutConsumerNameProperty.addAttribute(new Attribute("field",
"m_name"));
providesDonutConsumerNameProperty.addAttribute(new Attribute("value",
"Unknown donut consumer"));
providesDonutConsumer.addElement(providesDonutConsumerNameProperty);
Element providesDonutConsumerSlowProperty = new Element("property", "");
providesDonutConsumerSlowProperty.addAttribute(new Attribute("name",
"slow"));
providesDonutConsumerSlowProperty.addAttribute(new Attribute("field",
"m_isSlow"));
providesDonutConsumerSlowProperty.addAttribute(new Attribute("value",
"false"));
providesDonutConsumer.addElement(providesDonutConsumerSlowProperty);
m_consumer.addElement(providesDonutConsumer);
// The event publisher, corresponding to the following description :
// <ev:subscriber name="donut-subscriber" callback="receiveDonut"
// topics="food/donuts" data-key="food"
// data-type="org.apache.felix.ipojo.handler.eventadmin.test.donut.Donut"/>
m_subscriber = new Element("subscriber", NAMESPACE);
m_subscriberName = new Attribute("name", "donut-subscriber");
m_subscriberCallback = new Attribute("callback", "receiveDonut");
m_subscriberTopics = new Attribute("topics", "food/donuts");
m_subscriberDataKey = new Attribute("data-key", "food");
m_subscriberDataType = new Attribute("data-type",