public function wrapService($serviceId, $instance)
    {
        $serviceId = $this->canonicalizeName($serviceId);
        $proxy = null;
        
        if (($fqcn = $this->getCache()->getItem(self::CACHE_ID_PREFIX . $serviceId)) 
             && class_exists($fqcn) 
             && $this->getProxyAutoCreateStrategy() !== self::PROXY_AUTO_CREATE_ALWAYS) {
            
            $proxy = new $fqcn($instance);
        } else {
            $className      = get_class($instance);
            $proxyGenerator = $this->getProxyGenerator();
            $fqcn           = $proxyGenerator->getProxyClassName($className);
            $file           = $proxyGenerator->getProxyFilename($className);
            
            // Re-generate proxy class if original service class file has changed
            if ($this->getProxyAutoCreateStrategy() === self::PROXY_AUTO_CREATE_MTIME && file_exists($file)) {
                $reflection = new ReflectionClass($className);
                $instanceFile = $reflection->getFileName();
                
                if (filemtime($instanceFile) > filemtime($file)) {
                    unlink($file);
                }
            }

            if (!file_exists($file) || $this->getProxyAutoCreateStrategy() === self::PROXY_AUTO_CREATE_ALWAYS) {
                try {
                    $config = $this->getAnnotationBuilder()->getServiceSpecification($instance);
                } catch(\Exception $e) {
                    throw new AnnotationException(
                        sprintf('Unable to parse annotations for service %s (%s). Reason: %s', $serviceId, $file, $e->getMessage()));
                }
                
                $config['service_id'] = $serviceId; // Overwrite any previously configured service ID
                
                $proxyGenerator->generateProxyClass($instance, $config);
            }
            
            require_once $file;
            $proxy = new $fqcn($instance);
            
            $this->getCache()->setItem(self::CACHE_ID_PREFIX . $serviceId, $fqcn);
        }
        
        // Run initializers for the proxy class
        foreach ($this->initializers as $initializer) {
            if ($initializer instanceof InitializerInterface) {
                $initializer->initialize($proxy, $this);
            } elseif (is_object($initializer) && is_callable($initializer)) {
                $initializer($proxy, $this);
            } else {
                call_user_func($initializer, $proxy, $this);
            }
        }
        
        return $proxy;
    }