Returns elasticsearch manager by name from service container.

@param string $name Manager name defined in configuration.

@return Manager

@throws \RuntimeException If manager was not found.
421938
protected function getManager($name)
    {
        $id = $this->getManagerId($name);

        if ($this->getContainer()->has($id)) {
            return $this->getContainer()->get($id);
        }

        throw new \RuntimeException(
            sprintf(
                'Manager named `%s` not found. Available: `%s`.',
                $name,
                implode('`, `', array_keys($this->getContainer()->getParameter('es.managers')))
            )
        );
    }
216683
protected function load($name)
    {
        $template = $this->nameParser->parse($name);

        if (!$template instanceof TemplateReferenceInterface) {
            throw new \RuntimeException(sprintf('The template "%s" could not be parsed.', $name));
        }

        $key = $template->getLogicalName();
        if (isset($this->cache[$key])) {
            return $this->cache[$key];
        }

        $storage = $this->loader->load($template);

        if (!$storage instanceof Storage) {
            throw new \RuntimeException(sprintf('The template "%s" could not be loaded.', $name));
        }

        return $this->cache[$key] = $storage;
    }
288369
public function get($name)
    {
        $instance = self::getInstance();
        if (!$instance->offsetExists($name)) {
            throw new \RuntimeException(sprintf('Class %s Not Found', $name));
        }

        return $instance->offsetGet($name);
    }
862741
public function getManager($name = null)
    {
        $name = $name ?: $this->getDefaultManagerName();

        if (!$this->managerExists($name)) {
            throw new InvalidArgumentException(sprintf('Doctrine Manager named "%s" does not exist.', $name));
        }

        if (isset($this->managersMap[$name])) {
            return $this->managersMap[$name];
        }

        return $this->managersMap[$name] = $this->getService(
            $this->getManagerBindingName($this->managers[$name])
        );
    }
1045054
public static function getInstance(string $name): IPool
    {
        if(!isset(static::$pools[$name]))
        {
            throw new \RuntimeException(sprintf('GetInstance failed, %s is not found', $name));
        }
        return static::$pools[$name];
    }
267652
protected function getSubClass($name)
    {
        if ($this->hasSubClass($name)) {
            return $this->subClasses[$name];
        }

        throw new \RuntimeException(sprintf(
            'Unable to find the subclass `%s` for admin `%s`',
            $name,
            \get_class($this)
        ));
    }
547222
public function getPage($name)
    {
        if (null === $this->pageObjectFactory) {
            throw new \RuntimeException('To create pages you need to pass a factory with setPageObjectFactory()');
        }

        return $this->pageObjectFactory->createPage($name);
    }
268440
public function getFilter($name)
    {
        if (!array_key_exists($name, $this->filters)) {
            throw new \RuntimeException('There is no filter for the name "' . $name . '" registered.');
        }

        return $this->filters[$name];
    }
70051
public static function get($name, $call = true)
    {
        if (!isset(self::$services[$name])) {
            throw new \RuntimeException("The service [$name] don't register.");
        }

        $service = self::$services[$name];

        if (\is_object($service) && $service instanceof \Closure && $call) {
            if (!isset(self::$instances[$name])) {
                self::$instances[$name] = $service();
            }

            return self::$instances[$name];
        }

        return $service;
    }
833585
public function getPool($name) : CacheItemPoolInterface
    {
        if (!$this->hasPool($name)) {
            throw new RuntimeException(sprintf('Could not find cache pool with name %s.', $name));
        }

        return $this->pools->get($name);
    }
964738
public function getService($name)
    {
        if (array_key_exists($name, $this->services)) {
            return $this->services[$name];
        } elseif (isset($this->serviceProviders[$name]) && $this->serviceProviders[$name] instanceof ServiceProviderInterface) {
            $service = $this->serviceProviders[$name]->instantiate();
            if (!empty($this->serviceConfiguration[$name]['persistent'])) {
                $this->setService($name, $service);
            }
            return $service;
        } else {
            throw new Exception("Requested service {$name} is not registered");
        }
    }
390731
protected function getResourceType($name)
    {
        if (!isset($this->types[$name])) {
            $template = $this->parser->parse($name);
            if ($template instanceof TemplateReferenceInterface) {
                $this->types[$name] = $template->get('engine');
            }
        }
        if (!isset($this->types[$name])) {
            throw new \RuntimeException("Could not load the given resource.");
        }

        return $this->types[$name];
    }
374029
public function &getAttributeByName($name)
    {
        if (!isset( $this->attributes[$name] )) {
            throw new \RuntimeException( 'An attribute by the name of \'' . $name . '\' could not be located on the \'' . $this->getName() . '\' entity.' );
        }

        return $this->attributes[$name];
    }
137271
public function getProvider($name)
    {
        if (!array_key_exists($name, $this->providers)) {
            throw new RuntimeException(sprintf('Provider "%s" doesm\'t exist.', (string)$name));
        }

        return $this->providers[$name];
    }
1128638
public function getContainer($name)
    {
        // try to match one of the container names with the passed name
        /** @var \AppserverIo\Psr\ApplicationServer\Configuration\ContainerConfigurationInterface $container */
        foreach ($this->getContainers() as $container) {
            if (fnmatch($name, $container->getName())) {
                return $container;
            }
        }
    }
156855
public function get_component( $name )
    {
        if(!array_key_exists($name, $this->components))
        {
            throw new \RuntimeException("Composite sub-component not found with name $name");
        }
        return $this->components[$name];
    }
448007
public function get($name)
    {
        $item = $this->getFactory($name)->get();

        if ($item instanceof ContainerAwareInterface) {
            $item->setContainer($this);
        }

        return $item;
    }