Package com.axelor.cache
Interface AxelorTopic
- All Known Implementing Classes:
LocalTopic,RedissonTopicAdapter
public interface AxelorTopic
Distributed topic. Messages are delivered to all message listeners.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA listener for messages received on aAxelorTopic. -
Method Summary
Modifier and TypeMethodDescription<M> intaddListener(Class<M> type, AxelorTopic.MessageListener<? extends M> listener) Subscribes a listener to messages published to this topic.longPublishes the given message to the listeners.voidremoveListener(Integer... listenerIds) Removes the listener with the given id.
-
Method Details
-
publish
Publishes the given message to the listeners.- Parameters:
message- the message to publish- Returns:
- the number of listeners that received the message
-
addListener
Subscribes a listener to messages published to this topic.- Parameters:
type- type of messagelistener- the listener to be notified- Returns:
- the listener id, which can be used to
removethe listener
-
removeListener
Removes the listener with the given id.- Parameters:
listenerIds- listener ids to remove
-