]> git.mxchange.org Git - hub.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sat, 25 Feb 2023 12:47:36 +0000 (13:47 +0100)
committerRoland Häder <roland@mxchange.org>
Sat, 25 Feb 2023 12:53:26 +0000 (13:53 +0100)
- fixed handling of sockets in socket registry
- also fixed key spaces for object registries
- updated 'core' framework

45 files changed:
application/hub/classes/commands/console/class_HubConsoleAptProxyCommand.php
application/hub/classes/commands/console/class_HubConsoleChatCommand.php
application/hub/classes/commands/console/class_HubConsoleCrawlerCommand.php
application/hub/classes/commands/console/class_HubConsoleMinerCommand.php
application/hub/classes/crawler/class_BaseNodeCrawler.php
application/hub/classes/factories/node/class_NodeObjectFactory.php
application/hub/classes/factories/socket/class_SocketFactory.php
application/hub/classes/factories/source/url/class_UrlSourceObjectFactory.php
application/hub/classes/filter/apt-proxy/class_AptProxyInitializationFilter.php
application/hub/classes/filter/apt-proxy/class_AptProxyWelcomeTeaserFilter.php
application/hub/classes/filter/bootstrap/apt-proxy/class_AptProxyBootstrap
application/hub/classes/filter/bootstrap/apt-proxy/class_AptProxyBootstrapExtraBootstrappingFilter.php
application/hub/classes/filter/bootstrap/apt-proxy/class_AptProxyBootstrapGenericActivationFilter.php
application/hub/classes/filter/bootstrap/chat/class_ChatBootstrap
application/hub/classes/filter/bootstrap/chat/class_ChatBootstrapExtraBootstrappingFilter.php
application/hub/classes/filter/bootstrap/chat/class_ChatBootstrapGenericActivationFilter.php
application/hub/classes/filter/bootstrap/crawler/class_CrawlerBootstrap
application/hub/classes/filter/bootstrap/crawler/class_CrawlerBootstrapExtraBootstrappingFilter.php
application/hub/classes/filter/bootstrap/crawler/class_CrawlerBootstrapGenericActivationFilter.php
application/hub/classes/filter/bootstrap/miner/class_MinerBootstrap
application/hub/classes/filter/bootstrap/miner/class_MinerBootstrapBufferQueueInitializerFilter.php
application/hub/classes/filter/bootstrap/miner/class_MinerBootstrapExtraBootstrappingFilter.php
application/hub/classes/filter/bootstrap/miner/class_MinerBootstrapGenericActivationFilter.php
application/hub/classes/filter/chat/class_ChatInitializationFilter.php
application/hub/classes/filter/chat/class_ChatWelcomeTeaserFilter.php
application/hub/classes/filter/crawler/class_CrawlerWelcomeTeaserFilter.php
application/hub/classes/filter/miner/class_MinerWelcomeTeaserFilter.php
application/hub/classes/filter/shutdown/apt-proxy/class_AptProxyShutdownFilter.php
application/hub/classes/filter/shutdown/chat/class_ChatShutdownFilter.php
application/hub/classes/filter/shutdown/crawler/class_CrawlerShutdownFilter.php
application/hub/classes/filter/shutdown/miner/class_MinerShutdownFilter.php
application/hub/classes/filter/task/apt-proxy/class_AptProxyTaskHandlerInitializerFilter.php
application/hub/classes/filter/task/chat/class_ChatTaskHandlerInitializerFilter.php
application/hub/classes/filter/task/class_BaseCrawlerTaskFilter.php
application/hub/classes/filter/task/miner/class_MinerTaskHandlerInitializerFilter.php
application/hub/classes/listener/class_BaseListener.php
application/hub/classes/miner/class_BaseHubMiner.php
application/hub/classes/nodes/class_BaseHubNode.php
application/hub/classes/producer/miner/class_BaseMinerProducer.php
application/hub/classes/registry/socket/class_SocketRegistry.php
application/hub/classes/tasks/crawler/communicator/class_CrawlerNodeCommunicatorTask.php
application/hub/classes/tasks/miner/block_fetcher/class_MinerBlockFetcherTask.php
application/hub/classes/tasks/miner/block_producer/class_MinerRealGenesisBlockProducerTask.php
application/hub/classes/tasks/miner/block_producer/class_MinerTestGenesisBlockProducerTask.php
core

index 83254c90e2ffd0b95daa263fe3d11cf38db65fa3..e55719a142ff9f6ad47178285be80788175ade0a 100644 (file)
@@ -86,7 +86,7 @@ class HubConsoleAptProxyCommand extends BaseCommand implements Commandable {
                self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: Bootstrap finished.');
 
                // Get apt-proxy instance
-               $proxyInstance = ObjectRegistry::getRegistry('hub')->getInstance('apt_proxy');
+               $proxyInstance = ObjectRegistry::getRegistry('factory')->getInstance('apt_proxy');
 
                // Add some apt-proxy-specific filters
                $proxyInstance->addExtraAptProxyFilters();
index 94db02e03dd8e897f4a8410e79814e043453eb5e..5901b612b6a7eba022af3bc9552b24557b82dd75 100644 (file)
@@ -86,7 +86,7 @@ class HubConsoleChatCommand extends BaseCommand implements Commandable {
                self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: Bootstrap finished.');
 
                // Get chat instance
-               $chatInstance = ObjectRegistry::getRegistry('hub')->getInstance('chat');
+               $chatInstance = ObjectRegistry::getRegistry('factory')->getInstance('chat');
 
                // Add some chat-specific filters
                $chatInstance->addExtraChatFilters();
index 911910a9f1fb415d1bd5331fa246fb83f8174f98..f97620097b0801b4b36ae4e9f920de1343033c6f 100644 (file)
@@ -86,7 +86,7 @@ class HubConsoleCrawlerCommand extends BaseCommand implements Commandable {
                self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: Bootstrap finished.');
 
                // Get crawler instance
-               $crawlerInstance = ObjectRegistry::getRegistry('hub')->getInstance('crawler');
+               $crawlerInstance = ObjectRegistry::getRegistry('factory')->getInstance('crawler');
 
                // Add some crawler-specific filters
                $crawlerInstance->addExtraCrawlerFilters();
index a286be8ce18d05fa7ac3b0d5799edcba1bd69916..90d3591ebeff66855b36540776c2deb7ad508fc1 100644 (file)
@@ -86,7 +86,7 @@ class HubConsoleMinerCommand extends BaseCommand implements Commandable {
                self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: Bootstrap finished.');
 
                // Get miner instance
-               $minerInstance = ObjectRegistry::getRegistry('hub')->getInstance('miner');
+               $minerInstance = ObjectRegistry::getRegistry('factory')->getInstance('miner');
 
                // Add some miner-specific filters
                $minerInstance->addExtraMinerFilters();
index fc887d097969b8f4fe7bbfe9493806e16498f14c..221cedba005621584f00f411363bdc3e032852eb 100644 (file)
@@ -54,7 +54,7 @@ abstract class BaseNodeCrawler extends BaseHubSystem {
                parent::__construct($className);
 
                // Set this crawler instance in registry
-               ObjectRegistry::getRegistry('hub')->addInstance('crawler', $this);
+               ObjectRegistry::getRegistry('factory')->addInstance('crawler', $this);
 
                // Init state which sets the state to 'init'
                $this->initState();
index c92ec5fb9ecb2a6b5fc296f52a96265ebb60e3d1..7e0cb377f1672654337d080140bfb5835dcbf836 100644 (file)
@@ -58,26 +58,26 @@ class NodeObjectFactory extends BaseFactory {
         */
        public static final function createNodeInstance (Requestable $requestInstance = NULL, Responseable $responseInstance = NULL) {
                // Get new factory instance
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: requestInstance[]=%s,responseInstance[]=%s - CALLED!', gettype($requestInstance), gettype($responseInstance)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: requestInstance[]=%s,responseInstance[]=%s - CALLED!', gettype($requestInstance), gettype($responseInstance)));
                $factoryInstance = new NodeObjectFactory();
 
                // If there is no handler?
                if (ObjectRegistry::getRegistry('factory')->instanceExists('node')) {
                        // Get handler from registry
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-FACTORY: Getting node instance from registry ...');
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-FACTORY: Getting node instance from registry ...');
 
                        $nodeInstance = ObjectRegistry::getRegistry('factory')->getInstance('node');
                } elseif (($requestInstance instanceof Requestable) && ($responseInstance instanceof Responseable)) {
                        // The default node-mode is from our configuration
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-FACTORY: requestInstance and responseInstance are both set.');
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-FACTORY: requestInstance and responseInstance are both set.');
                        $nodeMode = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('node_default_mode');
 
                        // Is the node 'mode' parameter set?
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: nodeMode=%s - from CONFIG', $nodeMode));
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: nodeMode=%s - from CONFIG', $nodeMode));
                        if ($requestInstance->isRequestElementSet('mode')) {
                                // Then use this which overrides the config entry temporarily
                                $nodeMode = $requestInstance->getRequestElement('mode');
-                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: nodeMode=%s - from REQUEST', $nodeMode));
+                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: nodeMode=%s - from REQUEST', $nodeMode));
                        } else {
                                // Set it for easier re-usage
                                $requestInstance->setRequestElement('mode', $nodeMode);
@@ -91,18 +91,18 @@ class NodeObjectFactory extends BaseFactory {
                        );
 
                        // Get the node instance
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: Loading class with className=%s ...', $className));
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: Loading class with className=%s ...', $className));
                        $nodeInstance = ObjectFactory::createObjectByName($className);
 
                        // Get a registry
                        $applicationInstance = ApplicationHelper::getSelfInstance();
 
                        // Add node-specific filters
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: Registering node-specific filters, responseInstance[]=%s', gettype($responseInstance)));
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: Registering node-specific filters, responseInstance[]=%s', gettype($responseInstance)));
                        $nodeInstance->addExtraFilters($applicationInstance->getControllerInstance(), $responseInstance);
 
                        // Add it to the registry
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: Adding nodeInstance=%s to registry ...', $nodeInstance->__toString()));
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: Adding nodeInstance=%s to registry ...', $nodeInstance->__toString()));
                        ObjectRegistry::getRegistry('factory')->addInstance('node', $nodeInstance);
                } else {
                        // Throw an exception here
@@ -110,7 +110,7 @@ class NodeObjectFactory extends BaseFactory {
                }
 
                // Return the instance
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: nodeInstance=%s - EXIT!', $nodeInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: nodeInstance=%s - EXIT!', $nodeInstance->__toString()));
                return $nodeInstance;
        }
 
index cafb1e9e0dd8065f575016e13c00e91e1ced9af6..3863ff4afe33192f59cfc05e5cea15a57074053d 100644 (file)
@@ -337,10 +337,8 @@ class SocketFactory extends BaseFactory {
         * @throws      InvalidSocketException  Thrown if the socket could not be initialized
         */
        public static function createListenUdpSocket (Listenable $listenerInstance) {
-               // Trace message
-               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-FACTORY: listenerInstance=%s - CALLED!', $listenerInstance->__toString()));
-
                // Create a streaming socket, of type UDP
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-FACTORY: listenerInstance=%s - CALLED!', $listenerInstance->__toString()));
                $socketResource = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
 
                // Init fake package instance
@@ -394,10 +392,8 @@ class SocketFactory extends BaseFactory {
                        $socketInstance->handleSocketError(__METHOD__, __LINE__);
                }
 
-               // Trace message
-               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-FACTORY: socketInstance=%s - EXIT!', $socketInstance->__toString()));
-
                // Return prepepared socket
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-FACTORY: socketInstance=%s - EXIT!', $socketInstance->__toString()));
                return $socketInstance;
        }
 
@@ -412,10 +408,8 @@ class SocketFactory extends BaseFactory {
         * @throws      LogicException  If the current instance is not valid
         */
        public static final function createNextAcceptedSocketFromPool (Poolable $poolInstance, StorableSocket $socketInstance) {
-               // Trace message
-               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-FACTORY: poolInstance=%s,socketInstance->socketResource=%s - CALLED!', $poolInstance->__toString(), $socketInstance->getSocketResource()));
-
                // Get socket protocol
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('SOCKET-FACTORY: poolInstance=%s,socketInstance->socketResource=%s - CALLED!', $poolInstance->__toString(), $socketInstance->getSocketResource()));
                $socketProtocol = $socketInstance->getSocketProtocol();
 
                // Is the an iterator instance?
@@ -458,7 +452,7 @@ class SocketFactory extends BaseFactory {
                $acceptedSocketInstance = $current[Poolable::SOCKET_ARRAY_INSTANCE]->acceptNewIncomingSocket();
 
                // Return found socket instance
-               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-FACTORY: acceptedSocketInstance[]=%s - EXIT!', gettype($acceptedSocketInstance)));
+               //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('SOCKET-FACTORY: acceptedSocketInstance[]=%s - EXIT!', gettype($acceptedSocketInstance)));
                return $acceptedSocketInstance;
        }
 
@@ -472,7 +466,7 @@ class SocketFactory extends BaseFactory {
         */
        public static final function createIncomingSocketInstance ($socketResource, string $socketProtocol) {
                // Validate parameter
-               /* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-FACTORY: socketResource[%s]=%s,socketProtocol=%s - CALLED!', gettype($socketResource), $socketResource, $socketProtocol));
+               /* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('SOCKET-FACTORY: socketResource[%s]=%s,socketProtocol=%s - CALLED!', gettype($socketResource), $socketResource, $socketProtocol));
                if (!is_resource($socketResource)) {
                        // Throw exception
                        throw new InvalidArgumentException(sprintf('socketResource[]=%s is not valid', gettype($socketResource)));
@@ -527,7 +521,7 @@ class SocketFactory extends BaseFactory {
                }
 
                // Return found socket instance
-               /* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-FACTORY: socketInstance=%s - EXIT!', $socketInstance->__toString()));
+               /* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('SOCKET-FACTORY: socketInstance=%s - EXIT!', $socketInstance->__toString()));
                return $socketInstance;
        }
 }
index c3c136bb2e94aea71e35752aadbaec1a6a9ab27a..48c017a352c80f2bcf893d8d63c77963cd29da30 100644 (file)
@@ -52,7 +52,7 @@ class UrlSourceObjectFactory extends BaseFactory {
                $factoryInstance = new UrlSourceObjectFactory();
 
                // Get task handler instance
-               $handlerInstance = ObjectRegistry::getRegistry('factory')->getInstance('task_handler');
+               $handlerInstance = ObjectRegistry::getRegistry('generic')->getInstance('task_handler');
 
                // Get source type by looking for given task instance in task handler
                $sourceType = $handlerInstance->searchTask($taskInstance);
index af7c0f8edbaf0acf4561767ed5ede5d6b1ffd9d0..5db7f861ca67b1b28fcad0a3fe4be8a6e883a40b 100644 (file)
@@ -78,7 +78,7 @@ class AptProxyInitializationFilter extends BaseAptProxyFilter implements Filtera
                $proxyInstance->addExtraFilters($applicationInstance->getControllerInstance(), $responseInstance);
 
                // Set the apt_proxy instance in registry
-               ObjectRegistry::getRegistry('hub')->addInstance('apt_proxy', $proxyInstance);
+               ObjectRegistry::getRegistry('factory')->addInstance('apt_proxy', $proxyInstance);
        }
 
 }
index e3af90ce9df9b7ccbddd97aa45bb678e8fc32cf4..f2f9a5b10cb7353a2358f8e757e66ad36e0a39d3 100644 (file)
@@ -68,7 +68,7 @@ class AptProxyWelcomeTeaserFilter extends BaseAptProxyFilter implements Filterab
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get node instance
-               $proxyInstance = ObjectRegistry::getRegistry('hub')->getInstance('apt_proxy');
+               $proxyInstance = ObjectRegistry::getRegistry('factory')->getInstance('apt_proxy');
 
                // Now output the teaser
                $proxyInstance->outputConsoleTeaser();
index f8388a3943cff22d4a8458cbab2fe5ff5def0f44..592cc6267fd2a9766d4718027af54998155a0590 100644 (file)
@@ -65,7 +65,7 @@ class AptProxyBootstrap???Filter extends BaseAptProxyFilter implements Filterabl
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get apt-proxy instance
-               $proxyInstance = ObjectRegistry::getRegistry('hub')->getInstance('apt_proxy');
+               $proxyInstance = ObjectRegistry::getRegistry('factory')->getInstance('apt_proxy');
 
                // Now do something
                DebugMiddleware::getSelfInstance()->partialStub('Please implement this step.');
index aab49d44fcc7bda714d8a45c41670481b9a8ee36..9658479f1275b3f542b8d98e21fd35caa1e5b81d 100644 (file)
@@ -67,7 +67,7 @@ class AptProxyBootstrapExtraBootstrappingFilter extends BaseAptProxyFilter imple
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get apt-proxy instance
-               $proxyInstance = ObjectRegistry::getRegistry('hub')->getInstance('apt_proxy');
+               $proxyInstance = ObjectRegistry::getRegistry('factory')->getInstance('apt_proxy');
 
                // Do some extra bootstrapping steps
                $proxyInstance->doBootstrapping();
index 46fedc320f6cc0c10fa6e5498480fda9cf778bf3..e075e949443a2c6cb50a4ef97705c5c27487c20a 100644 (file)
@@ -67,7 +67,7 @@ class AptProxyBootstrapGenericActivationFilter extends BaseAptProxyFilter implem
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get a apt-proxy instance
-               $proxyInstance = ObjectRegistry::getRegistry('hub')->getInstance('apt_proxy');
+               $proxyInstance = ObjectRegistry::getRegistry('factory')->getInstance('apt_proxy');
 
                // Set the flag
                $proxyInstance->enableIsActive();
index a0a2161f666b2cd8f806ae412f9e6045047a7311..caf94d40691c9d1b5411cd5ee3996c31b8d2fe24 100644 (file)
@@ -65,7 +65,7 @@ class ChatBootstrap???Filter extends BaseChatFilter implements Filterable {
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get chat instance
-               $chatInstance = ObjectRegistry::getRegistry('hub')->getInstance('chat');
+               $chatInstance = ObjectRegistry::getRegistry('factory')->getInstance('chat');
 
                // Now do something
                DebugMiddleware::getSelfInstance()->partialStub('Please implement this step.');
index 5da5bd4439a7d3956729033538458daead4bccba..0d3cf7c1c6596b6184cb612bb00a59bca94ac774 100644 (file)
@@ -67,7 +67,7 @@ class ChatBootstrapExtraBootstrappingFilter extends BaseChatFilter implements Fi
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get chat instance
-               $chatInstance = ObjectRegistry::getRegistry('hub')->getInstance('chat');
+               $chatInstance = ObjectRegistry::getRegistry('factory')->getInstance('chat');
 
                // Do some extra bootstrapping steps
                $chatInstance->doBootstrapping();
index d845a3bd125bc8cf45d20cc94b3dfcbe8deef6df..21be0588b3647fc2b23736230e1988d10f1f9337 100644 (file)
@@ -67,7 +67,7 @@ class ChatBootstrapGenericActivationFilter extends BaseChatFilter implements Fil
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get a chat instance
-               $chatInstance = ObjectRegistry::getRegistry('hub')->getInstance('chat');
+               $chatInstance = ObjectRegistry::getRegistry('factory')->getInstance('chat');
 
                // Set the flag
                $chatInstance->enableIsActive();
index e47057004d039fef1659621dc25cd960a5dc709f..eaf906032c586afeb62a237f1f41713a94e97596 100644 (file)
@@ -65,7 +65,7 @@ class CrawlerBootstrap???Filter extends BaseCrawlerFilter implements Filterable
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get crawler instance
-               $crawlerInstance = ObjectRegistry::getRegistry('hub')->getInstance('crawler');
+               $crawlerInstance = ObjectRegistry::getRegistry('factory')->getInstance('crawler');
 
                // Now do something
                DebugMiddleware::getSelfInstance()->partialStub('Please implement this step.');
index 4aec418be9b9f4b503dc0d77b5a89c296b47ae72..5a82fa2f9a0d2160268cec03a0ba1aaf1439ec64 100644 (file)
@@ -67,7 +67,7 @@ class CrawlerBootstrapExtraBootstrappingFilter extends BaseCrawlerFilter impleme
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get crawler instance
-               $crawlerInstance = ObjectRegistry::getRegistry('hub')->getInstance('crawler');
+               $crawlerInstance = ObjectRegistry::getRegistry('factory')->getInstance('crawler');
 
                // Do some extra bootstrapping steps
                $crawlerInstance->doBootstrapping();
index daef9b1097d1631e915eda9f63ffe2a0eb801474..93116a9763c2368afb8f49eddc0aef10f9bc44d8 100644 (file)
@@ -67,7 +67,7 @@ class CrawlerBootstrapGenericActivationFilter extends BaseCrawlerFilter implemen
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get a crawler instance
-               $crawlerInstance = ObjectRegistry::getRegistry('hub')->getInstance('crawler');
+               $crawlerInstance = ObjectRegistry::getRegistry('factory')->getInstance('crawler');
 
                // Set the flag
                $crawlerInstance->enableIsActive();
index 800f2a1e48b7e2f525b7495ff49844e63c382207..7666961b715e86a521e0ae7e96df6228589e2793 100644 (file)
@@ -68,7 +68,7 @@ class MinerBootstrap???Filter extends BaseMinerFilter implements Filterable {
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get miner instance
-               $minerInstance = ObjectRegistry::getRegistry('hub')->getInstance('miner');
+               $minerInstance = ObjectRegistry::getRegistry('factory')->getInstance('miner');
 
                // Now do something
                DebugMiddleware::getSelfInstance()->partialStub('Please implement this step.');
index e2424e9a7643a19661615e2a48b70064e77337af..da5a50745563b28fafcab3268fabad6517ffcd4b 100644 (file)
@@ -67,7 +67,7 @@ class MinerBootstrapBufferQueueInitializerFilter extends BaseMinerFilter impleme
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get miner instance
-               $minerInstance = ObjectRegistry::getRegistry('hub')->getInstance('miner');
+               $minerInstance = ObjectRegistry::getRegistry('factory')->getInstance('miner');
 
                // Init all buffer queues
                $minerInstance->initBufferQueues();
index 599f534fa90c46cfa02944422de9807c7ae18db9..91409fba28f91f539aac79f38fde9fad49785780 100644 (file)
@@ -67,7 +67,7 @@ class MinerBootstrapExtraBootstrappingFilter extends BaseMinerFilter implements
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get miner instance
-               $minerInstance = ObjectRegistry::getRegistry('hub')->getInstance('miner');
+               $minerInstance = ObjectRegistry::getRegistry('factory')->getInstance('miner');
 
                // Do some extra bootstrapping steps
                $minerInstance->doBootstrapping();
index ac78b7742d5b769ccfc30cde39d12247bc37ee73..5880ec70aad60762ca40ff94022323b2868047b9 100644 (file)
@@ -67,7 +67,7 @@ class MinerBootstrapGenericActivationFilter extends BaseMinerFilter implements F
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get a miner instance
-               $minerInstance = ObjectRegistry::getRegistry('hub')->getInstance('miner');
+               $minerInstance = ObjectRegistry::getRegistry('factory')->getInstance('miner');
 
                // Set the flag
                $minerInstance->enableIsActive();
index 6f03a23cef807944731be1d009294a5493c6061f..cfc331bfc79ccd136b55552da7e310214c814e96 100644 (file)
@@ -78,7 +78,7 @@ class ChatInitializationFilter extends BaseChatFilter implements Filterable {
                $chatInstance->addExtraFilters($applicationInstance->getControllerInstance(), $responseInstance);
 
                // Set the chat instance in registry
-               ObjectRegistry::getRegistry('hub')->addInstance('chat', $chatInstance);
+               ObjectRegistry::getRegistry('factory')->addInstance('chat', $chatInstance);
        }
 
 }
index 27e8bf917ada541b3194ab4191e63075bcbd18a7..834c1212f7d1f5cacaf0cfa8ba9a4000406b5c87 100644 (file)
@@ -68,7 +68,7 @@ class ChatWelcomeTeaserFilter extends BaseChatFilter implements Filterable {
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get node instance
-               $chatInstance = ObjectRegistry::getRegistry('hub')->getInstance('chat');
+               $chatInstance = ObjectRegistry::getRegistry('factory')->getInstance('chat');
 
                // Now output the teaser
                $chatInstance->outputConsoleTeaser();
index 59bec3866d55aeb6b654b4615920e4583d0986e2..e28d56e1059c5b5672700dd2bd1ae376ff7cc121 100644 (file)
@@ -68,7 +68,7 @@ class CrawlerWelcomeTeaserFilter extends BaseCrawlerFilter implements Filterable
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get node instance
-               $crawlerInstance = ObjectRegistry::getRegistry('hub')->getInstance('crawler');
+               $crawlerInstance = ObjectRegistry::getRegistry('factory')->getInstance('crawler');
 
                // Now output the teaser
                $crawlerInstance->outputConsoleTeaser();
index 54b3c6bdf3921ec72541586dfa4ae1fdaf298b95..0d535968227c5c040c916ab0de13cf13ddb2a4fa 100644 (file)
@@ -68,7 +68,7 @@ class MinerWelcomeTeaserFilter extends BaseMinerFilter implements Filterable {
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get node instance
-               $minerInstance = ObjectRegistry::getRegistry('hub')->getInstance('miner');
+               $minerInstance = ObjectRegistry::getRegistry('factory')->getInstance('miner');
 
                // Now output the teaser
                $minerInstance->outputConsoleTeaser();
index c4f0da3498cc7ce1d7309bba1201e2ebd49a3d11..092548b7f74eff709bc904e97156e6a36886726a 100644 (file)
@@ -69,7 +69,7 @@ class AptProxyShutdownFilter extends BaseAptProxyFilter implements Filterable {
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get node instance
-               $proxyInstance = ObjectRegistry::getRegistry('hub')->getInstance('apt_proxy');
+               $proxyInstance = ObjectRegistry::getRegistry('factory')->getInstance('apt_proxy');
 
                // Shutdown the apt-proxy. This should be the last line
                $proxyInstance->doShutdown();
index 2b8587f0779fa4aabaae274dce05c098786744c8..69e2fa47c848f1a1fe8ab1f27a42b3f95d01b822 100644 (file)
@@ -69,7 +69,7 @@ class ChatShutdownFilter extends BaseChatFilter implements Filterable {
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get node instance
-               $chatInstance = ObjectRegistry::getRegistry('hub')->getInstance('chat');
+               $chatInstance = ObjectRegistry::getRegistry('factory')->getInstance('chat');
 
                // Shutdown the chat. This should be the last line
                $chatInstance->doShutdown();
index cee9f5ab46e5a97cf2e6d3273d4202fe445990cb..9cc8a01a8613f6385841844620ae4ccd1bbcbdd3 100644 (file)
@@ -69,7 +69,7 @@ class CrawlerShutdownFilter extends BaseCrawlerFilter implements Filterable {
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get node instance
-               $crawlerInstance = ObjectRegistry::getRegistry('hub')->getInstance('crawler');
+               $crawlerInstance = ObjectRegistry::getRegistry('factory')->getInstance('crawler');
 
                // Shutdown the crawler. This should be the last line
                $crawlerInstance->doShutdown();
index 483f37e047eb6136d87bd4eaf53c6356438a1dd1..777cf448a6b948e161c59803f20c94e314b52d66 100644 (file)
@@ -69,7 +69,7 @@ class MinerShutdownFilter extends BaseMinerFilter implements Filterable {
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get node instance
-               $minerInstance = ObjectRegistry::getRegistry('hub')->getInstance('miner');
+               $minerInstance = ObjectRegistry::getRegistry('factory')->getInstance('miner');
 
                // Shutdown the miner. This should be the last line
                $minerInstance->doShutdown();
index 3963a731d8cf23b64b4c8c3e2a56213e13497c5c..286d0bd1518c5e672dd5be06caa18e5ef4fb25f2 100644 (file)
@@ -69,7 +69,7 @@ class AptProxyTaskHandlerInitializerFilter extends BaseAptProxyFilter implements
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get apt-proxy instance
-               //$chatInstance = ObjectRegistry::getRegistry('hub')->getInstance('chat');
+               //$chatInstance = ObjectRegistry::getRegistry('factory')->getInstance('chat');
 
                // Get a new task handler instance
                $handlerInstance = ObjectFactory::createObjectByConfiguredName('task_handler_class');
index 35ec83c678cf7e164ee328384389350cea42bfcf..984ece31789bdb0b9579738ef688e21004007a69 100644 (file)
@@ -69,7 +69,7 @@ class ChatTaskHandlerInitializerFilter extends BaseChatFilter implements Filtera
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get chat instance
-               //$chatInstance = ObjectRegistry::getRegistry('hub')->getInstance('chat');
+               //$chatInstance = ObjectRegistry::getRegistry('factory')->getInstance('chat');
 
                // Get a new task handler instance
                $handlerInstance = ObjectFactory::createObjectByConfiguredName('task_handler_class');
index 989e231b02dcf214d0e4717abde911362c798e6a..538823da7bbdb5eb5234e793cc12acdc7c86bca1 100644 (file)
@@ -79,7 +79,7 @@ abstract class BaseCrawlerTaskFilter extends BaseCrawlerFilter {
                $handlerInstance->registerTask('crawler_snippet_extractor', $taskInstance);
 
                // Add handler instance to registry
-               ObjectRegistry::getRegistry('hub')->addInstance('task_handler', $handlerInstance);
+               ObjectRegistry::getRegistry('generic')->addInstance('task_handler', $handlerInstance);
        }
 
 }
index 204c33220be97b84a5c7f9196460c0333c165968..0c3920a0a045eca8cea8d2d9e785cd1609062fcc 100644 (file)
@@ -69,7 +69,7 @@ class MinerTaskHandlerInitializerFilter extends BaseMinerFilter implements Filte
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get miner instance
-               //$minerInstance = ObjectRegistry::getRegistry('hub')->getInstance('miner');
+               //$minerInstance = ObjectRegistry::getRegistry('factory')->getInstance('miner');
 
                // Get a new task handler instance
                $handlerInstance = ObjectFactory::createObjectByConfiguredName('task_handler_class');
index 689bc3837eb519017615571c25ae6798b87dd9af..a1136abeb57433c819651635dada0a71429a6618 100644 (file)
@@ -114,11 +114,11 @@ abstract class BaseListener extends BaseHubSystem implements Visitable {
         */
        private function handleIncomingSocket (StorableSocket $socketInstance) {
                // Handle it here, if not main server socket
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: socketInstance=%s - CALLED!', strtoupper($this->getProtocolName()), $socketInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-LISTENER: socketInstance=%s - CALLED!', strtoupper($this->getProtocolName()), $socketInstance->__toString()));
                $this->getHandlerInstance()->processRawDataFromSocketInstance($socketInstance);
 
                // Trace message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: EXIT!', strtoupper($this->getProtocolName())));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-LISTENER: EXIT!', strtoupper($this->getProtocolName())));
        }
 
        /**
@@ -229,7 +229,7 @@ abstract class BaseListener extends BaseHubSystem implements Visitable {
         */
        protected function registerServerSocketInstance (StorableSocket $socketInstance) {
                // First check if it is valid
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: socketInstance=%s - CALLED!', strtoupper($this->getProtocolName()), $socketInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-LISTENER: socketInstance=%s - CALLED!', strtoupper($this->getProtocolName()), $socketInstance->__toString()));
                if ($this->isServerSocketRegistered($socketInstance)) {
                        // Already registered
                        throw new SocketAlreadyRegisteredException(array($this, $socketInstance->getSocketResource()), self::EXCEPTION_SOCKET_ALREADY_REGISTERED);
@@ -248,15 +248,15 @@ abstract class BaseListener extends BaseHubSystem implements Visitable {
                $infoInstance->fillWithListenerInformation($this);
 
                // Register the socket
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: Registering socketInstance->socketResource=%s,socketType=%s ...', strtoupper($this->getProtocolName()), $socketInstance->getSocketResource(), $socketInstance->getSocketType()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-LISTENER: Registering socketInstance->socketResource=%s,socketType=%s ...', strtoupper($this->getProtocolName()), $socketInstance->getSocketResource(), $socketInstance->getSocketType()));
                $this->getRegistryInstance()->registerSocketInstance($infoInstance, $socketInstance);
 
                // And set it here
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: Setting socketInstance=%s (socketResource=%s) ...', strtoupper($this->getProtocolName()), $socketInstance->__toString(), $socketInstance->getSocketResource()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-LISTENER: Setting socketInstance=%s (socketResource=%s) ...', strtoupper($this->getProtocolName()), $socketInstance->__toString(), $socketInstance->getSocketResource()));
                $this->setSocketInstance($socketInstance);
 
                // Trace message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: EXIT!', strtoupper($this->getProtocolName())));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-LISTENER: EXIT!', strtoupper($this->getProtocolName())));
        }
 
        /**
@@ -268,11 +268,11 @@ abstract class BaseListener extends BaseHubSystem implements Visitable {
         */
        protected function isServerSocketRegistered (StorableSocket $socketInstance) {
                // Get a connection info instance
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: socketInstance=%s - CALLED!', strtoupper($this->getProtocolName()), $socketInstance->__toString()));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-LISTENER: socketInstance=%s - CALLED!', strtoupper($this->getProtocolName()), $socketInstance->__toString()));
                $infoInstance = ConnectionInfoFactory::createConnectionInfoInstance($this->getProtocolName(), StorableSocket::CONNECTION_TYPE_SERVER);
 
                // Is the instance set?
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: infoInstance[]=%s', strtoupper($this->getProtocolName()), gettype($infoInstance)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-LISTENER: infoInstance[]=%s', strtoupper($this->getProtocolName()), gettype($infoInstance)));
                if (!($infoInstance instanceof ShareableInfo)) {
                        // Should not happen
                        throw new LogicException(sprintf('infoInstance[]=%s does not implement ShareableInfo', gettype($infoInstance)));
@@ -282,11 +282,11 @@ abstract class BaseListener extends BaseHubSystem implements Visitable {
                $infoInstance->fillWithListenerInformation($this);
 
                // Check it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: Checking socketInstance ... (socketResource=%s)', strtoupper($this->getProtocolName()), $socketInstance->getSocketResource()));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-LISTENER: Checking socketInstance ... (socketResource=%s)', strtoupper($this->getProtocolName()), $socketInstance->getSocketResource()));
                $isRegistered = $this->getRegistryInstance()->isSocketRegistered($infoInstance, $socketInstance);
 
                // Return result
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: isRegistered=%d - EXIT!', strtoupper($this->getProtocolName()), intval($isRegistered)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-LISTENER: isRegistered=%d - EXIT!', strtoupper($this->getProtocolName()), intval($isRegistered)));
                return $isRegistered;
        }
 
@@ -298,7 +298,7 @@ abstract class BaseListener extends BaseHubSystem implements Visitable {
         */
        public function accept (Visitor $visitorInstance) {
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($this->getProtocolName()) . '-LISTENER: ' . $visitorInstance->__toString() . ' has visited ' . $this->__toString() . ' - CALLED!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(strtoupper($this->getProtocolName()) . '-LISTENER: ' . $visitorInstance->__toString() . ' has visited ' . $this->__toString() . ' - CALLED!');
 
                // Visit this listener
                $visitorInstance->visitListener($this);
@@ -310,7 +310,7 @@ abstract class BaseListener extends BaseHubSystem implements Visitable {
                }
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($this->getProtocolName()) . '-LISTENER: ' . $visitorInstance->__toString() . ' has visited ' . $this->__toString() . ' - EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(strtoupper($this->getProtocolName()) . '-LISTENER: ' . $visitorInstance->__toString() . ' has visited ' . $this->__toString() . ' - EXIT!');
        }
 
        /**
@@ -321,10 +321,10 @@ abstract class BaseListener extends BaseHubSystem implements Visitable {
         */
        public function monitorIncomingRawData () {
                // Check if an incoming socket is registered
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: CALLED!', strtoupper($this->getProtocolName())));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-LISTENER: CALLED!', strtoupper($this->getProtocolName())));
                if (!$this->getRegistryInstance()->isIncomingSocketRegistered($this)) {
                        // Skip further processing
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: No socket of type "%s" registered. - EXIT!', strtoupper($this->getProtocolName()), StorableSocket::CONNECTION_TYPE_INCOMING));
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-LISTENER: No socket of type "%s" registered. - EXIT!', strtoupper($this->getProtocolName()), StorableSocket::CONNECTION_TYPE_INCOMING));
                        return;
                }
 
@@ -333,35 +333,43 @@ abstract class BaseListener extends BaseHubSystem implements Visitable {
                $iteratorInstance = $this->getRegistryInstance()->getIterator([$this->getProtocolName()]);
 
                // Should be valid instance
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: iteratorInstance[]=%s', strtoupper($this->getProtocolName()), gettype($iteratorInstance)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-LISTENER: iteratorInstance[]=%s', strtoupper($this->getProtocolName()), gettype($iteratorInstance)));
                if (is_null($iteratorInstance)) {
                        // Throw NPE
                        throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
                }
 
                // Is it valid?
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: iteratorInstance->valid()=%d', strtoupper($this->getProtocolName()), intval($iteratorInstance->valid())));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-LISTENER: iteratorInstance->valid()=%d', strtoupper($this->getProtocolName()), intval($iteratorInstance->valid())));
                if (!$iteratorInstance->valid()) {
                        // Then rewind it
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: Rewinding iterator ...', strtoupper($this->getProtocolName())));
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-LISTENER: Rewinding iterator ...', strtoupper($this->getProtocolName())));
                        $iteratorInstance->rewind();
+
+                       // Is it still not valid?
+                       if (!$iteratorInstance->valid()) {
+                               // Then the list is empty maybe, skip below code
+                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-LISTENER: socketInstance->socketType=%s has no entries,iteratorInstance->count()=%d - EXIT!', strtoupper($this->getProtocolName()), $socketInstance->getSocketType(), $iteratorInstance->count()));
+                               return;
+                       }
                }
 
                // Get current instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-LISTENER: Invoking iteratorInstance->current() ...', strtoupper($this->getProtocolName())));
                $socketInstance = $iteratorInstance->current();
 
                // Is NULL returned?
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: socketInstance[]=%s', strtoupper($this->getProtocolName()), gettype($socketInstance)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-LISTENER: socketInstance[]=%s', strtoupper($this->getProtocolName()), gettype($socketInstance)));
                if (!($socketInstance instanceof StorableSocket)) {
                        // Then abort here
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: socketInstance=NULL - EXIT!', strtoupper($this->getProtocolName())));
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-LISTENER: socketInstance=NULL - EXIT!', strtoupper($this->getProtocolName())));
                        return;
                } elseif ($socketInstance->getSocketType() != StorableSocket::CONNECTION_TYPE_INCOMING) {
                        // Advance to next
                        $iteratorInstance->next();
 
                        // Socket is not incoming socket, may happen in current iterator implementation
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: socketInstance->socketType=%s is not wanted - EXIT!', strtoupper($this->getProtocolName()), $socketInstance->getSocketType()));
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-LISTENER: socketInstance->socketType=%s is not wanted - EXIT!', strtoupper($this->getProtocolName()), $socketInstance->getSocketType()));
                        return;
                }
 
@@ -373,7 +381,7 @@ abstract class BaseListener extends BaseHubSystem implements Visitable {
                $iteratorInstance->next();
 
                // Trace message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: EXIT!', strtoupper($this->getProtocolName())));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-LISTENER: EXIT!', strtoupper($this->getProtocolName())));
        }
 
        /**
@@ -384,7 +392,7 @@ abstract class BaseListener extends BaseHubSystem implements Visitable {
         */
        protected function doListenSocketSelect () {
                // Validate parameter and socket instance
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: CALLED!', strtoupper($this->getProtocolName())));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-LISTENER: CALLED!', strtoupper($this->getProtocolName())));
                if(!$this->getSocketInstance()->isValidSocket()) {
                        // Invalid socket
                        throw new LogicException(sprintf('this->socketInstance->socketResource=%s is not valid', $this->getSocketInstance()->getSocketResource()));
@@ -394,26 +402,26 @@ abstract class BaseListener extends BaseHubSystem implements Visitable {
                $socketInstance = SocketFactory::createNextAcceptedSocketFromPool($this->getPoolInstance(), $this->getSocketInstance());
 
                // Is socket instance set?
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: socketInstance[]=%s accepted.', strtoupper($this->getProtocolName()), gettype($socketInstance)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-LISTENER: socketInstance[]=%s accepted.', strtoupper($this->getProtocolName()), gettype($socketInstance)));
                if (!($socketInstance instanceof StorableSocket)) {
                        // Nothing has changed on the listener
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: No new connection on listener ... - EXIT!', strtoupper($this->getProtocolName())));
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-LISTENER: No new connection on listener ... - EXIT!', strtoupper($this->getProtocolName())));
                        return;
                }
 
                // Get a connection info instance
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: Creating infoInstance for connection type %s ...', strtoupper($this->getProtocolName()), StorableSocket::CONNECTION_TYPE_INCOMING));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-LISTENER: Creating infoInstance for connection type %s ...', strtoupper($this->getProtocolName()), StorableSocket::CONNECTION_TYPE_INCOMING));
                $infoInstance = ConnectionInfoFactory::createConnectionInfoInstance($this->getProtocolName(), StorableSocket::CONNECTION_TYPE_INCOMING);
 
                // Is the instance set?
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: infoInstance[]=%s', strtoupper($this->getProtocolName()), gettype($infoInstance)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-LISTENER: infoInstance[]=%s', strtoupper($this->getProtocolName()), gettype($infoInstance)));
                if (!($infoInstance instanceof ShareableInfo)) {
                        // Should not happen
                        throw new LogicException(sprintf('infoInstance[]=%s does not implement ShareableInfo', gettype($infoInstance)));
                }
 
                // Will the info instance with listener data
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: Invoking infoInstance->fillWithSocketPeerInformation(%s) ...', strtoupper($this->getProtocolName()), $socketInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-LISTENER: Invoking infoInstance->fillWithSocketPeerInformation(%s) ...', strtoupper($this->getProtocolName()), $socketInstance->__toString()));
                $infoInstance->fillWithSocketPeerInformation($socketInstance);
 
                // Init peer address/port
@@ -428,20 +436,20 @@ abstract class BaseListener extends BaseHubSystem implements Visitable {
 
                // Set all required data
                //* DEBUG-DIE: */ $infoInstance->debugInstance();
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: peerAddress=%s,peerPort=%d', strtoupper($this->getProtocolName()), $peerAddress, $peerPort));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-LISTENER: peerAddress=%s,peerPort=%d', strtoupper($this->getProtocolName()), $peerAddress, $peerPort));
                $socketInstance->setSenderAddress($peerAddress);
                $socketInstance->setSenderPort($peerPort);
 
                // Register the socket with the registry and with the faked array
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: Registering socketInstance->socketResource=%s,socketType=%s ...', strtoupper($this->getProtocolName()), $socketInstance->getSocketResource(), $socketInstance->getSocketType()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-LISTENER: Registering socketInstance->socketResource=%s,socketType=%s ...', strtoupper($this->getProtocolName()), $socketInstance->getSocketResource(), $socketInstance->getSocketType()));
                $this->getRegistryInstance()->registerSocketInstance($infoInstance, $socketInstance);
 
                // Invoke private method
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: Invoking this->handleIncomingSocket(%s) ...', strtoupper($this->getProtocolName()), $socketInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-LISTENER: Invoking this->handleIncomingSocket(%s) ...', strtoupper($this->getProtocolName()), $socketInstance->__toString()));
                $this->handleIncomingSocket($socketInstance);
 
                // Trace message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: EXIT!', strtoupper($this->getProtocolName())));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-LISTENER: EXIT!', strtoupper($this->getProtocolName())));
        }
 
        /**
@@ -452,7 +460,7 @@ abstract class BaseListener extends BaseHubSystem implements Visitable {
         */
        public function ifListenerAcceptsPackageData (DeliverablePackage $packageInstance) {
                // Check if same socket protocol
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: packageInstance=%s - CALLED!', strtoupper($this->getProtocolName()), $packageInstance));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-LISTENER: packageInstance=%s - CALLED!', strtoupper($this->getProtocolName()), $packageInstance));
                $socketProtocol = $this->getSocketInstance()->getSocketProtocol();
 
                // Get UNL instance
@@ -462,11 +470,11 @@ abstract class BaseListener extends BaseHubSystem implements Visitable {
                $unlProtocol = $locatorInstance->getUnlProtocol();
 
                // Is same protocol?
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: locatorInstance->unlProtocol=%s,socketProtocol=%s', strtoupper($this->getProtocolName()), $unlProtocol, $socketProtocol));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-LISTENER: locatorInstance->unlProtocol=%s,socketProtocol=%s', strtoupper($this->getProtocolName()), $unlProtocol, $socketProtocol));
                $accepts = ($unlProtocol == $socketProtocol);
 
                // Return the result
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: accepts=%d - EXIT!', strtoupper($this->getProtocolName()), $accepts));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('%s-LISTENER: accepts=%d - EXIT!', strtoupper($this->getProtocolName()), $accepts));
                return $accepts;
        }
 
index fb7660871473c0c10ff14bcfb64795f1daf61b29..c34a170475b075f1ac9fe331d5d1770a13bd81b7 100644 (file)
@@ -98,7 +98,7 @@ abstract class BaseHubMiner extends BaseHubSystem implements Updateable {
         */
        private function initMiner () {
                // Add own instance to registry
-               ObjectRegistry::getRegistry('hub')->addInstance('miner', $this);
+               ObjectRegistry::getRegistry('factory')->addInstance('miner', $this);
 
                // Init the state
                MinerStateFactory::createMinerStateInstanceByName('init');
index 706e2b5e5355387824b656498e191b85d8797d19..2f12486c35d717e752cbc2f0fb50d32638e1cf56 100644 (file)
@@ -157,7 +157,7 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
                $this->setCryptoInstance($cryptoInstance);
 
                // Set the node instance in registry
-               ObjectRegistry::getRegistry('hub')->addInstance('node', $this);
+               ObjectRegistry::getRegistry('factory')->addInstance('node', $this);
 
                // Init state which sets the state to 'init'
                $this->initState();
@@ -640,7 +640,7 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
                }
 
                // Get the controller here
-               $controllerInstance = ObjectRegistry::getRegistry('hub')->getInstance('controller');
+               $controllerInstance = ObjectRegistry::getRegistry('generic')->getInstance('controller');
 
                // Run all filters for the hub activation
                $controllerInstance->executeActivationFilters($requestInstance, $responseInstance);
index 2e74165db11ce2f0164cdea62b432f0e5695c42f..30ed322aa7afcefc7f782c7292ba28a2ffd766d5 100644 (file)
@@ -49,7 +49,7 @@ abstract class BaseMinerProducer extends BaseProducer {
                parent::__construct($className);
 
                // Get miner instance
-               $minerInstance = ObjectRegistry::getRegistry('hub')->getInstance('miner');
+               $minerInstance = ObjectRegistry::getRegistry('factory')->getInstance('miner');
 
                // Change state to next state
                $minerInstance->blockProducerHasInitialized($this);
index 19c5980c454df0c199d171ec3a7b5597fa081c62..c86eb9134ec581a15f11987a803e69db2fc58c71 100644 (file)
@@ -17,8 +17,8 @@ use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Registry\BaseRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Registry\Register;
-use Org\Mxchange\CoreFramework\Registry\Sub\SubRegistry;
 use Org\Mxchange\CoreFramework\Socket\SocketAlreadyRegisteredException;
 
 /**
@@ -48,9 +48,21 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke
        const EXCEPTION_SOCKET_NOT_REGISTERED = 0xd200;
 
        /**
-        * Instance of this class
+        * An instance of this class
         */
-       private static $registryInstance = NULL;
+       private static $selfInstance = NULL;
+
+       /**
+        * All instances of this class
+        */
+       private static $registryInstances = [
+               // TCP socket registry
+               StorableSocket::SOCKET_PROTOCOL_TCP  => NULL,
+               // UDP socket registry
+               StorableSocket::SOCKET_PROTOCOL_UDP  => NULL,
+               // file socket registry
+               StorableSocket::SOCKET_PROTOCOL_FILE => NULL,
+       ];
 
        /**
         * Protected constructor
@@ -59,7 +71,18 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke
         */
        private function __construct () {
                // Call parent constructor
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('SOCKET-REGISTRY: CONSTRUCTED!');
                parent::__construct(__CLASS__);
+
+               // Init all instances
+               foreach (array_keys($this->getInstanceRegistry()) as $registryKey) {
+                       // Initialize this instance
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SOCKET-REGISTRY: Initializing registryKey=%s ...', $registryKey));
+                       self::$registryInstances[$registryKey] = ObjectRegistry::getRegistry('sockets');
+               }
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('SOCKET-REGISTRY: CONSTRUCTED!');
        }
 
        /**
@@ -68,14 +91,25 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke
         * @return      $registryInstance       An instance of this class
         */
        public static final function createSocketRegistry () {
-               // Is an instance there?
-               if (is_null(self::$registryInstance)) {
-                       // Not yet, so create one
-                       self::$registryInstance = new SocketRegistry();
+               // Is there an instance?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('SOCKET-REGISTRY: self::selfInstance[]=%s - CALLED!', gettype(self::$selfInstance)));
+               if (is_null(self::$selfInstance)) {
+                       // Get instance
+                       self::$selfInstance = new SocketRegistry();
                }
 
                // Return the instance
-               return self::$registryInstance;
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('SOCKET-REGISTRY: self::selfInstance=%s - EXIT!', self::$selfInstance->__toString()));
+               return self::$selfInstance;
+       }
+
+       /**
+        * Getter for all registry instances
+        *
+        * @return      $registryInstances      An array with all registry instances
+        */
+       public final function getInstanceRegistry () {
+               return self::$registryInstances;
        }
 
        /**
@@ -85,9 +119,9 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke
         * @param       $infoInstance   An instance of a ShareableInfo class
         * @return      $key                    A string representation of the socket for the registry
         */
-       private function generateSubRegistryKeyFromInfoInstance (ShareableInfo $infoInstance) {
+       private function generateObjectRegistryKeyFromInfoInstance (ShareableInfo $infoInstance) {
                // Get connection type and port number and add both together
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: infoInstance=%s - CALLED!', $infoInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('SOCKET-REGISTRY: infoInstance=%s - CALLED!', $infoInstance->__toString()));
                $key = sprintf('%s:%s:%s:%s:%s',
                        $infoInstance->__toString(),
                        $infoInstance->getProtocolName(),
@@ -97,7 +131,7 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke
                );
 
                // Return resulting key
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: key=%s - EXIT!', $key));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('SOCKET-REGISTRY: key=%s - EXIT!', $key));
                return $key;
        }
 
@@ -108,16 +142,12 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke
         * @return      $key                    A string representation of the listener for the registry
         */
        private function getRegistryKeyFromInfo (ShareableInfo $infoInstance) {
-               // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY: ,infoInstance=' . $infoInstance->__toString() . ' - CALLED!');
-
                // Get the key
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('SOCKET-REGISTRY: infoInstance=%s - CALLED!', $infoInstance->__toString()));
                $key = $infoInstance->getProtocolName();
 
-               // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY: key=' .  $key . ' - EXIT!');
-
                // Return resulting key
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('SOCKET-REGISTRY: key=%s - EXIT!', $key));
                return $key;
        }
 
@@ -128,19 +158,15 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke
         * @return      $isRegistered   Whether the listener is registered
         */
        private function isInfoRegistered (ShareableInfo $infoInstance) {
-               // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY: protocolName=' . $infoInstance->getProtocolName() . ' - CALLED!');
-
                // Get the key
-               $key = $this->getRegistryKeyFromInfo($infoInstance);
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('SOCKET-REGISTRY: protocolName=' . $infoInstance->getProtocolName() . ' - CALLED!');
+               $key = $this->generateObjectRegistryKeyFromInfoInstance($infoInstance);
 
                // Determine it
-               $isRegistered = $this->instanceExists($key);
-
-               // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY: protocolName=' . $infoInstance->getProtocolName() . ',isRegistered=' . intval($isRegistered) . ' - EXIT!');
+               $isRegistered = self::$registryInstances[$infoInstance->getProtocolName()]->instanceExists($key);
 
                // Return result
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('SOCKET-REGISTRY: protocolName=' . $infoInstance->getProtocolName() . ',isRegistered=' . intval($isRegistered) . ' - EXIT!');
                return $isRegistered;
        }
 
@@ -154,42 +180,38 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke
         */
        public function isSocketRegistered (ShareableInfo $infoInstance, StorableSocket $socketInstance) {
                // Default is not registered
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY: protocolName=' . $infoInstance->getProtocolName() . ',socketResource[' . gettype($socketInstance->getSocketResource()) . ']=' . $socketInstance->getSocketResource() . ' - CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('SOCKET-REGISTRY: protocolName=' . $infoInstance->getProtocolName() . ',socketResource[' . gettype($socketInstance->getSocketResource()) . ']=' . $socketInstance->getSocketResource() . ' - CALLED!');
                $isRegistered = FALSE;
 
                // First, check for the instance, there can be only once
                if ($this->isInfoRegistered($infoInstance)) {
                        // That one is found so "get" a registry key from it
-                       $key = $this->getRegistryKeyFromInfo($infoInstance);
+                       $key = $this->generateObjectRegistryKeyFromInfoInstance($infoInstance);
 
                        // Get the registry
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY: protocolName=' . $infoInstance->getProtocolName() . ',socketResource[' . gettype($socketInstance->getSocketResource()) . ']=' . $socketInstance->getSocketResource() . ',key=' . $key . ' - Trying to get instance ...');
-                       $registryInstance = $this->getInstance($key);
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('SOCKET-REGISTRY: protocolName=' . $infoInstance->getProtocolName() . ',socketResource[' . gettype($socketInstance->getSocketResource()) . ']=' . $socketInstance->getSocketResource() . ',key=' . $key . ' - Trying to get instance ...');
+                       $registryInstance = self::$registryInstances[$infoInstance->getProtocolName()]->getInstance($key);
 
                        // "Get" a key for the socket
-                       $socketKey = $this->generateSubRegistryKeyFromInfoInstance($infoInstance);
-
-                       // Debug message
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY: protocolName=' . $infoInstance->getProtocolName() . ',socketResource[' . gettype($socketInstance->getSocketResource()) . ']=' . $socketInstance->getSocketResource() . ',key=' . $key . ',socketKey=' . $socketKey . ' - Checking existence ...');
+                       $socketKey = $this->generateObjectRegistryKeyFromInfoInstance($infoInstance);
 
                        // Is it there?
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('SOCKET-REGISTRY: protocolName=' . $infoInstance->getProtocolName() . ',socketResource[' . gettype($socketInstance->getSocketResource()) . ']=' . $socketInstance->getSocketResource() . ',key=' . $key . ',socketKey=' . $socketKey . ' - Checking existence ...');
                        if ($registryInstance->instanceExists($socketKey)) {
-                               // Debug message
-                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY: Found instance for socketKey=' . $socketKey . ':' . $registryInstance->getInstance($socketKey));
-
                                // Get the instance
+                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('SOCKET-REGISTRY: Found instance for socketKey=' . $socketKey . ':' . $registryInstance->getInstance($socketKey));
                                $registeredInstance = $registryInstance->getInstance($socketKey);
 
                                // Is it StorableSocket and same socket?
                                $isRegistered = (($registeredInstance instanceof StorableSocket) && ($registeredInstance->equals($socketInstance)));
 
                                // Debug message
-                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY: Final result: isRegistered(' . $socketInstance->getSocketResource() . ')=' . intval($isRegistered));
+                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('SOCKET-REGISTRY: Final result: isRegistered(' . $socketInstance->getSocketResource() . ')=' . intval($isRegistered));
                        }
                }
 
                // Return the result
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY: protocolName=' . $infoInstance->getProtocolName() . ',socketResource[' . gettype($socketInstance->getSocketResource()) . ']=' . $socketInstance->getSocketResource() . ',isRegistered=' . intval($isRegistered) . ' - EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('SOCKET-REGISTRY: protocolName=' . $infoInstance->getProtocolName() . ',socketResource[' . gettype($socketInstance->getSocketResource()) . ']=' . $socketInstance->getSocketResource() . ',isRegistered=' . intval($isRegistered) . ' - EXIT!');
                return $isRegistered;
        }
 
@@ -203,39 +225,29 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke
         */
        public function registerSocketInstance (ShareableInfo $infoInstance, StorableSocket $socketInstance) {
                // Is the socket already registered?
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: infoInstance->protocolName=%s,infoInstance->socketResource[%s]=%s - CALLED!', $infoInstance->getProtocolName(), gettype($socketInstance->getSocketResource()), $socketInstance->getSocketResource()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('SOCKET-REGISTRY: infoInstance->protocolName=%s,infoInstance->socketResource[%s]=%s - CALLED!', $infoInstance->getProtocolName(), gettype($socketInstance->getSocketResource()), $socketInstance->getSocketResource()));
                if ($this->isSocketRegistered($infoInstance, $socketInstance)) {
                        // Throw the exception
                        throw new SocketAlreadyRegisteredException(array($infoInstance, $socketInstance->getSocketResource()), BaseListener::EXCEPTION_SOCKET_ALREADY_REGISTERED);
                }
 
+               // Create registry key
+               $socketKey = $this->generateObjectRegistryKeyFromInfoInstance($infoInstance);
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SOCKET-REGISTRY: socketKey=%s', $socketKey));
+
                // Does the instance exist?
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: Checking if infoInstance=%s is registered ...', $infoInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SOCKET-REGISTRY: Checking if infoInstance=%s is registered ...', $infoInstance->__toString()));
                if (!$this->isInfoRegistered($infoInstance)) {
-                       // No, not found so we create a sub registry (not needed to configure!)
-                       $registryInstance = SubRegistry::createSubRegistry();
-
                        // Now we can create the sub-registry for this info
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: Adding infoInstance=%s to registry ...', $infoInstance->__toString()));
-                       $this->addInstance($this->getRegistryKeyFromInfo($infoInstance), $registryInstance);
-               } else {
-                       // Get the sub-registry back
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: Getting sub-registry from infoInstance=%s ...', $infoInstance->__toString()));
-                       $registryInstance = $this->getInstance($this->getRegistryKeyFromInfo($infoInstance));
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SOCKET-REGISTRY: Adding socketInstance=%s to registry ...', $socketInstance->__toString()));
+                       self::$registryInstances[$socketInstance->getSocketProtocol()]->addInstance($socketKey, $socketInstance);
                }
 
-               // Get a key for sub-registries
-               $socketKey = $this->generateSubRegistryKeyFromInfoInstance($infoInstance);
-
-               // We have a sub-registry, the socket key and the socket, now we need to put all together
-               /* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: socketKey=%s,socketResource[%s]=%s - adding socket container instance ...', $socketKey, gettype($socketInstance->getSocketResource()), $socketInstance->getSocketResource()));
-               $registryInstance->addInstance($socketKey, $socketInstance);
-
                // Also register all instances from info instance in socket
                $socketInstance->registerInfoInstance($infoInstance);
 
                // Trace message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY: EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('SOCKET-REGISTRY: EXIT!');
        }
 
        /**
@@ -247,28 +259,21 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke
         */
        public function getRegisteredSocketResource (Listenable $listenerInstance) {
                // The socket must be registered before we can return it
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: listenerInstance=%s - CALLED!', $listenerInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('SOCKET-REGISTRY: listenerInstance=%s - CALLED!', $listenerInstance->__toString()));
                if (!$this->isInfoRegistered($listenerInstance)) {
                        // Throw the exception
                        throw new NoSocketRegisteredException ($listenerInstance, self::EXCEPTION_SOCKET_NOT_REGISTERED);
                }
 
-               // Now get the key from the listener
-               $registryKey = $this->getRegistryKeyFromInfo($listenerInstance);
-
                // Get a socket key
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: registryKey=%s', $registryKey));
-               $socketKey = $this->generateSubRegistryKeyFromInfoInstance($listenerInstance);
-
-               // Get the registry
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: socketKey=%s', $socketKey));
-               $registryInstance = $this->getInstance($registryKey);
+               $socketKey = $this->generateObjectRegistryKeyFromInfoInstance($listenerInstance);
 
-               // And the final socket resource
-               $socketInstance = $registryInstance->getInstance($socketKey);
+               // Get socket resource
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SOCKET-REGISTRY: socketKey=%s', $socketKey));
+               $socketInstance = self::$registryInstances[$listenerInstance->getProtocolName()]->getInstance($socketKey);
 
                // Return the resource
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: listenerInstance=%s,socketInstance[]=%s - EXIT!', $listenerInstance->__toString(), gettype($socketInstance)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('SOCKET-REGISTRY: listenerInstance=%s,socketInstance[]=%s - EXIT!', $listenerInstance->__toString(), gettype($socketInstance)));
                return $socketInstance;
        }
 
@@ -280,42 +285,42 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke
         */
        public function determineInfoInstanceByPackageInstance (DeliverablePackage $packageInstance) {
                // Init info instance
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: packageInstance=%s - CALLED!', $packageInstance));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('SOCKET-REGISTRY: packageInstance=%s - CALLED!', $packageInstance));
                $infoInstance = NULL;
                //* DEBUG-DIE: */ die(__METHOD__ . ':packageInstance=' . print_r($packageInstance, TRUE));
 
                // Get all keys and check them
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: this->instanceRegistry()=%d', count($this->getInstanceRegistry())));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SOCKET-REGISTRY: this->instanceRegistry()=%d', count($this->getInstanceRegistry())));
                foreach ($this->getInstanceRegistry() as $key => $registryInstance) {
                        // This is always a SubRegistry instance
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: key=%s,registryInstance=%s', $key, $registryInstance->__toString()));
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SOCKET-REGISTRY: key=%s,registryInstance=%s', $key, $registryInstance->__toString()));
                        foreach ($registryInstance->getInstanceRegistry() as $subKey => $socketInstance) {
                                // Is this a StorableSocket instance and is the address the same?
-                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: key=%s,subKey=%s,socketInstance=%s', $key, $subKey, $socketInstance->__toString()));
+                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SOCKET-REGISTRY: key=%s,subKey=%s,socketInstance=%s', $key, $subKey, $socketInstance->__toString()));
                                if (($socketInstance instanceof StorableSocket) && ($socketInstance->ifAddressMatches($packageInstance->getRecipientUnl()))) {
                                        // Get listener and helper instances
-                                       /* NOSY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: key=%s,subKey=%s, calling socketInstance->getListenerInstance() ...', $key, $subKey));
+                                       /* NOSY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SOCKET-REGISTRY: key=%s,subKey=%s, calling socketInstance->getListenerInstance() ...', $key, $subKey));
                                        //* DEBUG-DIE: */ die(__METHOD__ . ': socketInstance=' . print_r($socketInstance, TRUE));
                                        $listenerInstance = $socketInstance->getListenerInstance();
                                        $helperInstance = $socketInstance->getHelperInstance();
 
                                        // Is a listener or helper set?
-                                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: key=%s,subKey=%s,listenerInstance[]=%s,helperInstance[]=%s', $key, $subKey, gettype($listenerInstance), gettype($helperInstance)));
+                                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SOCKET-REGISTRY: key=%s,subKey=%s,listenerInstance[]=%s,helperInstance[]=%s', $key, $subKey, gettype($listenerInstance), gettype($helperInstance)));
                                        if ($listenerInstance instanceof Listenable) {
                                                // Found a listener, so get the info instance first
-                                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: key=%s,subKey=%s: Getting infoInstance for listenerInstance->protocolName=%s ...', $key, $subKey, $listenerInstance->getProtocolName()));
+                                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SOCKET-REGISTRY: key=%s,subKey=%s: Getting infoInstance for listenerInstance->protocolName=%s ...', $key, $subKey, $listenerInstance->getProtocolName()));
                                                $infoInstance = ConnectionInfoFactory::createConnectionInfoInstance($listenerInstance->getProtocolName(), 'helper');
 
                                                // Fill info instance with listener data
-                                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: key=%s,subKey=%s: Invoking infoInstance->fillWithListenerInformation(%s) ...', $key, $subKey, $listenerInstance->__toString()));
+                                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SOCKET-REGISTRY: key=%s,subKey=%s: Invoking infoInstance->fillWithListenerInformation(%s) ...', $key, $subKey, $listenerInstance->__toString()));
                                                $infoInstance->fillWithListenerInformation($listenerInstance);
                                        } elseif ($helperInstance instanceof ConnectionHelper) {
                                                // Found a helper, so get the info instance first
-                                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: key=%s,subKey=%s: Getting infoInstance for helperInstance->protocolName=%s ...', $key, $subKey, $helperInstance->getProtocolName()));
+                                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SOCKET-REGISTRY: key=%s,subKey=%s: Getting infoInstance for helperInstance->protocolName=%s ...', $key, $subKey, $helperInstance->getProtocolName()));
                                                $infoInstance = ConnectionInfoFactory::createConnectionInfoInstance($helperInstance->getProtocolName(), 'helper');
 
                                                // Helper is found
-                                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: key=%s,subKey=%s: Invoking infoInstance->fillWithHelperInformation(%s) ...', $key, $subKey, $helperInstance->__toString()));
+                                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SOCKET-REGISTRY: key=%s,subKey=%s: Invoking infoInstance->fillWithHelperInformation(%s) ...', $key, $subKey, $helperInstance->__toString()));
                                                $infoInstance->fillWithConnectionHelperInformation($helperInstance);
                                        } else {
                                                // Not supported state!
@@ -323,22 +328,22 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke
                                        }
 
                                        // Debug message
-                                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: key=%s,subKey=%s,infoInstance[%s]=%s with protocol %s - FOUND!', $key, $subKey, gettype($infoInstance), $infoInstance->__toString(), $infoInstance->getProtocolName()));
+                                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SOCKET-REGISTRY: key=%s,subKey=%s,infoInstance[%s]=%s with protocol %s - FOUND!', $key, $subKey, gettype($infoInstance), $infoInstance->__toString(), $infoInstance->getProtocolName()));
                                        break;
                                }
                        }
 
                        // Is no longer NULL set?
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: infoInstance[]=%s', gettype($infoInstance)));
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SOCKET-REGISTRY: infoInstance[]=%s', gettype($infoInstance)));
                        if (!is_null($infoInstance)) {
                                // Then skip here, too
-                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY: BREAK!');
+                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('SOCKET-REGISTRY: BREAK!');
                                break;
                        }
                }
 
                // Return the info instance
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: infoInstance[]=%s - EXIT!', gettype($infoInstance)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('SOCKET-REGISTRY: infoInstance[]=%s - EXIT!', gettype($infoInstance)));
                return $infoInstance;
        }
 
@@ -351,18 +356,18 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke
         */
        public function isIncomingSocketRegistered (Listenable $listenerInstance) {
                // Default is not found
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: listenerInstance=%s (protocol: %s) - CALLED!', $listenerInstance->__toString(), strtoupper($listenerInstance->getProtocolName())));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('SOCKET-REGISTRY: listenerInstance=%s (protocol: %s) - CALLED!', $listenerInstance->__toString(), strtoupper($listenerInstance->getProtocolName())));
                //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: this=%s', __METHOD__, __LINE__, print_r($this, TRUE)));
                $isRegistered = FALSE;
 
                // Search listener's socket sub-registry
-               $registryInstance = $this->getInstance($listenerInstance->getProtocolName());
+               $registryInstance = self::$registryInstances[$listenerInstance->getProtocolName()];
                //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: listenerInstance->protocolName=%s,registryInstance=%s', __METHOD__, __LINE__, $listenerInstance->getProtocolName(), print_r($registryInstance, TRUE)));
 
                // Get all sockets from it
                foreach ($registryInstance->getInstanceRegistry() as $instanceKey => $socketInstance) {
                        // Is this socket as requested?
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: instanceKey=%s,socketInstance=%s,socketType=%s', $instanceKey, $socketInstance->__toString(), $socketInstance->getSocketType()));
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('SOCKET-REGISTRY: instanceKey=%s,socketInstance=%s,socketType=%s', $instanceKey, $socketInstance->__toString(), $socketInstance->getSocketType()));
                        //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: socketInstance=%s', __METHOD__, __LINE__, print_r($socketInstance, TRUE)));
                        if ($socketInstance->getSocketType() == StorableSocket::CONNECTION_TYPE_INCOMING) {
                                // Is found!
@@ -372,7 +377,7 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke
                }
 
                // Return status
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: isRegistered=%d - EXIT!', intval($isRegistered)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('SOCKET-REGISTRY: isRegistered=%d - EXIT!', intval($isRegistered)));
                return $isRegistered;
        }
 
index bc16f337aec2c6b1bbad268dcf639a96c538a4e1..22c4d9628e19a7f0e5d57c47b1eff69eac84c381 100644 (file)
@@ -81,7 +81,7 @@ class CrawlerNodeCommunicatorTask extends BaseHubTask implements Taskable, Visit
                $communicatorInstance = CommunicatorFactory::createCommunicatorInstance('crawler_node_communicator_class', 'node');
 
                // Get the current crawler state from registry
-               $stateInstance = ObjectRegistry::getRegistry('hub')->getInstance('crawler')->getStateInstance();
+               $stateInstance = ObjectRegistry::getRegistry('factory')->getInstance('crawler')->getStateInstance();
 
                // Debug message
                /* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-NODE-COMMUNICATOR-TASK: Executing stateInstance=' . $stateInstance->__toString());
index bf48d45c7f17d49ee7b32aefad52c38590ec76ca..3cba4fa199ef4cc6db7b649ba1ee75fa8567bc81 100644 (file)
@@ -85,7 +85,7 @@ class MinerBlockFetcherTask extends BaseHubTask implements Taskable, Visitable {
                 *
                 * Please report any bugs you encounter to me.
                 */
-               ObjectRegistry::getRegistry('hub')->getInstance('miner')->doSearchForBlocks();
+               ObjectRegistry::getRegistry('factory')->getInstance('miner')->doSearchForBlocks();
        }
 
        /**
index d323429916cd7bc13969694bfd61959933d4209c..7412f9cd75a427e29da9cfe1d4d33186bff27152 100644 (file)
@@ -80,7 +80,7 @@ class MinerRealGenesisBlockProducerTask extends BaseHubTask implements Taskable,
                $producerInstance = ProducerFactory::createProducerInstance('miner_real_genesis_block_producer_class', 'real_unit');
 
                // Get the current miner state from registry
-               $stateInstance = ObjectRegistry::getRegistry('hub')->getInstance('miner')->getStateInstance();
+               $stateInstance = ObjectRegistry::getRegistry('factory')->getInstance('miner')->getStateInstance();
 
                // Debug message
                /* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MINER-GENESIS-BLOCK-PRODUCER-TASK: Executing stateInstance=' . $stateInstance->__toString());
index 26ad2e2a13874c552ce726d4d1e139e10358a461..900717d7bb612074d2893ec3391fc2f3feec03f4 100644 (file)
@@ -80,7 +80,7 @@ class MinerTestGenesisBlockProducerTask extends BaseHubTask implements Taskable,
                $producerInstance = ProducerFactory::createProducerInstance('miner_test_genesis_block_producer_class', 'test_unit');
 
                // Get the current miner state from registry
-               $stateInstance = ObjectRegistry::getRegistry('hub')->getInstance('miner')->getStateInstance();
+               $stateInstance = ObjectRegistry::getRegistry('factory')->getInstance('miner')->getStateInstance();
 
                // Debug message
                /* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MINER-TEST-GENESIS-BLOCK-PRODUCER-TASK: Executing stateInstance=' . $stateInstance->__toString());
diff --git a/core b/core
index d80aa06027f7eafcabc7c5e307d2126456a6dc0a..4fc7b52c4eb7287dbfd78bd4bdc8adaea03f7d5c 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit d80aa06027f7eafcabc7c5e307d2126456a6dc0a
+Subproject commit 4fc7b52c4eb7287dbfd78bd4bdc8adaea03f7d5c