Exemple #1
0
 /*
  * (non-Javadoc)
  *
  * @see org.jgroups.ReceiverAdapter#setState(java.io.InputStream)
  */
 @Override
 public void setState(InputStream input) throws Exception {
   // TODO Auto-generated method stub
   List<String> stateLine;
   stateLine = (List<String>) Util.objectFromStream(new DataInputStream(input));
   synchronized (state) {
     state.clear();
     state.addAll(stateLine);
   }
   System.out.println(stateLine.size() + "message in chat history");
   for (String str : stateLine) {
     System.out.println(str);
   }
 }
 @Override
 public void setState(InputStream istream) throws Exception {
   consistentHash = (ConsistentHash) Util.objectFromStream(new DataInputStream(istream));
 }