M - messagepublic class RedissonPatternTopic<M> extends Object implements RPatternTopic<M>
| Modifier | Constructor and Description |
|---|---|
protected |
RedissonPatternTopic(Codec codec,
CommandExecutor commandExecutor,
String name) |
protected |
RedissonPatternTopic(CommandExecutor commandExecutor,
String name) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
acquire(AsyncSemaphore semaphore) |
int |
addListener(PatternMessageListener<M> listener)
Subscribes to this topic.
|
int |
addListener(PatternStatusListener listener)
Subscribes to status changes of this topic
|
List<String> |
getPatternNames()
Get topic channel patterns
|
void |
removeAllListeners()
Removes all listeners from this topic
|
void |
removeListener(int listenerId)
Removes the listener by
id for listening this topic |
void |
removeListener(PatternMessageListener<M> listener)
Removes the listener by its instance
|
protected RedissonPatternTopic(CommandExecutor commandExecutor, String name)
protected RedissonPatternTopic(Codec codec, CommandExecutor commandExecutor, String name)
public int addListener(PatternStatusListener listener)
RPatternTopicaddListener in interface RPatternTopic<M>listener - - message listenerStatusListenerpublic int addListener(PatternMessageListener<M> listener)
RPatternTopicMessageListener.onMessage is called when any message
is published on this topic.addListener in interface RPatternTopic<M>listener - - message listenerMessageListenerprotected void acquire(AsyncSemaphore semaphore)
public void removeListener(int listenerId)
RPatternTopicid for listening this topicremoveListener in interface RPatternTopic<M>listenerId - - id of message listenerpublic void removeAllListeners()
RPatternTopicremoveAllListeners in interface RPatternTopic<M>public void removeListener(PatternMessageListener<M> listener)
RPatternTopicremoveListener in interface RPatternTopic<M>listener - - listener instancepublic List<String> getPatternNames()
RPatternTopicgetPatternNames in interface RPatternTopic<M>Copyright © 2014–2018 The Redisson Project. All rights reserved.