application/hub/main/states/generic/.htaccess -text
application/hub/main/states/hub/.htaccess -text
application/hub/main/states/hub/class_BaseHubState.php -text
+application/hub/main/tasks/.htaccess -text
+application/hub/main/tasks/class_ -text
+application/hub/main/tasks/class_BaseTask.php -text
+application/hub/main/tasks/idle/.htaccess -text
+application/hub/main/tasks/idle/class_IdleLoopTask.php -text
application/hub/main/visitor/.htaccess -text
application/hub/main/visitor/class_ -text
application/hub/main/visitor/class_BaseVisitor.php -text
// CFG: TASK-QUERY-HANDLER-INTERVAL-DELAY
$cfg->setConfigEntry('task_query_handler_interval_delay', 10);
+// CFG: TASK-IDLE-LOOP-STARTUP-DELAY
+$cfg->setConfigEntry('task_idle_loop_startup_delay', 0);
+
+// CFG: TASK-IDLE-LOOP-INTERVAL-DELAY
+$cfg->setConfigEntry('task_idle_loop_interval_delay', 10);
+
+// CFG: IDLE-TASK-CLASS
+$cfg->setConfigEntry('idle_task_class', 'IdleLoopTask');
+
// [EOF]
?>
* @param $taskName A task name to register the task on
* @param $taskInstance The instance we should register as a task
* @return void
+ * @throws TaskAlreadyRegisteredException If the given task is already registered
*/
function registerTask ($taskName, Visitable $taskInstance);
}
// 2.) Query instance
$handlerInstance->registerTask('query_handler', $nodeInstance->getQueryInstance());
+ // Generate idle task
+ $taskInstance = ObjectFactory::createObjectByConfiguredName('idle_task_class');
+
+ // Register it as well
+ $handlerInstance->registerTask('idle_loop', $taskInstance);
+
// Put the task handler in registry
Registry::getRegistry()->addInstance('task', $handlerInstance);
}
* @param $taskName A task name to register the task on
* @param $taskInstance The instance we should register as a task
* @return void
+ * @throws TaskAlreadyRegisteredException If the task is already registered
*/
public function registerTask ($taskName, Visitable $taskInstance) {
$this->partialStub('taskName=' . $taskName . '/' . $taskInstance->__toString());
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A ??? task
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 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 ???Task extends BaseTask implements Visitable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @return $taskInstance An instance of a Visitable class
+ */
+ public final static function create???Task () {
+ // Get new instance
+ $taskInstance = new ???Task();
+
+ // Return the prepared instance
+ return $taskInstance;
+ }
+
+ /**
+ * Accepts the visitor to rpocess the visit "request"
+ *
+ * @param $visitorInstance An instance of a Visitor class
+ * @return void
+ * @todo 0%
+ */
+ public function accept (Visitor $visitorInstance) {
+ $this->partialStub('Please implement this method. visitor='.$visitorInstance->__toString());
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * A general Task
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 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 BaseTask extends BaseHubSystem {
+ /**
+ * 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 IdleLoop task
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 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 IdleLoopTask extends BaseTask implements Visitable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @return $taskInstance An instance of a Visitable class
+ */
+ public final static function createIdleLoopTask () {
+ // Get new instance
+ $taskInstance = new IdleLoopTask();
+
+ // Return the prepared instance
+ return $taskInstance;
+ }
+
+ /**
+ * Accepts the visitor to rpocess the visit "request"
+ *
+ * @param $visitorInstance An instance of a Visitor class
+ * @return void
+ * @todo 0%
+ */
+ public function accept (Visitor $visitorInstance) {
+ $this->partialStub('Please implement this method. visitor='.$visitorInstance->__toString());
+ }
+}
+
+// [EOF]
+?>