]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/registry/connection/class_ConnectionRegistry.php
Continued with refactoring:
[hub.git] / application / hub / main / registry / connection / class_ConnectionRegistry.php
index 5d663f171588e07664abb50caab2b25e1afd7ce0..e6aa06d7fd77995850db631f2ff229c20c63a49f 100644 (file)
@@ -84,12 +84,12 @@ class ConnectionRegistry extends BaseRegistry implements Register, RegisterableC
        /**
         * "Getter" to get a string respresentation of the protocol
         *
-        * @param       $connectionInstance             An instance of a ConnectionHelper class
-        * @return      $key                                    A string representation of the protocol for the registry
+        * @param       $infoInstance           An instance of a ShareableInfo class
+        * @return      $key                            A string representation of the protocol for the registry
         */
-       private function getRegistryKeyFromConnection (ConnectionHelper $connectionInstance) {
+       private function getRegistryKeyFromInfo (ShareableInfo $infoInstance) {
                // Get the key
-               $key = $connectionInstance->getProtocolName();
+               $key = $infoInstance->getProtocolName();
 
                // Return resulting key
                return $key;
@@ -98,12 +98,12 @@ class ConnectionRegistry extends BaseRegistry implements Register, RegisterableC
        /**
         * Checks whether the given protocol is registered
         *
-        * @param       $connectionInstance     An instance of a ConnectionHelper class
-        * @return      $isRegistered           Whether the protocol is registered
+        * @param       $connectionInstance             An instance of a ConnectionHelper class
+        * @return      $isRegistered                   Whether the protocol is registered
         */
        private function isConnectionRegistered (ConnectionHelper $connectionInstance) {
                // Get the key
-               $key = $this->getRegistryKeyFromConnection($connectionInstance);
+               $key = $this->getRegistryKeyFromInfo($connectionInstance);
 
                // Determine it
                $isRegistered = $this->instanceExists($key);
@@ -127,7 +127,7 @@ class ConnectionRegistry extends BaseRegistry implements Register, RegisterableC
                // First, check for the instance, there can be only once
                if ($this->isConnectionRegistered($connectionInstance)) {
                        // That one is found so "get" a registry key from it
-                       $key = $this->getRegistryKeyFromConnection($connectionInstance);
+                       $key = $this->getRegistryKeyFromInfo($connectionInstance);
 
                        // Get the registry
                        $registryInstance = $this->getInstance($key);
@@ -165,10 +165,10 @@ class ConnectionRegistry extends BaseRegistry implements Register, RegisterableC
                        $registryInstance = SubRegistry::createSubRegistry();
 
                        // Now we can create the sub-registry for this protocol
-                       $this->addInstance($this->getRegistryKeyFromConnection($connectionInstance), $registryInstance);
+                       $this->addInstance($this->getRegistryKeyFromInfo($connectionInstance), $registryInstance);
                } else {
                        // Get the sub-registry back
-                       $registryInstance = $this->getInstance($this->getRegistryKeyFromConnection($connectionInstance));
+                       $registryInstance = $this->getInstance($this->getRegistryKeyFromInfo($connectionInstance));
                }
 
                // Get a key for sub-registries
@@ -197,7 +197,7 @@ class ConnectionRegistry extends BaseRegistry implements Register, RegisterableC
                } // END - if
 
                // Now get the key from the protocol
-               $key = $this->getRegistryKeyFromConnection($connectionInstance);
+               $key = $this->getRegistryKeyFromInfo($connectionInstance);
 
                // And get the registry
                $registryInstance = $this->getInstance($key);
@@ -224,6 +224,9 @@ class ConnectionRegistry extends BaseRegistry implements Register, RegisterableC
 
                // Get all keys and check them
                foreach ($this->getInstanceRegistry() as $key => $registryInstance) {
+                       // Debug message
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: key=' . $key . ',registryInstance=' . $registryInstance->__toString());
+
                        // This is always a SubRegistry instance
                        foreach ($registryInstance->getInstanceRegistry() as $subKey => $containerInstance) {
                                // Debug message