injectSessionSettings() 공개 메소드

Injects the session settings.
public injectSessionSettings ( AppserverIo\Appserver\ServletEngine\SessionSettingsInterface $sessionSettings ) : void
$sessionSettings AppserverIo\Appserver\ServletEngine\SessionSettingsInterface Settings for the session handling
리턴 void
 /**
  * The main method that creates new instances in a separate context.
  *
  * @param \AppserverIo\Psr\Application\ApplicationInterface         $application          The application instance to register the class loader with
  * @param \AppserverIo\Appserver\Core\Api\Node\ManagerNodeInterface $managerConfiguration The manager configuration
  *
  * @return void
  */
 public static function visit(ApplicationInterface $application, ManagerNodeInterface $managerConfiguration)
 {
     // initialize the sessions and the session settings
     $sessionHandlers = new HashMap();
     $sessionSettings = new DefaultSessionSettings();
     $sessionMarshaller = new StandardSessionMarshaller();
     // add the configured session handlers
     /** @var \AppserverIo\Appserver\Core\Api\Node\SessionHandlerNode $sessionHandlerNode */
     foreach ($managerConfiguration->getSessionHandlers() as $sessionHandlerNode) {
         if ($factory = $sessionHandlerNode->getFactory()) {
             $sessionHandlers->add($sessionHandlerNode->getName(), $factory::create($sessionHandlerNode, $sessionSettings, $sessionMarshaller));
         }
     }
     // we need a garbage collector
     $garbageCollector = new StandardGarbageCollector();
     $garbageCollector->injectApplication($application);
     $garbageCollector->injectSessionSettings($sessionSettings);
     $garbageCollector->start();
     // and finally we need the session manager instance
     $sessionManager = new StandardSessionManager();
     $sessionManager->injectApplication($application);
     $sessionManager->injectSessionSettings($sessionSettings);
     $sessionManager->injectSessionHandlers($sessionHandlers);
     $sessionManager->injectGarbageCollector($garbageCollector);
     $sessionManager->injectSessionMarshaller($sessionMarshaller);
     $sessionManager->injectManagerConfiguration($managerConfiguration);
     // attach the instance
     $application->addManager($sessionManager, $managerConfiguration);
 }
 /**
  * The main method that creates new instances in a separate context.
  *
  * @param \AppserverIo\Psr\Application\ApplicationInterface         $application          The application instance to register the class loader with
  * @param \AppserverIo\Appserver\Core\Api\Node\ManagerNodeInterface $managerConfiguration The manager configuration
  *
  * @return void
  */
 public static function visit(ApplicationInterface $application, ManagerNodeInterface $managerConfiguration)
 {
     // load the registered loggers
     $loggers = $application->getInitialContext()->getLoggers();
     // initialize the session pool
     $sessions = new StackableStorage();
     $checksums = new StackableStorage();
     $sessionPool = new StackableStorage();
     $sessionSettings = new DefaultSessionSettings();
     $sessionMarshaller = new StandardSessionMarshaller();
     // we need a session factory instance
     $sessionFactory = new SessionFactory($sessionPool);
     $sessionFactory->injectLoggers($loggers);
     $sessionFactory->start();
     // we need a persistence manager and garbage collector
     $persistenceManager = new FilesystemPersistenceManager();
     $persistenceManager->injectLoggers($loggers);
     $persistenceManager->injectSessions($sessions);
     $persistenceManager->injectChecksums($checksums);
     $persistenceManager->injectSessionSettings($sessionSettings);
     $persistenceManager->injectSessionMarshaller($sessionMarshaller);
     $persistenceManager->injectSessionFactory($sessionFactory);
     $persistenceManager->injectUser($application->getUser());
     $persistenceManager->injectGroup($application->getGroup());
     $persistenceManager->injectUmask($application->getUmask());
     $persistenceManager->start();
     // we need a garbage collector
     $garbageCollector = new StandardGarbageCollector();
     $garbageCollector->injectLoggers($loggers);
     $garbageCollector->injectSessions($sessions);
     $garbageCollector->injectSessionFactory($sessionFactory);
     $garbageCollector->injectSessionSettings($sessionSettings);
     $garbageCollector->start();
     // and finally we need the session manager instance
     $sessionManager = new StandardSessionManager();
     $sessionManager->injectSessions($sessions);
     $sessionManager->injectSessionFactory($sessionFactory);
     $sessionManager->injectSessionSettings($sessionSettings);
     $sessionManager->injectGarbageCollector($garbageCollector);
     $sessionManager->injectPersistenceManager($persistenceManager);
     // attach the instance
     $application->addManager($sessionManager, $managerConfiguration);
 }