AppserverIo\Appserver\ServletEngine\Security\StandardAuthenticationManager::initialize PHP 메소드

initialize() 공개 메소드

Initializes the manager instance.
또한 보기: AppserverIo\Psr\Application\ManagerInterface::initialize()
public initialize ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void
$application AppserverIo\Psr\Application\ApplicationInterface The application instance
리턴 void
    public function initialize(ApplicationInterface $application)
    {
        // query whether or not the web application folder exists
        if (is_dir($this->getWebappPath()) === false) {
            return;
        }
        // initialize the map for the realms
        $realms = new HashMap();
        // query whether or not we've manager configuration found
        /** @var \AppserverIo\Appserver\Core\Api\Node\ManagerNodeInterface $managerNode */
        if ($managerNode = $this->getManagerConfiguration()) {
            // initialize the security domains found in the manager configuration
            /** @var \AppserverIo\Appserver\Core\Api\Node\SecurityDomainNodeInterface $securityDomainNode */
            foreach ($this->getManagerConfiguration()->getSecurityDomains() as $securityDomainNode) {
                // create the realm instance
                $realm = new Realm($this, $securityDomainNode->getName());
                $realm->injectConfiguration($securityDomainNode);
                // add the initialized security domain to the map
                $realms->add($realm->getName(), $realm);
            }
        }
        // inject the map with the realms
        $this->injectRealms($realms);
        // initialize the deployment descriptor parser and parse the web application's deployment descriptor for servlets
        $deploymentDescriptorParser = new DeploymentDescriptorParser();
        $deploymentDescriptorParser->injectAuthenticationContext($this);
        $deploymentDescriptorParser->parse();
    }