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