public function set_identifiers(array $identifiers = array()) {
        if ($this->identifiers !== null) {
            throw new coding_exception("You can only set identifiers on initial definition creation." .
                " Define a new cache to set different identifiers.");
        }
        if (!empty($identifiers) && !empty($this->invalidationevents)) {
            throw new coding_exception("You cannot use event invalidation and identifiers at the same time.");
        }

        foreach ($this->requireidentifiers as $identifier) {
            if (!isset($identifiers[$identifier])) {
                throw new coding_exception('Identifier required for cache has not been provided: '.$identifier);
            }
        }

        $this->identifiers = array();

        foreach ($identifiers as $name => $value) {
            $this->identifiers[$name] = (string)$value;
        }
        // Reset the key prefix's they need updating now.
        $this->keyprefixsingle = null;
        $this->keyprefixmulti = null;

        return true;
    }