Package org.redisson.api
Interface RPatternTopic
- All Known Implementing Classes:
RedissonPatternTopic
public interface RPatternTopic
Pattern based observer for Publish Subscribe object.
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescription<T> intaddListener(Class<T> type, PatternMessageListener<T> listener) Subscribes to this topic.intaddListener(PatternStatusListener listener) Subscribes to status changes of this topicaddListenerAsync(Class<T> type, PatternMessageListener<T> listener) addListenerAsync(PatternStatusListener listener) Returns active topic list of this patternReturns active topic list of this patternGet topic channel patternsvoidRemoves all listeners from this topicRemoves all listeners from this topicvoidremoveListener(Integer... ids) Removes the listeners byidsfor listening this topicvoidremoveListener(PatternMessageListener<?> listener) Removes the listener by its instanceremoveListenerAsync(Integer... ids) Removes the listeners byidsfor listening this topic
-
Method Details
-
getPatternNames
Get topic channel patterns- Returns:
- list of topic names
-
addListener
Subscribes to this topic.MessageListener.onMessageis called when any message is published on this topic.- Type Parameters:
T- type of message- Parameters:
type- - type of messagelistener- - message listener- Returns:
- local JVM unique listener id
- See Also:
-
addListener
Subscribes to status changes of this topic- Parameters:
listener- - message listener- Returns:
- local JVM unique listener id
- See Also:
-
removeListener
Removes the listeners byidsfor listening this topic- Parameters:
ids- listener ids
-
removeListener
Removes the listener by its instance- Parameters:
listener- - listener instance
-
removeAllListeners
void removeAllListeners()Removes all listeners from this topic -
removeAllListenersAsync
Removes all listeners from this topic- Returns:
- void
-
addListenerAsync
-
addListenerAsync
-
removeListenerAsync
Removes the listeners byidsfor listening this topic- Parameters:
ids- listener ids- Returns:
- void
-
getActiveTopicsAsync
Returns active topic list of this pattern- Returns:
- all actives channel of this pattern
-
getActiveTopics
Returns active topic list of this pattern- Returns:
- all actives topic of this pattern
-