|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public iEvents
This interface defines methods that's used for event distribution and event management. Events service is accessible by using "this.iContext"
this.iContext.iEvents To distribute an event: this.iContext.iEvents.fireEvent("eventName");
| Method Summary | |
|---|---|
void |
fireEvent(String eventName,
String payloadType,
object payload)
This method informs the iContext to distribute an event with proper payload and payload type |
Boolean |
setEvent(IEventDescription eventDesc)
This method simply creates a new event definition or updates an existing event if the name already exists. |
Boolean |
setEvents(unknown eventDescs)
Using this method will potentially allow optimizations to occur within the iContext. |
Boolean |
removeEvent(String eventName)
This method removes an existing event description.It returns true if event is removed successfully or event doesn't exist, otherwise it returns false. |
Boolean |
removeEvents(unknown eventNames)
This method removes specified events.It returns true if all the events are removed successfully , otherwise it returns false. |
IEventDescription |
getEvents(Object condition)
The query method which takes a javascript object as condition, it returns a list of event descriptions which matches the given condition. |
IEventDescription |
createEventDescription(Object object)
This method allows to create a new IEventDescription object. |
| Method Detail |
|---|
void fireEvent(String eventName,
String payloadType,
object payload)
eventName -
name of the event that needs to be distributed.Must not be null.payloadType -
optional,type of the payload.payload -
optional,object of the payload that needs to be distributed together with the eventBoolean setEvent(IEventDescription eventDesc)
eventDesc -
IEventDescription object. Must not be null.
Boolean setEvents(unknown eventDescs)
eventDesc -
array of IEventDescription object. Must not be null.
Boolean removeEvent(String eventName)
eventName -
event name. Must not be null.
Boolean removeEvents(unknown eventNames)
eventName -
event name. Must not be null.
IEventDescription getEvents(Object condition)
condition -
JSON object that contains the condition. Must not be null.
IEventDescription createEventDescription(Object object)
var obj =
{
name:"sendData", type:"text", isHandled:"true", lang:"en", handlingFn:"onSendData",
localizedAttributes:
{
"en":
{
"title":"mytitle_en","description":"mydescription_en"},
"fr":
{
"title":"mytitle_fr","description":"mydescription_fr"}
} ,
attributes:
{
namespace:"com.ibm.mashups", onRemoveWire:"handleRemoveWire",private:"true"}
};
var event = this.iContext.iEvents.createEventDescription(obj);
this.iContext.iEvents.setEvent(event);
object -
JSON object that contains all the data to create an IEventDescription. Must not be null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||