Package cn.mapway.ui.client.event
Class EventBus
- java.lang.Object
-
- cn.mapway.ui.client.event.EventBus
-
public class EventBus extends Object
简单事件总线.- Author:
- zhangjianshe
-
-
Field Summary
Fields Modifier and Type Field Description Map<String,List<IEventHandler>>eventsThe events.
-
Constructor Summary
Constructors Constructor Description EventBus()Instantiates a new event bus.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfire(String topic, int type, Object event)激发一个事件.booleanregister(String topic, IEventHandler handler)向消息总线注册消息句柄.booleanunregister(String topic, IEventHandler handler)向事件总线移除消息处理句柄.
-
-
-
Field Detail
-
events
public Map<String,List<IEventHandler>> events
The events.
-
-
Method Detail
-
register
public boolean register(String topic, IEventHandler handler)
向消息总线注册消息句柄.- Parameters:
topic- the topichandler- the handler- Returns:
- true, if successful
-
unregister
public boolean unregister(String topic, IEventHandler handler)
向事件总线移除消息处理句柄.- Parameters:
topic- the topichandler- the handler- Returns:
- true, if successful
-
-