Ejemplo n.º 1
0
 public static IObj lifecycleMessageToClojure(LifecycleMessage msg) {
   if (msg instanceof ExitMessage) {
     final ExitMessage m = (ExitMessage) msg;
     final IObj v = PersistentVector.create(keyword("exit"), m.watch, m.actor, m.cause);
     return v;
   } else if (msg instanceof ShutdownMessage) {
     final ShutdownMessage m = (ShutdownMessage) msg;
     final IObj v = PersistentVector.create(keyword("shutdown"), m.requester);
     return v;
   }
   throw new RuntimeException("Unknown lifecycle message: " + msg);
 }
 @Override
 public Object deserialize(JsonNode n, ObjectMapper mapper) {
   List list = new ArrayList<>();
   for (int i = 0; i < n.size(); i++) {
     try {
       list.add(parent.deserialize(n.get(i), mapper));
     } catch (Exception e) {
       Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, null, e);
     }
   }
   Collection collection = PersistentVector.create(list);
   return collection;
 }