public function registerService($name, $service, array $params = [], $shared = TRUE) {
        if(is_callable($service)) {
            $this->services[$name] = [ "shared" => $shared, "params" => $params, "callback" => $service ];
        }
        elseif(is_object($service)) {
            $this->services[$name] = [ "shared" => $shared, "object" => $service ];
        }
        elseif(is_string($service)) {
            $this->services[$name] = [ "shared" => $shared, "params" => $params, "classname" => $service ];
        }
        else {
            throw new Exception("Failed to register service.");
        }
    }