@Override public SubscriberNotificationEvent deserialize(final JsonParser p, final DeserializationContext ctxt) throws IOException, JsonProcessingException { final JsonNode node = p.getCodec().readTree(p); final Class<BusEvent> busEventClass; try { busEventClass = (Class<BusEvent>) Class.forName(node.get("busEventClass").textValue()); } catch (final ClassNotFoundException e) { throw new IOException(e); } return new SubscriberNotificationEvent(objectMapper.treeToValue(node.get("busEvent"), busEventClass), busEventClass); } }
public void handleEvent(final BusEvent event) { handleReadyNotification(new SubscriberNotificationEvent(event, event.getClass()), clock.getUTCNow(), event.getUserToken(), event.getSearchKey1(), event.getSearchKey2()); }