Package com.tick42.glue.desktop.channels
Interface ChannelContext<T>
- Type Parameters:
T- type of the context data
public interface ChannelContext<T>
Channel context.
-
Method Summary
Modifier and TypeMethodDescriptionchangeChannel(String channel) Changes the current channel of this context.channel()Returns the current name of the channel.getData()Returns a snapshot of the current channel context data, ornullif there is no current channel.Publish update to the channel context data.subscribe(ChannelContextSubscriber<T> subscriber) Subscribes the specifiedsubscriberfor channel context updates.
-
Method Details
-
channel
Returns the current name of the channel.When there is no current channel returned
Optionalis empty.- Returns:
- name of the channel
-
changeChannel
Changes the current channel of this context.- Parameters:
channel- name of the channel, usenullto leave the current channel- Returns:
- stage that is completed when channel is changed, never
null
-
getData
T getData()Returns a snapshot of the current channel context data, ornullif there is no current channel.- Returns:
- current context data or
nullif no current context
-
publish
Publish update to the channel context data.- Parameters:
update- data update- Returns:
- stage that is completed when update is published, never
null
-
subscribe
Subscribes the specifiedsubscriberfor channel context updates.- Parameters:
subscriber- subscriber that will receive updates- Returns:
- stage that is completed when subscription is done, never
null
-