public function add_store_instance($name, $plugin, array $configuration = array()) {
        if (array_key_exists($name, $this->configstores)) {
            throw new cache_exception('Duplicate name specificed for cache plugin instance. You must provide a unique name.');
        }
        $class = 'cachestore_'.$plugin;
        if (!class_exists($class)) {
            $plugins = core_component::get_plugin_list_with_file('cachestore', 'lib.php');
            if (!array_key_exists($plugin, $plugins)) {
                throw new cache_exception('Invalid plugin name specified. The plugin does not exist or is not valid.');
            }
            $file = $plugins[$plugin];
            if (file_exists($file)) {
                require_once($file);
            }
            if (!class_exists($class)) {
                throw new cache_exception('Invalid cache plugin specified. The plugin does not contain the required class.');
            }
        }
        $reflection = new ReflectionClass($class);
        if (!$reflection->isSubclassOf('cache_store')) {
            throw new cache_exception('Invalid cache plugin specified. The plugin does not extend the required class.');
        }
        if (!$class::are_requirements_met()) {
            throw new cache_exception('Unable to add new cache plugin instance. The requested plugin type is not supported.');
        }
        $this->configstores[$name] = array(
            'name' => $name,
            'plugin' => $plugin,
            'configuration' => $configuration,
            'features' => $class::get_supported_features($configuration),
            'modes' => $class::get_supported_modes($configuration),
            'mappingsonly' => !empty($configuration['mappingsonly']),
            'class' => $class,
            'default' => false
        );
        if (array_key_exists('lock', $configuration)) {
            $this->configstores[$name]['lock'] = $configuration['lock'];
            unset($this->configstores[$name]['configuration']['lock']);
        }
        // Call instance_created()
        $store = new $class($name, $this->configstores[$name]['configuration']);
        $store->instance_created();

        $this->config_save();
        return true;
    }