Singleton
caplin.component.comms

InterComponentComms

The class has been deprecated and may be removed in future releases.
A singleton that allows a caplin.component.Component to obtain a unique communication channel identifier.

Constructor Summary

Attributes Name and Description
caplin.component.comms.InterComponentComms()

This constructor is private and must never be invoked.

Method Summary

Attributes Name and Description
void addComponentChannelListener(caplin.component.Component oComponent, caplin.component.comms.CommsChannelListener oListener)

Allows a listener to register for communication channel identifier events for a given caplin.component.Component.

void clear()

Clears all channels and listeners from the component communications hub.

void clearAllChannels()

Clears all channels, informing any listeners that the channel has been removed.

void clearAllListeners()

Removes all the listeners from the component communications hub.

String getComponentChannel(caplin.component.Component oComponent)

Returns the component channel of the given component

boolean isValidChannel(String sChannelId)

Helper method that can be used to validate a channelId before attempting to subscribe or unsubscribe from that channel.

void linkComponents(Array pComponents)

Links the given components by assigning a unique id to them

void removeComponentChannelListener(caplin.component.Component oComponent, caplin.component.comms.CommsChannelListener oCommsChannelListener)

Removes the channel listener for the given component

Constructor Detail

caplin.component.comms.InterComponentComms()

This constructor is private and must never be invoked.

Deprecated
This is deprecated now. You should use the EventHub instead of the open ajax comms.

Method Detail

void addComponentChannelListener(caplin.component.Component oComponent, caplin.component.comms.CommsChannelListener oListener)

Allows a listener to register for communication channel identifier events for a given caplin.component.Component. A channel identifier is used to group components together to allow them to communicate with each other.

Parameters
caplin.component.Component oComponent the component that the listener wishes to receive communication channel events for.
caplin.component.comms.CommsChannelListener oListener The communication channel listener

void clear()

Clears all channels and listeners from the component communications hub.

void clearAllChannels()

Clears all channels, informing any listeners that the channel has been removed.

void clearAllListeners()

Removes all the listeners from the component communications hub.

String getComponentChannel(caplin.component.Component oComponent)

Returns the component channel of the given component

Parameters
caplin.component.Component oComponent
Returns
The channel id of the channel

boolean isValidChannel(String sChannelId)

Helper method that can be used to validate a channelId before attempting to subscribe or unsubscribe from that channel.

Parameters
String sChannelId

void linkComponents(Array pComponents)

Links the given components by assigning a unique id to them

Parameters
Array pComponents An array of caplin.component.Components that should be assigned the same communication channel. If listeners have already registered for communication channel events for the given components then the component channel will be updated for that component and each listener informed of the change.

void removeComponentChannelListener(caplin.component.Component oComponent, caplin.component.comms.CommsChannelListener oCommsChannelListener)

Removes the channel listener for the given component

Parameters
caplin.component.Component oComponent The component that the listener belongs to
caplin.component.comms.CommsChannelListener oCommsChannelListener the listener to remove