Exemplo n.º 1
0
 public void receive(Event event) {
   if (event.triggerType() == TriggerType.COLLECTING) {
     insertIntoRepository((CollectedEvent) event);
   } else {
     removeFromRepository(event);
   }
 }
Exemplo n.º 2
0
 private void removeFromRepository(Event event) {
   Element objectId = Element.of(event.source().id());
   if (storage.contains(objectId)) {
     storage.remove(objectId);
   }
 }