public final void put(T item) {
   if (!state) {
     throw new RuntimeException("Putting Forbidden");
   } else {
     try {
       queue.put(item);
     } catch (InterruptedException e) {
       e.printStackTrace();
     }
   }
 }
示例#2
0
 private void handleChange(String line)
     throws IOException, InterruptedException, JsonParseException, JsonMappingException {
   changes.put(new StdDocumentChange(OBJECT_MAPPER.readTree(line)));
 }