/** * Create and return a new instance of the session handler with * the passed configuration. * * @param \AppserverIo\Appserver\Core\Api\Node\SessionHandlerNodeInterface $sessionHandlerNode The session handler configuration * @param \AppserverIo\Appserver\ServletEngine\SessionSettingsInterface $sessionSettings The session settings * * @return \AppserverIo\Appserver\ServletEngine\Session\SessionHandlerInterface The session handler instance */ public static function create(SessionHandlerNodeInterface $sessionHandlerNode, SessionSettingsInterface $sessionSettings) { // reflect the class $reflectionClass = new ReflectionClass($sessionHandlerNode->getType()); // create and initialize the session handler instance $sessionHandler = $reflectionClass->newInstanceArgs($sessionHandlerNode->getParamsAsArray()); $sessionHandler->injectSessionSettings($sessionSettings); // return the initialzed instance return $sessionHandler; }