Interface AxelorTopic

All Known Implementing Classes:
LocalTopic, RedissonTopicAdapter

public interface AxelorTopic
Distributed topic. Messages are delivered to all message listeners.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    A listener for messages received on a AxelorTopic.
  • Method Summary

    Modifier and Type
    Method
    Description
    <M> int
    addListener(Class<M> type, AxelorTopic.MessageListener<? extends M> listener)
    Subscribes a listener to messages published to this topic.
    long
    publish(Object message)
    Publishes the given message to the listeners.
    void
    removeListener(Integer... listenerIds)
    Removes the listener with the given id.
  • Method Details

    • publish

      long publish(Object message)
      Publishes the given message to the listeners.
      Parameters:
      message - the message to publish
      Returns:
      the number of listeners that received the message
    • addListener

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

      void removeListener(Integer... listenerIds)
      Removes the listener with the given id.
      Parameters:
      listenerIds - listener ids to remove