这是服务端插件配置:
EventPlugin plugin = new EventPlugin(); plugin.async(); plugin.scanPackage("com.meservice.code.listener"); plugin.setRmiServer(1888); me.add(plugin);
这是事件:
public class LoginEvent extends ApplicationEvent { private static final long serialVersionUID = 1L; public LoginEvent(Object source) { super(source); System.out.println("this's event:" + source.toString()); } }
这是监听器:
@Listener(order = 1, enableAsync = true) public class BeginLoginListener implements ApplicationListener<LoginEvent> { @Override public void onApplicationEvent(LoginEvent event) { System.out.println("this's listener"); } }
这是客户端调用:
Login login = new Login(); login.setUname("i am jackey"); Object obj = login; LoginEvent event = new LoginEvent(obj); EventKit.postRemote(event); Thread.sleep(1000);
项目运行后,console只打印出事件的响应:this's event,但监听器却没有反应,也没有报错的,请问这是什么引起的呢?
项目:JFinal-event