AppserverIo\Appserver\ServletEngine\Session\SessionHandlerFactory::create PHP Method

create() public static method

Create and return a new instance of the session handler with the passed configuration.
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;
    }
SessionHandlerFactory