Interface IEventBroker


public interface IEventBroker
To obtain an instance of the event broker service from the IEclipseContext context, use
 context.get(IEventBroker.class)
 
Since:
1.1
Restriction:
This interface is not intended to be implemented by clients.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The name of the default event attribute used to pass data.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    post(String topic, Object data)
    Publish event asynchronously (this method returns immediately).
    boolean
    send(String topic, Object data)
    Publish event synchronously (the method does not return until the event is processed).
    boolean
    subscribe(String topic, String filter, EventHandler eventHandler, boolean headless)
    Subscribe for events on the given topic.
    boolean
    subscribe(String topic, EventHandler eventHandler)
    Subscribe for events on the given topic.
    boolean
    unsubscribe(EventHandler eventHandler)
    Unsubscribe handler previously registered using subscribe(String, EventHandler).
  • Field Details

  • Method Details

    • send

      boolean send(String topic, Object data)
      Publish event synchronously (the method does not return until the event is processed).

      If data is a Map or a Dictionary, it is passed as is. Otherwise, a new Map is constructed and its DATA attribute is populated with this value.

      Parameters:
      topic - topic of the event to be published
      data - data to be published with the event
      Returns:
      true if this operation was performed successfully; false otherwise
    • post

      boolean post(String topic, Object data)
      Publish event asynchronously (this method returns immediately).

      If data is a Map or a Dictionary, it is passed as is. Otherwise, a new Map is constructed and its DATA attribute is populated with this value.

      Parameters:
      topic - topic of the event to be published
      data - data to be published with the event
      Returns:
      true if this operation was performed successfully; false otherwise
    • subscribe

      boolean subscribe(String topic, EventHandler eventHandler)
      Subscribe for events on the given topic.

      The handler will be called on the UI thread.

      Parameters:
      topic - topic of interest
      eventHandler - object to call when an event of interest arrives
      Returns:
      true if this operation was performed successfully; false otherwise
    • subscribe

      boolean subscribe(String topic, String filter, EventHandler eventHandler, boolean headless)
      Subscribe for events on the given topic.

      The handler will be called on the UI thread if "headless" is set to false.

      Parameters:
      topic - topic of interest
      filter - the LDAP event filter
      eventHandler - object to call when an event of interest arrives
      headless - true if handing of the events does not require UI; false otherwise
      Returns:
      true if this operation was performed successfully; false otherwise
    • unsubscribe

      boolean unsubscribe(EventHandler eventHandler)
      Unsubscribe handler previously registered using subscribe(String, EventHandler).
      Parameters:
      eventHandler - previously registered event handler
      Returns:
      true if this operation was performed successfully; false otherwise