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.- Author:
- $Id: cace0c5ed2b2e0d6abdf96f4a30e24b9c1610eed $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
deliver(java.lang.Object event)
Initiate asynchronous, ordered delivery of an event.void
deliver(java.lang.String topic, java.lang.Object event)
Initiate asynchronous, ordered delivery of an event.void
deliverUntyped(java.lang.String topic, java.util.Map<java.lang.String,?> event)
Initiate asynchronous, ordered delivery of event data.
-
-
-
Method Detail
-
deliver
void deliver(java.lang.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
- The event to send to all listeners which subscribe to the topic of the event.- Throws:
java.lang.NullPointerException
- if the event object is null
-
deliver
void deliver(java.lang.String topic, java.lang.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
- The topic to which this event should be sent.event
- The event to send to all listeners which subscribe to the topic.- Throws:
java.lang.NullPointerException
- if the event object is nulljava.lang.IllegalArgumentException
- if the topic name is not valid
-
deliverUntyped
void deliverUntyped(java.lang.String topic, java.util.Map<java.lang.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
- 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:
java.lang.NullPointerException
- if the event map is nulljava.lang.IllegalArgumentException
- if the topic name is not valid
-
-