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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> int
addListener(Class<T> type, PatternMessageListener<T> listener)
Subscribes to this topic.int
addListener(PatternStatusListener listener)
Subscribes to status changes of this topic<T> RFuture<Integer>
addListenerAsync(Class<T> type, PatternMessageListener<T> listener)
RFuture<Integer>
addListenerAsync(PatternStatusListener listener)
List<String>
getPatternNames()
Get topic channel patternsvoid
removeAllListeners()
Removes all listeners from this topicvoid
removeListener(int listenerId)
Removes the listener byid
for listening this topicvoid
removeListener(PatternMessageListener<?> listener)
Removes the listener by its instanceRFuture<Void>
removeListenerAsync(int listenerId)
-
-
-
Method Detail
-
getPatternNames
List<String> getPatternNames()
Get topic channel patterns- Returns:
- list of topic names
-
addListener
<T> int addListener(Class<T> type, PatternMessageListener<T> listener)
Subscribes to this topic.MessageListener.onMessage
is 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:
MessageListener
-
addListener
int addListener(PatternStatusListener listener)
Subscribes to status changes of this topic- Parameters:
listener
- - message listener- Returns:
- local JVM unique listener id
- See Also:
StatusListener
-
removeListener
void removeListener(int listenerId)
Removes the listener byid
for listening this topic- Parameters:
listenerId
- - id of message listener
-
removeListener
void removeListener(PatternMessageListener<?> listener)
Removes the listener by its instance- Parameters:
listener
- - listener instance
-
removeAllListeners
void removeAllListeners()
Removes all listeners from this topic
-
addListenerAsync
RFuture<Integer> addListenerAsync(PatternStatusListener listener)
-
addListenerAsync
<T> RFuture<Integer> addListenerAsync(Class<T> type, PatternMessageListener<T> listener)
-
-