AppserverIo\Appserver\PersistenceContainer\DependencyInjection\DeploymentDescriptorParser::processConfigurationNode PHP Method

processConfigurationNode() protected method

Creates a new descriptor instance from the data of the passed configuration node and add's it to the object manager.
protected processConfigurationNode ( AppserverIo\Configuration\Interfaces\NodeInterface $node ) : void
$node AppserverIo\Configuration\Interfaces\NodeInterface The node to process
return void
    protected function processConfigurationNode(NodeInterface $node)
    {
        // load the object manager instance
        /** @var \AppserverIo\Appserver\DependencyInjectionContainer\Interfaces\ObjectManagerInterface $objectManager */
        $objectManager = $this->getApplication()->search('ObjectManagerInterface');
        // iterate over all configured descriptors and try to load object description
        /** \AppserverIo\Appserver\Core\Api\Node\DescriptorNode $descriptor */
        foreach ($objectManager->getConfiguredDescriptors() as $descriptor) {
            try {
                // load the descriptor class
                $descriptorClass = $descriptor->getNodeValue()->getValue();
                // load the object descriptor, initialize the servlet mappings and add it to the object manager
                /** \AppserverIo\Psr\Deployment\DescriptorInterface $objectDescriptor */
                if ($objectDescriptor = $descriptorClass::newDescriptorInstance()->fromConfiguration($node)) {
                    $objectManager->addObjectDescriptor($objectDescriptor, true);
                }
                // proceed with the next descriptor
                continue;
                // if class can not be reflected continue with next class
            } catch (\Exception $e) {
                // log an error message
                $this->getApplication()->getInitialContext()->getSystemLogger()->error($e->__toString());
                // proceed with the next descriptor
                continue;
            }
        }
    }