public function setEventDispatcher($eventDispatcher, $eventClass)
    {
        if (!is_object($eventDispatcher) || !method_exists($eventDispatcher, 'dispatch')) {
            throw new Exception('The EventDispatcher must be an object and implement a dispatch method');
        }

        $class = new \ReflectionClass($eventClass);
        if (!$class->implementsInterface('\M6Web\Bundle\AmqpBundle\Event\DispatcherInterface')) {
            throw new Exception('The Event class : '.$eventClass.' must implement DispatcherInterface');
        }

        $this->eventDispatcher = $eventDispatcher;
        $this->eventClass = $eventClass;
    }