protected function createDefinitions()
    {
        // Get all the structures we found
        $structures = $this->structureMap->getEntries();

        // We will need a CacheMap instance which we can pass to the generator
        // We need the caching configuration
        $cacheMap = new CacheMap($this->getConfig()->getValue('cache/dir'), array(), $this->getConfig());

        // We need a generator so we can create our proxies initially
        $generator = new Generator($this->structureMap, $cacheMap, $this->getConfig(), $this->getAspectRegister());

        // Iterate over all found structures and generate their proxies, but ignore the ones with omitted
        // namespaces
        $omittedNamespaces = array();
        if ($this->getConfig()->hasValue('autoloader/omit')) {
            $omittedNamespaces = $this->getConfig()->getValue('autoloader/omit');
        }

        // Now check which structures we have to create and split them up for multi-threaded creation
        $generatorStack = array();
        /** @var \AppserverIo\Doppelgaenger\Entities\Definitions\Structure $structure */
        foreach ($structures as $identifier => $structure) {
            // Working on our own files has very weird side effects, so don't do it
            if (strpos($structure->getIdentifier(), 'AppserverIo\Doppelgaenger') !== false) {
                continue;
            }

            // Might this be an omitted structure after all?
            foreach ($omittedNamespaces as $omittedNamespace) {
                // If our class name begins with the omitted part e.g. it's namespace
                if (strpos($structure->getIdentifier(), $omittedNamespace) === 0) {
                    continue 2;
                }
            }

            // adding all structures to the generator stack as we cannot assure cross references from aspects here
            $generatorStack[$identifier] = $structure;
        }

        // Chuck the stack and start generating
        $generatorStack = array_chunk($generatorStack, self::GENERATOR_STACK_COUNT, true);

        // Generate all the structures!
        $generatorThreads = array();
        foreach ($generatorStack as $key => $generatorStackChunk) {
            $generatorThreads[$key] = new GeneratorThread($generator, $generatorStackChunk);
            $generatorThreads[$key]->start();
        }

        // Wait on the threads
        foreach ($generatorThreads as $generatorThread) {
            $generatorThread->join();
        }

        // mark this instance as production ready cachewise
        $this->cacheIsReady = true;

        // Still here? Sounds about right
        return true;
    }