@param string $service
@param int $priority

@return ServiceProvider
167640
public static function getServiceProvider( $service, $priority = 0 )
	{
		foreach ( array_keys( static::$serviceProviders ) as $key )
			if ( is_subclass_of( $service, $key, true ) )
			{
				foreach ( static::$serviceProviders[$key] as $provider )
					if ( $provider->getPriority() == $priority )
						return $provider;
				if ( count( static::$serviceProviders[$key] ) > 0 )
					return static::$serviceProviders[$key][0];
			}

		return null;
	}
380109
public function createProxyClassInstance($service)
    {
        $file = $this->getProxyFilename(get_class($service));
        
        if (file_exists($file)) {
            require_once $file;
        } else {
            throw new Exception\RuntimeException(
                sprintf('Proxy class for service "%s" has not been initialized', get_class($service)));
        }
        
        $proxyService = $this->getProxyClassName(get_class($service));
        return new $proxyService($service);
    }
1043607
public function addService(Service $service) {
    if (!in_array($service, $this->services, TRUE)) {
      $this->services[] = $service;
      
      if ($service instanceof \Psc\System\LoggerObject && $service->getLogger() instanceof \Psc\System\DispatchingLogger) {
        $this->getLogger()->listenTo($service->getLogger());
      }
    }
    return $this;
  }
618412
public function addProvider(PathProviderInterface $provider, $priority = 0)
    {
        $this->providers[$priority][] = $provider;
        $this->sorted                 = null;
    }
1355740
public function addMiddleware($middleware, $priority = PriorityQueue::NORMAL)
    {
        if (is_array($middleware) && isset($middleware['priority'])) {
            $priority = $middleware['priority'];
        }

        $this->getMiddlewares()->insert($middleware, $priority);

        return $this;
    }
811687
public function make($service)
    {
        $service = 'Google_Service_'.ucfirst($service);

        if (class_exists($service)) {
            $class = new \ReflectionClass($service);

            return $class->newInstance($this->client);
        }

        throw new UnknownServiceException($service);
    }
1179038
public function resolve($service)
	{
		if (!isset($this->services[$service])) {
			throw new ResolutionException("Could not resolve service '$service'");
		}

		return new Func($this->services[$service]);
	}
602093
protected function propagate($service)
    {
        // Propagate the service manager
        if ($service instanceof ServiceLocatorAwareInterface) {
            $service->setServiceLocator($this->getServiceLocator());
        }

        // Propagate the logger service
        if ($service instanceof LoggerAwareInterface) {
            $logger = null;
            if ($this instanceof TaoLoggerAwareInterface) {
                $logger = $this->getLogger();
            } else {
                if ($this->getServiceLocator()->has(LoggerService::SERVICE_ID)) {
                    $logger = $this->getServiceLocator()->get(LoggerService::SERVICE_ID);
                }
            }
            if (!is_null($logger)) {
                $service->setLogger($logger);
            }
        }

        return $service;
    }
518676
public function setPriority($priority) {
        if (!$this->isValidPriority($priority)) {
            throw new InvalidPriorityException('Priority must be on of Event::PRIORITY_*');
        }
        $this->priority = $priority;

        return $this;
    }
337321
public function priority($priority = null) {
		if ($priority === null) {
			return $this->_priority;
		}
		$this->_priority = $priority;
		return $this;
	}
907226
public function get($service)
    {
        if ($this->has($service)) {
            return $this->container[$service];
        } else {
            throw new RuntimeException(sprintf(
                'Attempted to grab non-existing service "%s"', $service
            ));
        }
    }
961896
public function addFilter(FilterInterface $filter, $priority = 0)
	{
		$this->filters->insert($filter, [-$priority, $this->serial--]);
		
		return $this;
	}
631887
public function setService($key, $service)
    {
        $this->set($key, $service);
        unset($this->instanceCache[$key]);
        return $this;
    }
852319
public function getService($service)
    {
        $service = $this->mapServiceName($service);

        if (isset($this->services[$service])) {
            return $this->services[$service];
        }

        return $this->services[$service] = $this->createService($service);
    }
367000
public function addNamespace($namespace, $priority = PriorityQueue::NORMAL)
    {
        $namespace = static::normalise($namespace);

        $this->namespaces->insert($namespace, $priority);

        return $this;
    }
1150063
public function setPriority($priority)
    {
        if (! (is_float($priority) && $priority >= 0 && $priority <= 1)) {
            throw new Exception('Priority must be >=0.0 and <=1.0');
        }

        $this->priority = number_format($priority, 1);

        return $this;
    }
827381
public function service($service,$session = null)
    {
        $this->service = (new Service($service,$session ?: $this->session));

        return $this->service;
    }