Class LocalTopic

java.lang.Object
com.axelor.cache.caffeine.LocalTopic
All Implemented Interfaces:
AxelorTopic

public class LocalTopic extends Object implements AxelorTopic
A topic for single-instance usage
  • Constructor Details

    • LocalTopic

      public LocalTopic()
  • Method Details

    • publish

      public long publish(Object message)
      Description copied from interface: AxelorTopic
      Publishes the given message to the listeners.
      Specified by:
      publish in interface AxelorTopic
      Parameters:
      message - the message to publish
      Returns:
      the number of listeners that received the message
    • addListener

      public <M> int addListener(Class<M> type, AxelorTopic.MessageListener<? extends M> listener)
      Description copied from interface: AxelorTopic
      Subscribes a listener to messages published to this topic.
      Specified by:
      addListener in interface AxelorTopic
      Parameters:
      type - type of message
      listener - the listener to be notified
      Returns:
      the listener id, which can be used to remove the listener
    • removeListener

      public void removeListener(Integer... ids)
      Description copied from interface: AxelorTopic
      Removes the listener with the given id.
      Specified by:
      removeListener in interface AxelorTopic
      Parameters:
      ids - listener ids to remove