Package org.osgi.service.typedevent
Interface TypedEventBus
@ProviderType
public interface TypedEventBus
The Typed Event service. Bundles wishing to publish events must obtain
this service and call one of the event delivery methods.
- "ThreadSafe"
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Initiate asynchronous, ordered delivery of an event.void
Initiate asynchronous, ordered delivery of an event.void
deliverUntyped
(String topic, Map<String, ?> event) Initiate asynchronous, ordered delivery of event data.
-
Method Details
-
deliver
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
- The event to send to all listeners which subscribe to the topic of the event.- Throws:
NullPointerException
- if the event object is null
-
deliver
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
- The topic to which this event should be sent.event
- The event to send to all listeners which subscribe to the topic.- Throws:
NullPointerException
- if the event object is nullIllegalArgumentException
- if the topic name is not valid
-
deliverUntyped
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
- The topic to which this event should be sent.event
- A Map representation of the event data to send to all listeners which subscribe to the topic.- Throws:
NullPointerException
- if the event map is nullIllegalArgumentException
- if the topic name is not valid
-