public function setEnabled($state = true)
    {
        $this->enabled = (bool) $state;

        if ($this->enabled) {
            try {
                $this->createNamespace();
            } catch (Exception $ex) {
                throw new RuntimeException(sprintf(
                    'Failed to enable the cache adapter of class "%s" '
                    . 'with namespace "%s".',
                    static::CLASS,
                    $this->namespace
                ), null, $ex);
            }
        }

        return $this;
    }