Class jls.util.EventBroker
This class represents an event broker.
Defined in: EventBroker.js.
Class Summary
| Constructor Attributes |
Constructor Name and Description |
| |
Creates an event broker.
|
Method Summary
| Method Attributes |
Method Name and Description |
| |
Creates a callback for a specified event name.
|
| |
Closes this event broker.
|
| |
Checks that an event exists.
|
| |
Publish a custom event.
|
| |
Subscribe to topic.
|
| |
Unsubscribe to a topic.
|
Class Detail
jls.util.EventBroker()
Creates an event broker.
Method Detail
Creates a callback for a specified event name.
- Parameters:
-
{String} name
- The name of the event.
- Returns:
- {jls.util.EventBroker} this event broker.
close()
Closes this event broker.
{Boolean}
hasSubscription(name)
Checks that an event exists.
- Parameters:
-
{String} name
- The event name to look for.
- Returns:
- {Boolean} True if a subscription exists for this event name.
Publish a custom event.
- Parameters:
-
{String} name
- The name of the event to publish.
-
{Object} message
Optional
- An optional message object associated to the publication.
- Returns:
- {jls.util.EventBroker} this event broker.
{Object}
subscribe(name, callback)
Subscribe to topic.
- Parameters:
-
{String} name
- The event name.
-
{Function} callback
- The function to associate to this event name.
- Returns:
- {Object} the handle representing the subscription in order to be used with unsubscribe.
Unsubscribe to a topic.
- Parameters:
-
{String} name
- The event name to unsubscribe to.
-
{Object} handle
Optional
- The handle associated to the subscription.
- Returns:
- {jls.util.EventBroker} this event broker.
Documentation generated by
JsDoc Toolkit 2.3.2 on Fri Feb 10 2012 22:50:34 GMT+0100 (CET)