public function getMetadata()
    {
        $cache_key = md5(serialize($this->params));
        if (!array_key_exists($cache_key, self::$metadataCache)) {
            if ($this->metadata === null) {
                self::$metadataCache[$cache_key] = $this->getDefaultMetadata();
            } else {
                self::$metadataCache[$cache_key] = $this->metadata;
            }
        }
        return self::$metadataCache[$cache_key];
    }