]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/tasks/cruncher/class_CruncherKeyProducerTask.php
New singleton-factories introduced:
[hub.git] / application / hub / main / tasks / cruncher / class_CruncherKeyProducerTask.php
index 43673a23b01bd088b592f2435e61d3c98db22404..379011d14b19116e7af9a213c6eb3bd41b793178 100644 (file)
@@ -63,17 +63,8 @@ class CruncherKeyProducerTask extends BaseTask implements Taskable, Visitable {
         * @return      void
         */
        public function executeTask () {
-               // First we check if we already have an instance (which will happen at any later cyclus)
-               if (!Registry::getRegistry()->instanceExists('key_producer')) {
-                       // No instance found, so we need to create a producer instance
-                       $producerInstance = ObjectFactory::createObjectByConfiguredName('cruncher_key_producer_class');
-
-                       // ... and add it to the registry
-                       Registry::getRegistry()->addInstance('key_producer', $producerInstance);
-               } else {
-                       // Get the producer instance from registry
-                       $producerInstance = Registry::getRegistry()->getInstance('key_producer');
-               }
+               // Get the instance
+               $producerInstance = ProducerFactory::createProducerInstance('cruncher_key_producer_class', 'key');
 
                // Get the current cruncher state from registry
                $stateInstance = Registry::getRegistry()->getInstance('cruncher')->getStateInstance();