public function __construct(SystemConfigurationInterface $systemConfiguration)
{
// initialize the storage
$initialContextNode = $systemConfiguration->getInitialContext();
$storageNode = $initialContextNode->getStorage();
$reflectionClass = $this->newReflectionClass($storageNode->getType());
// create the storage instance
/** @var StorageInterface $storage */
$storage = $reflectionClass->newInstance();
// append the storage servers registered in system configuration
/** @var \AppserverIo\Appserver\Core\Api\Node\StorageServerNode $storageServer */
foreach ($storageNode->getStorageServers() as $storageServer) {
$storage->addServer($storageServer->getAddress(), $storageServer->getPort(), $storageServer->getWeight());
}
// add the storage to the initial context
$this->setStorage($storage);
// attach the system configuration to the initial context
$this->setSystemConfiguration($systemConfiguration);
}