application/hub/interfaces/queues/class_Queueable.php -text
application/hub/loader.php -text
application/hub/main/.htaccess -text
+application/hub/main/class_BaseHubSystem.php -text
application/hub/main/connectors/.htaccess -text
application/hub/main/connectors/class_BaseConnector.php -text
application/hub/main/connectors/query/.htaccess -text
application/hub/main/database/.htaccess -text
application/hub/main/database/wrapper/.htaccess -text
application/hub/main/database/wrapper/class_NodeInformationDatabaseWrapper.php -text
+application/hub/main/listener/.htaccess -text
+application/hub/main/listener/class_ -text
+application/hub/main/listener/class_BaseListener.php -text
+application/hub/main/listener/pool/.htaccess -text
+application/hub/main/listener/tcp/.htaccess -text
+application/hub/main/listener/udp/.htaccess -text
application/hub/main/nodes/.htaccess -text
application/hub/main/nodes/boot/.htaccess -text
application/hub/main/nodes/boot/class_HubBootNode.php -text
// CFG: QUEUE-CONNECTOR-CLASS
$cfg->setConfigEntry('queue_connector_class', "LocalQueueConnector");
+// CFG: LISTENER-POOL-CLAS
+$cfg->setConfigEntry('listener_pool_class', "ListenerPool");
+
// CFG: TCP-LISTENER-CLASS
$cfg->setConfigEntry('tcp_listener_class', "TcpListener");
--- /dev/null
+<?php
+/**
+ * A general hub system class
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Core 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 BaseHubSystem extends BaseFrameworkSystem {
+ /**
+ * An instance of a node
+ */
+ private $nodeInstance = null;
+
+ /**
+ * Protected constructor
+ *
+ * @param $className Name of the class
+ * @return void
+ */
+ protected function __construct ($className) {
+ // Call parent constructor
+ parent::__construct($className);
+
+ // Clean up a little
+ $this->removeNumberFormaters();
+ $this->removeSystemArray();
+ }
+
+ /**
+ * Setter for node instance
+ *
+ * @param $nodeInstance An instance of a node node
+ * @return void
+ */
+ protected final function setNodeInstance (NodeHelper $nodeInstance) {
+ $this->nodeInstance = $nodeInstance;
+ }
+
+ /**
+ * Getter for node instance
+ *
+ * @return $nodeInstance An instance of a node node
+ */
+ public final function getNodeInstance () {
+ return $this->nodeInstance;
+ }
+}
+
+// [EOF]
+?>
* 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 BaseConnector extends BaseFrameworkSystem {
- /**
- * An instance of a node
- */
- private $nodeInstance = null;
-
+class BaseConnector extends BaseHubSystem {
/**
* Protected constructor
*
protected function __construct ($className) {
// Call parent constructor
parent::__construct($className);
-
- // Clean up a little
- $this->removeNumberFormaters();
- $this->removeSystemArray();
- }
-
- /**
- * Setter for node instance
- *
- * @param $nodeInstance An instance of a node node
- * @return void
- */
- protected final function setNodeInstance (NodeHelper $nodeInstance) {
- $this->nodeInstance = $nodeInstance;
- }
-
- /**
- * Getter for node instance
- *
- * @return $nodeInstance An instance of a node node
- */
- public final function getNodeInstance () {
- return $this->nodeInstance;
}
}
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ *
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Core 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 ???Listener extends BaseListener implements Listenerable {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @param $nodeInstance A NodeHelper instance
+ * @return $listenerInstance An instance a prepared listener class
+ */
+ public final static function create???Listener (NodeHelper $nodeInstance) {
+ // Get new instance
+ $listenerInstance = new ???Listener();
+
+ // Set the application instance
+ $listenerInstance->setNodeInstance($nodeInstance);
+
+ // Return the prepared instance
+ return $listenerInstance;
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * A general listener class
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Core 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 BaseListener 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
+Deny from all
--- /dev/null
+Deny from all
* 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 BaseHubNode extends BaseFrameworkSystem implements Updateable {
+class BaseHubNode extends BaseHubSystem implements Updateable {
/**
* Node id
*/
protected function __construct ($className) {
// Call parent constructor
parent::__construct($className);
-
- // Clean up a little
- $this->removeNumberFormaters();
- $this->removeSystemArray();
}
/**
/**
* Activates the hub by doing some final preparation and setting
* $hubIsActive to true
+ *
+ * @return void
*/
public function activateHub () {
// Checks wether a listener is still active and shuts it down if one
$this->hubIsActive = true;
// ---------------------- Last step until here ------------------------
}
+
+ /**
+ * Initializes the listener pool (class)
+ *
+ * @return void
+ */
+ private function initializeListenerPool () {
+ // Get a new pool instance
+ $this->listenerPoolInstance = ObjectFactory::createObjectByConfiguredName('listener_pool_class', array($this));
+
+ // Initialize the TCP listener
+ $tcpListenerInstance = ObjectFactory::createObjectByConfiguredName('tcp_listener_class', array($this));
+
+ // Initialize the UDP listener
+ $udpListenerInstance = ObjectFactory::createObjectByConfiguredName('udp_listener_class', array($this));
+ }
}
// [EOF]