public function registerEntityManager(ApplicationInterface $application, PersistenceUnitConfigurationInterface $persistenceUnitNode)
    {

        // bind the callback for the Entity Manager instance to the naming directory
        $application->getNamingDirectory()
                    ->bind(
                        sprintf('php:global/%s/%s', $application->getUniqueName(), $lookupName = $persistenceUnitNode->getName()),
                        array(&$this, 'lookup'),
                        array($lookupName)
                    );

        // bind the Entity Manager's configuration to the naming directory
        $application->getNamingDirectory()
                    ->bind(
                        sprintf('php:global/%s/%sConfiguration', $application->getUniqueName(), $lookupName),
                        $persistenceUnitNode
                    );

        // register the entity manager's configuration in the persistence manager
        $this->addEntityManagerName($lookupName);

        // load the object manager instance
        $objectManager = $this->getApplication()->search(ObjectManagerInterface::IDENTIFIER);

        // add the descriptors, necesseary to create the Entity Manaager instance, to the object manager
        $objectManager->addObjectDescriptor(PersistenceUnitDescriptor::newDescriptorInstance()->fromConfiguration($persistenceUnitNode));
        $objectManager->addObjectDescriptor(PersistenceUnitFactoryDescriptor::newDescriptorInstance()->fromConfiguration($persistenceUnitNode));
    }