Top Description Methods
org.osgi.service.typedevent

public Interface TypedEventHandler<T>

Annotations
@ConsumerType
Type Parameters
<T>
The type of the event to be received
Imports
org.osgi.annotation.versioning.ConsumerType

Listener for Typed Events.

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);
Author
$Id: 1ef1b856280d23975dcb3d2d2c5046eb82cdb6fc $

Method Summary

Modifier and TypeMethod and Description
public void
notify(String
The topic to which the event was sent
topic
,
T
The event that occurred.
event
)

Called by the TypedEventBus service to notify the listener of an event.

Method Detail

notifyback to summary
public void notify(String topic, T event)

Called by the TypedEventBus service to notify the listener of an event.

Parameters
topic:String

The topic to which the event was sent

event:T

The event that occurred.