Load the source from the stream context and return the context options

@param string $name
@return array
@throws \BadMethodCallException
553726
protected function loadContext($name = null) {
		$context = parent::loadContext($name);
		if (isset($context['iterator'])) {
			$this->iterator = $context['iterator'];
		} else if (isset($context['array'])) {
			$this->iterator = new \ArrayIterator($context['array']);
		} else {
			throw new \BadMethodCallException('Invalid context, iterator or array not set');
		}
		return $context;
	}
1323925
public function get($name)
    {
        if (!isset($this->arguments[$name])) {
            throw new \OutOfBoundsException(sprintf('"%s" is not part of context.', $name));
        }

        return $this->arguments[$name];
    }
67220
public static function loadPlugin($name)
    {
        $name = ucfirst($name);
        if (($config = &self::getRef("plugins.$name")) === null) {
            $config = array();
        }
        return self::loadCustomPlugin($name, $config);
    }
1143796
public function getSourceContext($name): Source
    {
        $code = $this->getSource($name);
        $path = $this->getFilename($name);

        return new Source($code, $name, $path);
    }
984382
protected function loadTypeExtensions($name)
    {
        $typeExtensions = [];

        $extensions = $this->getExtensions();
        foreach ($extensions as $extension) {
            if ($extension->hasTypeExtensions($name)) {
                $typeExtensions = array_merge($typeExtensions, $extension->getTypeExtensions($name));
            }
        }
        $this->typeExtensions[$name] = $typeExtensions;

        return $typeExtensions;
    }
722472
public static function loadPolicyByName($name)
  {
    $list = self::getPolicyList();

    if (!isset($list[$name])) {
      $list = self::getPolicyList(TRUE);
      if (!isset($list[$name])) {
        throw new UnknownPolicyException("$name does not exist.");
      }
      throw new UnavailablePolicyException("$name requires {$list[$name]['class']} but is not available in this environment.");
    }
    $definition = $list[$name];

    try {
      return self::getSource($definition['source'])->load($definition);
    }
    catch (\InvalidArgumentException $e) {
      Container::getLogger()->warning($e->getMessage());
      throw new UnavailablePolicyException("$name requires {$list[$name]['class']} but is not available in this environment.");
    }
  }
1022037
protected function getDataSource($name)
    {
        return isset($this->dataSources[$name]) ? $this->dataSources[$name] : $this->dataSources['*'];
    }
751717
public function getContext($name)
    {
        /** @var \AppserverIo\Appserver\Core\Api\Node\ContextNode $context */
        foreach ($this->getContexts() as $context) {
            if ($context->getName() === $name) {
                return $context;
            }
        }
    }
960694
public function getSource($name): string
    {
        return $this->innerLoader->getSourceContext($this->getRealName($name))->getCode();
    }
248912
public function getSourceAdapter($name)
    {
        foreach (array_reverse($this->sourceAdapters) as $pattern => $adapter) {
            if (preg_match($pattern, $name)) {
                return $adapter;
            }
        }

        return null;
    }
898953
public function getOptionsPlugin($name = '') {
		if ($name) {
			return isset($this->options['plugin'][$name])? $this->options['plugin'][$name] : array();
		} else {
			return $this->options['plugin'];
		}
	}
551682
protected function getPossibleViewFiles(string $name): array
    {
        return array_map(function ($extension) use ($name) {
            return str_replace('.', '/', $name) . '.' . $extension;
        }, $this->extensions);
    }
1162351
public function load($source, array $options = []): Config
    {
        if (!isset($options['map'])) {
            throw new BadMethodCallException("No 'map' option specified");
        }

        $config = new Config();
        $dotkey = DotKey::on($config);

        foreach ($options['map'] as $env => $key) {
            $value = $this->getenv($env);

            if (isset($value)) {
                $dotkey->put($key, $value);
            }
        }

        return $config;
    }
970780
public function get($name = '')
	{
		// This needs to be extended by somebody else!
		if(!$this->_app->name)
			return [];

		// Not defined huh?
		if (!$this->_config)
			$this->getConfig();

		return $name ? (isset($this->_config['_'. $name]) ? $this->_config['_'. $name] : []) : $this->_config;
	}
798243
public static function getOptions(string $name): array
    {
        if (isset(self::$options) && is_array(self::$options))
            return self::$options[$name];
        return [];
    }
1246876
public function getStorageServiceKeys($name)
    {
        Validate::isString($name, 'name');
        Validate::notNullOrEmpty($name, 'name');

        $context = new HttpCallContext();
        $context->setMethod(Resources::HTTP_GET);
        $context->setPath($this->_getStorageServiceKeysPath($name));
        $context->addStatusCode(Resources::STATUS_OK);

        $response = $this->sendHttpContext($context);
        $parsed = $this->dataSerializer->unserialize($response->getBody());

        return GetStorageServiceKeysResult::create($parsed);
    }
640523
public function getHeader($name)
    {
        $headerSet = $this->getSwiftMessage()->getHeaders();
        if (!$headerSet->has($name)) {
            return [];
        }

        $headers = [];
        foreach ($headerSet->getAll($name) as $header) {
            $headers[] = $header->getValue();
        }
        return $headers;
    }