コード例 #1
0
 /*
  * (non-Javadoc)
  *
  * @see
  * pt.consulting.grlp.container.IContainer#addGrowller(pt.consulting.grlp
  * .dao.entity.Growller)
  */
 @Override
 public void addGrowller(Growllers growller) {
   int id = growller.getId();
   String token = growller.getToken();
   synchronized (growllerMap) {
     growllerMap.put(id, token);
     log.info("addGrowller:{" + id + ":" + token + "}");
   }
 }
コード例 #2
0
 /**
  * Task to load the {@link Growllers} map structure.
  *
  * @throws Exception
  */
 private void loadGrowllerMap() {
   List<Growllers> growllerList;
   log.info(this + ":loadGrowllerMap:Init");
   try {
     growllerList = service.findAllGrowllers();
     if (null != growllerList) {
       int id;
       String token;
       synchronized (growllerMap) {
         growllerMap.clear();
         for (Growllers growller : growllerList) {
           id = growller.getId();
           token = growller.getToken();
           growllerMap.put(id, token);
           log.info("Loaded:{" + id + ":" + token + "}");
         }
       }
     }
   } catch (Exception e) {
     throw new RuntimeException("Load Growller Map fail: ", e);
   }
   log.info(this + ":loadGrowllerMap:End");
 }