/** * Has been automatically invoked by the container after the application * instance has been created. * * @param \AppserverIo\Psr\Application\ApplicationInterface|\AppserverIo\Psr\Naming\NamingDirectoryInterface $application 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(); }
/** * Deploys the entity manager described by the passed XML node. * * @param \AppserverIo\Psr\Application\ApplicationInterface $application The application instance * @param \AppserverIo\Appserver\Core\Api\PersistenceUnitNodeInterface $persistenceUnitNode The XML node that describes the entity manager * * @return void */ protected function registerEntityManager(ApplicationInterface $application, PersistenceUnitNodeInterface $persistenceUnitNode) { // initialize the the entity manager instance $this->entityManagers[$lookupName = $persistenceUnitNode->getName()] = $persistenceUnitNode; // bind the callback for the entity manager instance to the naming directory => necessary for DI provider $application->getNamingDirectory()->bindCallback(sprintf('php:global/%s/%s', $application->getName(), $lookupName), array(&$this, 'lookup'), array($lookupName)); }
/** * Append the deployed application to the deployment instance * and registers it in the system configuration. * * @param \AppserverIo\Psr\Application\ApplicationInterface $application The application to append * * @return void */ public function addApplication(ApplicationInterface $application) { // register the application in this instance $this->applications[$application->getName()] = $application; // adds the application to the system configuration $this->addApplicationToSystemConfiguration($application); }
/** * Will initialize an existing app node from a given application * * @param ApplicationInterface $application The application to init from * * @return null */ public function initFromApplication(ApplicationInterface $application) { $this->setNodeName(self::NODE_NAME); $this->name = $application->getName(); $this->webappPath = $application->getWebappPath(); $this->setUuid($this->newUuid()); }