T
- The type of the event to be received@ConsumerType public interface TypedEventHandler<T>
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 |
---|---|
void |
notify(String topic,
T event)
Called by the
TypedEventBus service to notify the listener of an
event. |
void notify(String topic, T event)
TypedEventBus
service to notify the listener of an
event.topic
- The topic to which the event was sentevent
- The event that occurred.Copyright © Contributors to the Eclipse Foundation Licensed under the Eclipse Foundation Specification License – v1.0