TypedEventHandler objects are registered with the Framework service
registry and are notified with an event object when an event is sent.
TypedEventHandler objects are expected to reify the type parameter
T with the type of object they wish to receive when implementing this
interface. This type can be overridden using the
TypedEventConstants#TYPED_EVENT_TOPICS service property.
TypedEventHandler objects may be registered with a service property
TypedEventConstants#TYPED_EVENT_TOPICS whose value is the list of
topics in which the event handler is interested.
For example:
String[] topics = new String[] {
"com/isv/*"
};
Hashtable ht = new Hashtable();
ht.put(EventConstants.TYPE_SAFE_EVENT_TOPICS, topics);
context.registerService(TypedEventHandler.class, this, ht);
| Modifier and Type | Method and Description |
|---|---|
| public void | notify(String
The topic to which the event was sent topic, T The event that occurred. event)Called by the |
| notify | back to summary |
|---|---|
| public void notify(String topic, T event) Called by the
| |