public class TopicRouterPatterned<C,R> extends Object implements TopicRouter<C,R>
| Modifier and Type | Field and Description |
|---|---|
protected ReentrantLock |
ROUTING_LIST_LOCK |
| Constructor and Description |
|---|
TopicRouterPatterned(RoutingFactory<C,R> routerFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(String topic,
int index,
TopicListener<Payload<C,R>> listener)
添加监听
|
List<TopicListenerHolder<C,R>> |
matching(String topic)
路由匹配
|
void |
remove(String topic)
移除监听
|
void |
remove(String topic,
TopicListener<Payload<C,R>> listener)
移除监听
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcountprotected final ReentrantLock ROUTING_LIST_LOCK
public TopicRouterPatterned(RoutingFactory<C,R> routerFactory)
public void add(String topic, int index, TopicListener<Payload<C,R>> listener)
add in interface TopicRouter<C,R>topic - 主题index - 顺序位listener - 监听器public void remove(String topic, TopicListener<Payload<C,R>> listener)
remove in interface TopicRouter<C,R>topic - 主题listener - 监听器public void remove(String topic)
remove in interface TopicRouter<C,R>topic - 主题public List<TopicListenerHolder<C,R>> matching(String topic)
matching in interface TopicRouter<C,R>Copyright © 2025. All rights reserved.