// Import framework stuff
use Org\Mxchange\CoreFramework\Factory\BaseFactory;
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
/**
* A factory class for socket registries
*
* @author Roland Haeder <webmaster@shipsimu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2021 Core Developer Team
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.shipsimu.org
*
*/
public static final function createSocketRegistryInstance () {
// Get registry instance
- $registryInstance = GenericRegistry::getRegistry();
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('SOCKET-REGISTRY-FACTORY: CALLED!');
+ $objectRegistryInstance = ObjectRegistry::getRegistry('factory');
// Do we have an instance in the registry?
- if ($registryInstance->instanceExists('socket_registry')) {
+ if ($objectRegistryInstance->instanceExists('socket_registry')) {
// Then use this instance
- $registryInstance = $registryInstance->getInstance('socket_registry');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('SOCKET-REGISTRY-FACTORY: Getting socket registry instance ...');
+ $registryInstance = $objectRegistryInstance->getInstance('socket_registry');
} else {
// Get the registry instance
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('SOCKET-REGISTRY-FACTORY: Creating new socket registry instance ...');
$registryInstance = ObjectFactory::createObjectByConfiguredName('socket_registry_class');
// Set the instance in registry for further use
- $registryInstance->addInstance('socket_registry', $registryInstance);
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('SOCKET-REGISTRY-FACTORY: Adding socket registry instance ...');
+ $objectRegistryInstance->addInstance('socket_registry', $registryInstance);
}
// Return the instance
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('SOCKET-REGISTRY-FACTORY: registryInstance=%s - EXIT!', $registryInstance->__toString()));
return $registryInstance;
}