]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/factories/database/class_DatabaseFrontendFactory.php
Continued:
[core.git] / framework / main / classes / factories / database / class_DatabaseFrontendFactory.php
index 8df8c28580306a034633c73eedc5254c33861fc2..f5fc0bbd7a649053b49847af8a07c3396cabf815 100644 (file)
@@ -3,15 +3,16 @@
 namespace Org\Mxchange\CoreFramework\Factory\Database\Frontend;
 
 // Import framework stuff
-use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Factory\BaseFactory;
+use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
+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 - 2020 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
  *
@@ -28,13 +29,13 @@ use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-class DatabaseFrontendFactory extends ObjectFactory {
+class DatabaseFrontendFactory extends BaseFactory {
        /**
         * Protected constructor
         *
         * @return      void
         */
-       protected function __construct () {
+       private function __construct () {
                // Call parent constructor
                parent::__construct(__CLASS__);
        }
@@ -46,9 +47,9 @@ class DatabaseFrontendFactory extends ObjectFactory {
         *
         * @return      $frontendInstance       A database frontend instance
         */
-       public static final function createFrontendByConfiguredName ($frontendName) {
+       public static final function createFrontendByConfiguredName (string $frontendName) {
                // Get registry instance
-               $registryInstance = GenericRegistry::getRegistry();
+               $registryInstance = ObjectRegistry::getRegistry('generic');
 
                // Do we have an instance in the registry?
                if ($registryInstance->instanceExists($frontendName)) {
@@ -56,7 +57,7 @@ class DatabaseFrontendFactory extends ObjectFactory {
                        $frontendInstance = $registryInstance->getInstance($frontendName);
                } else {
                        // Get the registry instance
-                       $frontendInstance = self::createObjectByConfiguredName($frontendName);
+                       $frontendInstance = ObjectFactory::createObjectByConfiguredName($frontendName);
 
                        // Set the instance in registry for further use
                        $registryInstance->addInstance($frontendName, $frontendInstance);