public function setListeners(array $specs)
    {
        foreach ($specs as $spec) {
            if (!isset($spec['event']) || !isset($spec['service'])) {
                throw new \DomainException('Listener specification must be an array with the keys "event" and "service".');
            }
            $method = isset($spec['method']) ? $spec['method'] : null;
            $priority = isset($spec['priority']) ? $spec['priority'] : 0;

            $this->setListener($spec['event'], $spec['service'], $method, $priority);
        }

        return $this;
    }