我用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代替了数字。
有没有大侠遇到过这个问题?