/**
* 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 configured descriptors from the configuration
$configuredDescriptors = $managerConfiguration->getDescriptors();
// create the storage for the data and the bean descriptors
$data = new StackableStorage();
$objectDescriptors = new StackableStorage();
// create and initialize the object manager instance
$objectManager = new ObjectManager();
$objectManager->injectData($data);
$objectManager->injectApplication($application);
$objectManager->injectObjectDescriptors($objectDescriptors);
$objectManager->injectConfiguredDescriptors($configuredDescriptors);
// attach the instance
$application->addManager($objectManager, $managerConfiguration);
}