The Event Condition is a condition that is triggered by OSGi events with a specified topic and a specified set of properties. It can be triggered by third party applications.
Overview
The Event Condition is a condition that can be triggered by third party applications.
The OSGi Event Admin provides a service for handling events. The Event Condition is a condition that is triggered by these events. For each condition instance you have to set a unique event topic that triggers it. You can also set up an additional LDAP filter that matches the properties of every event that is fired under the selected topic. Any interested application can then publish an event with that topic and properties and trigger the condition.
Managing Event Conditions
Via Java API
After creating a condition as described in Managing Conditions you can configure it by using the following methods:
When an event with this topic is received, the condition is triggered.
After you configure your condition, call the save method. The Condition Provider will save it in the Config Tree.
Via Config Tree
All conditions are stored in the Config Tree, which allows you to import/export them and to add/edit them by simply creating and modifying XML files.
The following snippet contains an Event Condition that is triggered when an event with topic org.osgi.framework.BundleEvent.STARTED is fired.
<config name="EventCondition">
<config name="EventCondition1">
<property key="topic" value="org.osgi.framework.BundleEvent.STARTED" type="string"/>
</config>
</config>