我用osgi的事件机制进行bundle之前通讯。
当我这么用的时候:
Dictionary<String, Integer> dic = new Hashtable<String, Integer>();
dic.put("devID", 123456);
eventadmin.postEvent(new Event(ADD_DEV_TOPIC, dic));收消息的bundle会很慢才能收到消息。当我这么用:
List<Integer> devIDLst = new ArrayList<Integer>();
devIDLst.add(123456);
Dictionary<String, List<Integer>> dic = new Hashtable<String, List<Integer>>();
dic.put("devID", devIDLst);收消息的bundle瞬间就会收到消息。他们差别只是我用list代替了数字。
有没有大侠遇到过这个问题?
当我这么用的时候:
Dictionary<String, Integer> dic = new Hashtable<String, Integer>();
dic.put("devID", 123456);
eventadmin.postEvent(new Event(ADD_DEV_TOPIC, dic));收消息的bundle会很慢才能收到消息。当我这么用:
List<Integer> devIDLst = new ArrayList<Integer>();
devIDLst.add(123456);
Dictionary<String, List<Integer>> dic = new Hashtable<String, List<Integer>>();
dic.put("devID", devIDLst);收消息的bundle瞬间就会收到消息。他们差别只是我用list代替了数字。
有没有大侠遇到过这个问题?
解决方案 »
- 我的选择排序算法问题出在哪里?
- 字符串解析
- 在Oracle在有一BLOB类型,存放了DOC文件。
- JtoolBar上的按钮怎么统一大小?
- 没分了帮个忙!svg图片总出现“单击以激活并使用此控件”怎么解决啊
- java电子书及其他资源下载免费
- 怎么让数据库中的内容只能用软件通过ODBC来查询,而不能用查询分析器或企业管理器来查看表结构和内容。
- oracle中怎么没有boolean类型的字段?应该用什么代替?
- 很容易得问题,关于jdk环境得设置。
- 关于ajax请求spring mvc返回的json被转义的问题
- java连接SQL Server 2005报错,急啊,帮帮忙吧!
- String[] a={"a"};于String a="a";有什么区别
不知道osgi的内部事件机制到底是什么