<?php
// Own namespace
-namespace CoreFramework\Factory\Client;
+namespace Org\Mxchange\CoreFramework\Factory\Client;
// Import framework stuff
-use CoreFramework\Factory\ObjectFactory;
-use CoreFramework\Registry\Registry;
+use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
/**
* An object factory for clients
*
* @author Roland Haeder <webmaster@shipsimu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2016 Core Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.shipsimu.org
*
* @param $socketResource A valid socket resource (optional)
* @return $clientInstance An instance of the requested client
*/
- public static final function createClientByProtocolInstance (HandleableProtocol $protocolInstance, $socketResource = false) {
+ public static final function createClientByProtocolInstance (HandleableProtocol $protocolInstance, $socketResource = FALSE) {
// Default is NULL (to initialize variable)
$clientInstance = NULL;
$registryKey = strtolower($protocolInstance->getProtocolName()) . '_client';
// Is the key already in registry?
- if (Registry::getRegistry()->instanceExists($registryKey)) {
+ if (GenericRegistry::getRegistry()->instanceExists($registryKey)) {
// Then use that instance
- $clientInstance = Registry::getRegistry()->getInstance($registryKey);
+ $clientInstance = GenericRegistry::getRegistry()->getInstance($registryKey);
// Set socket resource
$clientInstance->setSocketResource($socketResource);
$clientInstance = self::createObjectByConfiguredName($registryKey, array($socketResource));
// Set it in registry for later re-use
- Registry::getRegistry()->addInstance($registryKey, $clientInstance);
+ GenericRegistry::getRegistry()->addInstance($registryKey, $clientInstance);
}
// Return the prepared instance