@Override
    public void onReceive(Object message) throws Exception {
        log.debug("message in ActorRegistry {}", message);

        if (message instanceof Register) {
            log.debug("{} added to registry", ((Register) message).actorRef.path().name());
            registry.put(((Register) message).actorRef.path().name(), ((Register) message).actorRef);
            getContext().watch(((Register) message).actorRef);
        } else if (message instanceof UnRegister) {
            log.debug("{} removed from registry", ((Register) message).actorRef.path().name());
            registry.remove(((UnRegister) message).actorRef.path().name());
            getContext().unwatch(((UnRegister) message).actorRef);
        } else if (message instanceof Terminated) {
            final Terminated t = (Terminated) message;
            log.debug("{} removed from registry", t.getActor().path().name());
            registry.remove(t.getActor().path().name());
            getContext().unwatch(t.getActor());
        } else if (message instanceof GetActorWithName) {
            log.info("Asking for {}", ((GetActorWithName) message).name);
            getSender().tell(registry.get(((GetActorWithName) message).name), getSelf());
        } else if (message instanceof CommonMessages.WhoAreYou) {
            log.debug("I am {}", getSelf().path());
            getSender().tell(getSelf().path(), getSelf());
        } else {
            unhandled(message);
        }

        printRegistry();
    }