AppserverIo\Appserver\Naming\NamingContextFactory::visit PHP Метод

visit() публичный статический Метод

Creates a new naming context and add's it to the passed manager.
public static visit ( AppserverIo\Appserver\Application\Interfaces\ManagerSettingsAwareInterface $manager ) : void
$manager AppserverIo\Appserver\Application\Interfaces\ManagerSettingsAwareInterface The manager to add the naming context to
Результат void
    public static function visit(ManagerSettingsAwareInterface $manager)
    {
        // load the path to the web application
        $application = $manager->getApplication();
        $webappPath = $application->getWebappPath();
        // initialize the variable for the properties
        $properties = null;
        // load the configuration base directory
        if ($baseDirectory = $manager->getManagerSettings()->getBaseDirectory()) {
            // look for naming context properties in the manager's base directory
            $propertiesFile = DirectoryKeys::realpath(sprintf('%s/%s/%s', $webappPath, $baseDirectory, NamingContextFactory::CONFIGURATION_FILE));
            // load the properties from the configuration file
            if (file_exists($propertiesFile)) {
                $properties = Properties::create()->load($propertiesFile);
            }
        }
        // create the initial context instance
        $initialContext = new InitialContext($properties);
        $initialContext->injectApplication($application);
        // set the initial context in the manager
        $manager->injectInitialContext($initialContext);
    }
NamingContextFactory