Package com.axelor.cache.caffeine
Class LocalTopic
java.lang.Object
com.axelor.cache.caffeine.LocalTopic
- All Implemented Interfaces:
AxelorTopic
A topic for single-instance usage
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.axelor.cache.AxelorTopic
AxelorTopic.MessageListener<M> -
Constructor Summary
Constructors -
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... ids) Removes the listener with the given id.
-
Constructor Details
-
LocalTopic
public LocalTopic()
-
-
Method Details
-
publish
Description copied from interface:AxelorTopicPublishes the given message to the listeners.- Specified by:
publishin interfaceAxelorTopic- Parameters:
message- the message to publish- Returns:
- the number of listeners that received the message
-
addListener
Description copied from interface:AxelorTopicSubscribes a listener to messages published to this topic.- Specified by:
addListenerin interfaceAxelorTopic- Parameters:
type- type of messagelistener- the listener to be notified- Returns:
- the listener id, which can be used to
removethe listener
-
removeListener
Description copied from interface:AxelorTopicRemoves the listener with the given id.- Specified by:
removeListenerin interfaceAxelorTopic- Parameters:
ids- listener ids to remove
-