public static function setShared($name, $definition, $locked = false)
    {
        if (isset(self::$services[$name]) && self::$services[$name]->isLocked()) {
            throw new ServiceLockedException(sprintf('Service "%s" is locked.', $name));
        }

        self::$services[$name] = new Service($name, $definition, true, $locked);
    }