/**
  * @param CommandMessage  $message
  * @param MiddlewareChain $chain
  * @return CommandMessage
  */
 public function handle(CommandMessage $message, MiddlewareChain $chain)
 {
     $handler = $this->resolver->locate($message);
     $handler->handle($message);
     return $chain->proceed($message);
 }
 /**
  * @param CommandMessage $message
  * @return void
  */
 public function dispatch(CommandMessage $message)
 {
     $handler = $this->locator->locate($message);
     $handler->handle($message);
 }