Top Description Methods
org.osgi.service.typedevent

public Interface TypedEventBus

Annotations
@ProviderType
Imports
java.util.Map, org.osgi.annotation.versioning.ProviderType

The Typed Event service. Bundles wishing to publish events must obtain this service and call one of the event delivery methods.
Author
$Id: cace0c5ed2b2e0d6abdf96f4a30e24b9c1610eed $

Method Summary

Modifier and TypeMethod and Description
public void
deliver(Object
The event to send to all listeners which subscribe to the topic of the event.
event
)

Initiate asynchronous, ordered delivery of an event.

public void
deliver(String
The topic to which this event should be sent.
topic
,
Object
The event to send to all listeners which subscribe to the topic.
event
)

Initiate asynchronous, ordered delivery of an event.

public void
deliverUntyped(String
The topic to which this event should be sent.
topic
,
Map<String, ?>
A Map representation of the event data to send to all listeners which subscribe to the topic.
event
)

Initiate asynchronous, ordered delivery of event data.

Method Detail

deliverback to summary
public void deliver(Object event)

Initiate asynchronous, ordered delivery of an event. This method returns to the caller before delivery of the event is completed. Events are delivered in the order that they are received by this method.

The topic for this event will be automatically set to the fully qualified type name for the supplied event object.

Logically equivalent to calling deliver(event.getClass().getName().replace('.', '/'), event)

Parameters
event:Object

The event to send to all listeners which subscribe to the topic of the event.

Exceptions
NullPointerException:
if the event object is null
deliverback to summary
public void deliver(String topic, Object event)

Initiate asynchronous, ordered delivery of an event. This method returns to the caller before delivery of the event is completed. Events are delivered in the order that they are received by this method.

Parameters
topic:String

The topic to which this event should be sent.

event:Object

The event to send to all listeners which subscribe to the topic.

Exceptions
NullPointerException:
if the event object is null
IllegalArgumentException:
if the topic name is not valid
deliverUntypedback to summary
public void deliverUntyped(String topic, Map<String, ?> event)

Initiate asynchronous, ordered delivery of event data. This method returns to the caller before delivery of the event is completed. Events are delivered in the order that they are received by this method.

Parameters
topic:String

The topic to which this event should be sent.

event:Map<String, ?>

A Map representation of the event data to send to all listeners which subscribe to the topic.

Exceptions
NullPointerException:
if the event map is null
IllegalArgumentException:
if the topic name is not valid