application/hub/interfaces/connectors/class_Connectable.php -text
application/hub/interfaces/nodes/.htaccess -text
application/hub/interfaces/nodes/class_NodeHelper.php -text
+application/hub/interfaces/pool/.htaccess -text
+application/hub/interfaces/pool/class_Poolable.php -text
application/hub/interfaces/query/.htaccess -text
application/hub/interfaces/query/class_Queryable.php -text
application/hub/interfaces/queues/.htaccess -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/master/class_HubMasterNode.php -text
application/hub/main/nodes/regular/.htaccess -text
application/hub/main/nodes/regular/class_HubRegularNode.php -text
+application/hub/main/pools/.htaccess -text
+application/hub/main/pools/class_ -text
+application/hub/main/pools/class_BasePool.php -text
+application/hub/main/pools/listener/.htaccess -text
+application/hub/main/pools/listener/class_DefaultListenerPool.php -text
application/hub/starter.php -text
/clear-cache.sh -text
db/.htaccess -text
$cfg->setConfigEntry('queue_connector_class', "LocalQueueConnector");
// CFG: LISTENER-POOL-CLAS
-$cfg->setConfigEntry('listener_pool_class', "ListenerPool");
+$cfg->setConfigEntry('listener_pool_class', "DefaultListenerPool");
// CFG: TCP-LISTENER-CLASS
$cfg->setConfigEntry('tcp_listener_class', "TcpListener");
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * An interface for pools
+ *
+ * @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/>.
+ */
+interface Poolable extends FrameworkInterface {
+}
+
+//
+?>
* 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 {
+class ???Listener extends BaseListener implements Listenable {
/**
* Protected constructor
*
+++ /dev/null
-Deny from all
$this->listenerPoolInstance = ObjectFactory::createObjectByConfiguredName('listener_pool_class', array($this));
// Initialize the TCP listener
- $tcpListenerInstance = ObjectFactory::createObjectByConfiguredName('tcp_listener_class', array($this));
+ $listenerInstance = ObjectFactory::createObjectByConfiguredName('tcp_listener_class', array($this));
+
+ // Setup address and port
+ $listenerInstance->setListenAddressByConfiguration('node_listen_addr');
+ $listenerInstance->setListenPortByConfiguration('node_tcp_listen_port');
// Initialize the UDP listener
- $udpListenerInstance = ObjectFactory::createObjectByConfiguredName('udp_listener_class', array($this));
+ $listenerInstance = ObjectFactory::createObjectByConfiguredName('udp_listener_class', array($this));
+
+ // Setup address and port
+ $listenerInstance->setListenAddressByConfiguration('node_listen_addr');
+ $listenerInstance->setListenPortByConfiguration('node_udp_listen_port');
}
}
--- /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 ???Pool extends BasePool implements Poolable {
+ /**
+ * 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???Pool (NodeHelper $nodeInstance) {
+ // Get new instance
+ $listenerInstance = new ???Pool();
+
+ // Set the application instance
+ $listenerInstance->setNodeInstance($nodeInstance);
+
+ // Return the prepared instance
+ return $listenerInstance;
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * A general pool 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 BasePool 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 default listener pool
+ *
+ * @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 DefaultListenerPool extends BasePool implements Poolable {
+ /**
+ * 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 createDefaultListenerPool (NodeHelper $nodeInstance) {
+ // Get new instance
+ $listenerInstance = new DefaultListenerPool();
+
+ // Set the application instance
+ $listenerInstance->setNodeInstance($nodeInstance);
+
+ // Return the prepared instance
+ return $listenerInstance;
+ }
+}
+
+// [EOF]
+?>