@Override
	public void receive(Envelope anEnvelope) throws Exception {
		LocalMessageEnvelope local = (LocalMessageEnvelope) anEnvelope;

		Message message = local.message();

		Actor actor = local.receiverAgent().actor();

		boolean asking = local.isAsking();

		boolean stores = true;

		if (actor.wantsFilteredDelivery()) {
			Object answer = this.dispatch(actor, message, asking);

			if (asking) {
				local.senderAgent().tell(new FutureValueMessage(answer));
			}
		} else if (message instanceof Command) {
			actor.execute((Command) message);
		} else if (message instanceof Event) {
			actor.handle((Event) message);
		} else {
			if (asking) {
				stores = false; // by convention, asking does not modify the actor
				Object answer = actor.answer(message);
				local.senderAgent().tell(new FutureValueMessage(answer));
			} else {
				actor.reactTo(message);
			}
		}

		if (tracingMessages) {
			this.actorRegistry.log(message);
		}

		if (stores) {
			this.store(actor);
		}
	}