AppserverIo\Appserver\AspectContainer\AspectManager::initialize PHP Method

initialize() public method

Has been automatically invoked by the container after the application instance has been created.
public initialize ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void
$application AppserverIo\Psr\Application\ApplicationInterface The application instance
return void
    public function initialize(ApplicationInterface $application)
    {
        /** @var \AppserverIo\Appserver\Core\DgClassLoader $dgClassLoader */
        $dgClassLoader = $application->search('DgClassLoader');
        // if we did not get the correct class loader our efforts are for naught
        if (!$dgClassLoader instanceof DgClassLoader) {
            $application->getInitialContext()->getSystemLogger()->warning(sprintf('Application %s uses the aspect manager but does not have access to the required Doppelgaenger class loader, AOP functionality will be omitted.', $application->getName()));
            return;
        }
        // register the aspects and tell the class loader it can fill the cache
        $this->registerAspects($application);
        // inject the filled aspect register and create the cache based on it
        $dgClassLoader->injectAspectRegister($this->getAspectRegister());
        $dgClassLoader->createCache();
    }