缓存小案例

private Map<String, IChannel> registerChannelMap = new HashMap<String, IChannel>();

if (registerChannelMap.isEmpty()) {
      List<IChannel> channelList = messageStore.getRegisteredChannels();
       for (IChannel c : channelList) {
              registerChannelMap.put(c.getId() + "", c);
       }
}

posted @ 2019-01-10 15:10  凌风翱翔  阅读(103)  评论(0编辑  收藏  举报