public static create ( AppserverIo\Appserver\Core\Api\Node\SessionHandlerNodeInterface $sessionHandlerNode, AppserverIo\Appserver\ServletEngine\SessionSettingsInterface $sessionSettings ) : AppserverIo\Appserver\ServletEngine\Session\SessionHandlerInterface | ||
$sessionHandlerNode | AppserverIo\Appserver\Core\Api\Node\SessionHandlerNodeInterface | The session handler configuration |
$sessionSettings | AppserverIo\Appserver\ServletEngine\SessionSettingsInterface | 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;
}