Rich UI Infobus

The Rich UI Infobus is a library that makes a publish-and-subscribe mechanism available.
The publish-and-subscribe mechanism works as follows:

Infobus functions

The following Infobus functions are in use:
  • Infobus.subscribe accepts two arguments: an event name and a reference to the function that the Infobus invokes when the event is published. The event name can include wildcard characters, as described later.
    You must code the function to be invoked. That function is based on the following Delegate part, which indicates that the function can accept whatever type of data you provide when you publish the event:
    InfoBusCallback(eventName String in, data any in) 

    Infobus.subscribe also returns a subscription value (type ANY), which you can use to unsubscribe from the event.

  • Infobus.unsubscribe accepts a single parameter; the value of type ANY returned from Infobus.subscribe. This function has no return value.
  • Infobus.publish accepts two arguments: an event name and the data that you provide. This function has no return value.

Event names and wild cards

An event name is composed of one or more tokens: character symbols such as sample and test. Each symbol is separated from the next by a dot.

You can use Infobus.subscribe to subscribe to more than one event. Two wildcard characters are available, and you can use both in the same Infobus.subscribe invocation:
  • If you use an asterisk (*) in place of a token, the function that Infobus.subscribe registered is invoked when your code publishes an event whose name matches the event name, regardless of the token that you specify in place of the asterisk. For example, if Infobus.subscribe identifies the event name as com.mycompany.update.*.new.employee, the function that Infobus.subscribe registered is invoked in response to any of the following invocations:
    InfoBus.publish("com.mycompany.update.sales.new.employee", "some data");
    
    InfoBus.publish("com.mycompany.update.marketing.new.employee", "some data");
    
    InfoBus.publish("com.mycompany.update.outreach.new.employee", "some data");
  • If you use a double asterisk (**) in place of the last token, the function that Infobus.subscribe registered is invoked when your code publishes an event whose name matches the event name, regardless of the series of tokens (and intervening dots) that you specify in place of the asterisk. For example, if Infobus.subscribe identifies the event name as com.mycompany.update.sales.**, the function that Infobus.subscribe registered is invoked in response to any of the following invocations:
    InfoBus.publish("com.mycompany.update.sales.new.employee", "some data");
    
    InfoBus.publish("com.mycompany.update.sales.temporary.employee", "some data");
    
    InfoBus.publish("com.mycompany.update.outreach.new.temporary.employee", "some data");

Additional details

The Infobus mechanism is based on an implementation of the OpenAjax alliance. For more details about Infobus:
  1. Go to the OpenAjax alliance Web site:

       http://www.openajax.org/index.php

  2. Click Wikis > Member Wiki
  3. In the Search field, type the following string: OpenAjax Hub 1.0 Specification PublishSubscribe
Note: Rich UI does not support the specification phrases that are related to filter or scope.

Feedback