public function setRunningEnvironment($running_env)
    {
        $running_env = (string)$running_env;
        if (empty($running_env)) {
            $this->toss(
                "InvalidArgument",
                "The environment name cannot be empty."
            );
        }
        
        $previous = $this->running_env;
        $this->running_env = $running_env;
        if (!isset($this->callbacks[$this->running_env])) {
            $this->setCallback(
                $this->running_env,
                $this->getDefaultCallback()
            );
        }

        return $previous;
    }