public function generate(DescriptorInterface $descriptor)
    {

        // start generating the proxy
        ob_start();
        require __DIR__ . DIRECTORY_SEPARATOR . 'Proxy' . DIRECTORY_SEPARATOR . 'RemoteProxy.dhtml';
        $content = ob_get_clean();

        // prepare the proxy's filename
        $filename = sprintf('%s/%s', $this->getApplication()->getCacheDir(), $this->generateRemoteProxyFilename($descriptor));

        // query whether or not proxy's directory has to be created
        if (!is_dir($directory = dirname($filename))) {
            FileSystem::createDirectory($directory, 0755, true);
        }

        // write the proxy to the filesystem
        file_put_contents($filename, $content);

        // load the application instance
        $application = $this->getApplication();

        // register the proxy in the naming directory
        $application->getNamingDirectory()
                    ->bind(
                        sprintf('php:global/%s/%s/proxy', $application->getUniqueName(), $descriptor->getName()),
                        sprintf('%sRemoteProxy', $descriptor->getClassName())
                    );
    }