我正在尝试实现guava event的post和subscription方法,但似乎不起作用。订户没有被呼叫。
class A{
private final EventBus eventBus;
A(final EventBus eventBus){
this.eventBus = eventBus;
}
someMethod(){
eventBus.post(obj);
}
}
class B{
private final EventBus eventBus;
B(final EventBus eventBus){
this.eventBus = eventBus;
this.eventBus.register(this);
}
@Subscribe
public void handle(final Obj obj) {
...
}
}
但是没有调用用户端的handle方法。我想念什么?