]> git.mxchange.org Git - hub.git/commitdiff
Register the task handler after it has been created as some tasks may need it
authorRoland Haeder <roland@mxchange.org>
Sat, 7 Mar 2015 18:04:42 +0000 (19:04 +0100)
committerRoland Haeder <roland@mxchange.org>
Sat, 7 Mar 2015 18:04:42 +0000 (19:04 +0100)
during initialization phase.

Signed-off-by: Roland Haeder <roland@mxchange.org>
application/hub/main/filter/task/apt-proxy/class_AptProxyTaskHandlerInitializerFilter.php
application/hub/main/filter/task/chat/class_ChatTaskHandlerInitializerFilter.php
application/hub/main/filter/task/crawler/class_CrawlerTaskHandlerInitializerFilter.php
application/hub/main/filter/task/cruncher/class_CruncherTaskHandlerInitializerFilter.php
application/hub/main/filter/task/miner/class_MinerTaskHandlerInitializerFilter.php
application/hub/main/filter/task/node/class_NodeTaskHandlerInitializerFilter.php

index a395759675c41b01bc4fb4d89731765835963a3d..17e808a6276d2c15127747ab0d63ceb08d1684eb 100644 (file)
@@ -61,6 +61,9 @@ class AptProxyTaskHandlerInitializerFilter extends BaseAptProxyFilter implements
                // Get a new task handler instance
                $handlerInstance = ObjectFactory::createObjectByConfiguredName('task_handler_class');
 
+               // Put the task handler in registry
+               Registry::getRegistry()->addInstance('task_handler', $handlerInstance);
+
                /*
                 * Register all tasks:
                 *
@@ -68,9 +71,6 @@ class AptProxyTaskHandlerInitializerFilter extends BaseAptProxyFilter implements
                 */
                $taskInstance = ObjectFactory::createObjectByConfiguredName('apt_proxy_listener_task_class');
                $handlerInstance->registerTask('apt_proxy_listener', $taskInstance);
-
-               // Put the task handler in registry
-               Registry::getRegistry()->addInstance('task_handler', $handlerInstance);
        }
 }
 
index 178f70743a4828d5bb11eefcc65e3cf3fa3d4ec8..85db533fb2ed28b4a7ab4c07525e048549cdf442 100644 (file)
@@ -61,6 +61,9 @@ class ChatTaskHandlerInitializerFilter extends BaseChatFilter implements Filtera
                // Get a new task handler instance
                $handlerInstance = ObjectFactory::createObjectByConfiguredName('task_handler_class');
 
+               // Put the task handler in registry
+               Registry::getRegistry()->addInstance('task_handler', $handlerInstance);
+
                /*
                 * Register all tasks:
                 *
@@ -68,9 +71,6 @@ class ChatTaskHandlerInitializerFilter extends BaseChatFilter implements Filtera
                 */
                $taskInstance = ObjectFactory::createObjectByConfiguredName('chat_telnet_listener_task_class');
                $handlerInstance->registerTask('chat_telnet_listener', $taskInstance);
-
-               // Put the task handler in registry
-               Registry::getRegistry()->addInstance('task_handler', $handlerInstance);
        }
 }
 
index d5af2cc51f108c6da14b564e608d76d206ad6f9c..1a5ee9eb7cc8c25f42c85417088c72779b612915 100644 (file)
@@ -61,6 +61,9 @@ class CrawlerTaskHandlerInitializerFilter extends BaseCrawlerFilter implements F
                // Get a new task handler instance
                $handlerInstance = ObjectFactory::createObjectByConfiguredName('task_handler_class');
 
+               // Put the task handler in registry
+               Registry::getRegistry()->addInstance('task_handler', $handlerInstance);
+
                /*
                 * Register all tasks:
                 *
@@ -113,9 +116,6 @@ class CrawlerTaskHandlerInitializerFilter extends BaseCrawlerFilter implements F
                // 11) Uploaded list scanner (checks for wanted files)
                $taskInstance = ObjectFactory::createObjectByConfiguredName('crawler_uploaded_list_scanner_task_class');
                $handlerInstance->registerTask('crawler_uploaded_list_scanner', $taskInstance);
-
-               // Put the task handler in registry
-               Registry::getRegistry()->addInstance('task_handler', $handlerInstance);
        }
 }
 
index 0b49446e9a5f24f87f35ef71067911bcfaacf1c2..2d0095ec2f74d6338a52ad51b396b9d7994a3260 100644 (file)
@@ -61,6 +61,9 @@ class CruncherTaskHandlerInitializerFilter extends BaseCruncherFilter implements
                // Get a new task handler instance
                $handlerInstance = ObjectFactory::createObjectByConfiguredName('task_handler_class');
 
+               // Put the task handler in registry
+               Registry::getRegistry()->addInstance('task_handler', $handlerInstance);
+
                // Register all tasks:
                //
                // 1) A task for fetching WUs (work units) or test units
@@ -82,9 +85,6 @@ class CruncherTaskHandlerInitializerFilter extends BaseCruncherFilter implements
                 */
                $taskInstance = ObjectFactory::createObjectByConfiguredName('cruncher_key_producer_task_class');
                $handlerInstance->registerTask('cruncher_key_producer', $taskInstance);
-
-               // Put the task handler in registry
-               Registry::getRegistry()->addInstance('task_handler', $handlerInstance);
        }
 }
 
index fefaf3c1e0ca4f19010b5e85785ada3714765da3..742b40be42e2781e7aa3628d05c43dade2f865bc 100644 (file)
@@ -61,6 +61,9 @@ class MinerTaskHandlerInitializerFilter extends BaseMinerFilter implements Filte
                // Get a new task handler instance
                $handlerInstance = ObjectFactory::createObjectByConfiguredName('task_handler_class');
 
+               // Put the task handler in registry
+               Registry::getRegistry()->addInstance('task_handler', $handlerInstance);
+
                // Register all tasks:
                //
                // 1) A task for fetching blocks from the network
@@ -82,9 +85,6 @@ class MinerTaskHandlerInitializerFilter extends BaseMinerFilter implements Filte
                 */
                $taskInstance = ObjectFactory::createObjectByConfiguredName('miner_node_communicator_task_class');
                $handlerInstance->registerTask('miner_node_communicator', $taskInstance);
-
-               // Put the task handler in registry
-               Registry::getRegistry()->addInstance('task_handler', $handlerInstance);
        }
 }
 
index 631ba93848770ef279ad026c584d9ec2d4f4a601..abc35dc35ab6f938f233f07366867b6651bbae7c 100644 (file)
@@ -61,6 +61,9 @@ class NodeTaskHandlerInitializerFilter extends BaseNodeFilter implements Filtera
                // Get a new task handler instance
                $handlerInstance = ObjectFactory::createObjectByConfiguredName('task_handler_class');
 
+               // Put the task handler in registry
+               Registry::getRegistry()->addInstance('task_handler', $handlerInstance);
+
                // Prepare a package-tags initialization task for the listeners
                $taskInstance = ObjectFactory::createObjectByConfiguredName('node_package_tags_init_task_class');
 
@@ -142,9 +145,6 @@ class NodeTaskHandlerInitializerFilter extends BaseNodeFilter implements Filtera
                // Register it
                $handlerInstance->registerTask('ping', $taskInstance);
 
-               // Put the task handler in registry
-               Registry::getRegistry()->addInstance('task_handler', $handlerInstance);
-
                /*
                 * Allow extra node-depending tasks, e.g. the bootstrapper node needs
                 * booting its DHT. DHTs are decentralized and are working on