- There is currently a loop in the cruncher class which is not recommended but maybe fine here
application/hub/interfaces/visitor/queue/class_QueueVisitor.php svneol=native#text/plain
application/hub/interfaces/visitor/tasks/.htaccess -text svneol=unset#text/plain
application/hub/interfaces/visitor/tasks/class_TaskVisitor.php -text svneol=unset#text/plain
+application/hub/interfaces/work_units/.htaccess svneol=native#text/plain
+application/hub/interfaces/work_units/class_UnitHelper.php svneol=native#text/plain
application/hub/loader.php -text svneol=unset#text/plain
application/hub/main/.htaccess -text svneol=unset#text/plain
application/hub/main/class_ -text svneol=unset#text/plain
application/hub/main/helper/hub/class_BaseHubHelper.php -text svneol=unset#text/plain
application/hub/main/helper/hub/connection/.htaccess -text svneol=unset#text/plain
application/hub/main/helper/hub/connection/class_HubSelfConnectHelper.php svneol=native#text/plain
+application/hub/main/helper/work_units/.htaccess svneol=native#text/plain
+application/hub/main/helper/work_units/class_ -text
+application/hub/main/helper/work_units/class_BaseWorkUnitHelper.php svneol=native#text/plain
+application/hub/main/helper/work_units/cruncher/.htaccess svneol=native#text/plain
+application/hub/main/helper/work_units/cruncher/class_CruncherTestUnitHelper.php svneol=native#text/plain
application/hub/main/iterator/.htaccess -text svneol=unset#text/plain
application/hub/main/iterator/class_ -text svneol=unset#text/plain
application/hub/main/iterator/class_BaseIterator.php -text svneol=unset#text/plain
// CFG: PACKAGE-FRAGMENTER-CLASS
$cfg->setConfigEntry('package_fragmenter_class', 'PackageFragmenter');
-// CFG: CRUNCHER-ALLOW-TEST-WORK-UNITS
-$cfg->setConfigEntry('cruncher_allow_test_units', 'Y');
+// CFG: CRUNCHER-TEST-UNITS-ENABLED
+$cfg->setConfigEntry('cruncher_test_units_enabled', 'Y');
// CFG: CRUNCHER-IN-BUFFER-MIN-THRESHOLD
$cfg->setConfigEntry('cruncher_in_buffer_min_threshold', 3);
+// CFG: CRUNCHER-TEST-UNIT-GENERATOR-CLASS
+$cfg->setConfigEntry('cruncher_test_unit_generator_class', 'CruncherTestUnitHelper');
+
+// CFG: CRUNCHER-MAX-TEST-UNIT-AMOUNT
+$cfg->setConfigEntry('cruncher_max_text_unit_amount', 10);
+
// [EOF]
?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * An interface for work/test/foo unit helper
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface UnitHelper extends FrameworkInterface {
+ /**
+ * Generates a work/test/foo unit instance
+ *
+ * @return $unitInstance A work unit instance
+ */
+ function generateUnit ();
+}
+
+// [EOF]
+?>
$this->fillInBufferQueueWithWorkUnits();
// Is the buffer still not filled and are test-packages allowed?
- if ((!$this->isInBufferQueueFilled()) && ($this->getConfigInstance()->getConfigEntry('cruncher_allow_test_units') == 'Y')) {
+ if ((!$this->isInBufferQueueFilled()) && ($this->getConfigInstance()->getConfigEntry('cruncher_test_units_enabled') == 'Y')) {
// Then fill the in-buffer with (one) test-unit(s)
$this->fillInBufferQueueWithTestUnits();
} // END - if
* @return void
*/
protected function fillInBufferQueueWithTestUnits () {
- $this->partialStub('Please implement this method.');
+ // Are test units enabled?
+ if ($this->getConfigInstance()->getConfigEntry('cruncher_test_units_enabled') == 'N') {
+ // They are disabled, so skip any further steps
+ return;
+ } // END - if
+
+ // Get a test-unit generator instance
+ $generatorInstance = ObjectFactory::createObjectByConfiguredName('cruncher_test_unit_generator_class');
+
+ // We don't need an iterator here because we just need to generate some test units
+ for ($idx = 0; $idx < $this->getConfigInstance()->getConfigEntry('cruncher_max_text_unit_amount'); $idx++) {
+ // Get a test unit from it
+ $unitInstance = $generatorInstance->generateUnit();
+
+ // ... and finally queue it to the in-buffer queue
+ $this->queueUnitInstanceToInBuffer($unitInstance);
+ } // END - for
}
/**
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A ??? work unit helper
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ???WorkUnitHelper extends BaseWorkUnitHelper implements UnitHelper {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @return $unitInstance An instance of a UnitHelper class
+ */
+ public final static function create???WorkUnitHelper () {
+ // Get new instance
+ $unitInstance = new ???WorkUnitHelper();
+
+ // Return the prepared instance
+ return $unitInstance;
+ }
+
+ /**
+ * Generates a work/test/foo unit instance
+ *
+ * @return $unitInstance A work unit instance
+ * @todo 0% done
+ */
+ public function generateUnit () {
+ $this->partialStub('Please implement this method.');
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * A general WorkUnit class
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseWorkUnitHelper extends BaseFrameworkSystem {
+ /**
+ * Protected constructor
+ *
+ * @param $className Name of the class
+ * @return void
+ */
+ protected function __construct ($className) {
+ // Call parent constructor
+ parent::__construct($className);
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A ??? work unit helper
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class CruncherTestUnitHelper extends BaseWorkUnitHelper implements UnitHelper {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @return $unitInstance An instance of a UnitHelper class
+ */
+ public final static function createCruncherTestUnitHelper () {
+ // Get new instance
+ $unitInstance = new CruncherTestUnitHelper();
+
+ // Return the prepared instance
+ return $unitInstance;
+ }
+
+ /**
+ * Generates a work/test/foo unit instance
+ *
+ * @return $unitInstance A work unit instance
+ * @todo 0% done
+ */
+ public function generateUnit () {
+ $this->partialStub('Please implement this method.');
+ }
+}
+
+// [EOF]
+?>
./application/hub/main/connectors/query/local/class_LocalQueryConnector.php:10: * @todo Find an interface for: handleAllQueries()
./application/hub/main/connectors/query/local/class_LocalQueryConnector.php:78: * @TODO 0% done: Unfinished work here
./application/hub/main/connectors/queues/local/class_LocalQueueConnector.php:58: * @TODO 0% done: Unfinished work here
-./application/hub/main/cruncher/class_BaseHubCruncher.php:131: * @todo Try to make this method more generic so we can move it in BaseFrameworkSystem
-./application/hub/main/cruncher/mcrypt/class_HubMcryptCruncher.php:112: * @todo 0% done
-./application/hub/main/cruncher/mcrypt/class_HubMcryptCruncher.php:61: * @todo Implement this method
+./application/hub/main/cruncher/class_BaseHubCruncher.php:154: * @todo Try to make this method more generic so we can move it in BaseFrameworkSystem
+./application/hub/main/cruncher/mcrypt/class_HubMcryptCruncher.php:128: * @todo 0% done
+./application/hub/main/cruncher/mcrypt/class_HubMcryptCruncher.php:98: * @todo Implement this method
./application/hub/main/discovery/socket/class_PackageSocketDiscovery.php:102: // @TODO We may need some locking here
./application/hub/main/factories/socket/class_SocketFactory.php:10: * @todo Find an interface for hub helper
./application/hub/main/filter/activation/node/class_NodeActivationSelfAnnouncementFilter.php:54: * @todo 0% done
./application/hub/main/helper/hub/announcement/class_HubDescriptorHelper.php:10: * @todo Find an interface for hub helper
./application/hub/main/helper/hub/announcement/class_HubDescriptorHelper.php:65: * @todo Rewrite the ->renderXmlContent() call to no arguments
./application/hub/main/helper/hub/connection/class_HubSelfConnectHelper.php:10: * @todo Find an interface for hub helper
+./application/hub/main/helper/work_units/cruncher/class_CruncherTestUnitHelper.php:52: * @todo 0% done
./application/hub/main/iterator/network/class_NetworkListenIterator.php:10: * @todo This current implementation is not recommended, use a
./application/hub/main/iterator/network/class_NetworkListenIterator.php:11: * @todo latency-based iteration or similar approaches
./application/hub/main/iterator/pool/handler/class_HandlerPoolIterator.php:10: * @todo This current implementation is not recommended, use a