final public function lock($namespace)
    {
        //locks a namespace in this session to prevent editing
        if (empty($namespace)) {
            //@TODO throw an exception,
            //we don't know what namespace this is
            return false;
        }
        $session = $this;
        //unlocks a namespace
        if (isset($session->registry[$namespace]) && !$session->isLocked($namespace)) {
            $session->registry[$namespace]->lock();
            return true;
        }

        return false;
    }