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/pool/class_PoolableClient.php -text
-application/hub/interfaces/pool/class_PoolableListener.php -text
+application/hub/interfaces/pool/client/.htaccess -text
+application/hub/interfaces/pool/client/class_PoolableClient.php -text
+application/hub/interfaces/pool/listener/.htaccess -text
+application/hub/interfaces/pool/listener/class_PoolableListener.php -text
application/hub/interfaces/query/.htaccess -text
application/hub/interfaces/query/class_Queryable.php -text
application/hub/interfaces/queues/.htaccess -text
application/hub/interfaces/visitor/class_Visitor.php -text
application/hub/interfaces/visitor/pool/.htaccess -text
application/hub/interfaces/visitor/pool/class_PoolVisitor.php -text
+application/hub/interfaces/visitor/pool/listener/.htaccess -text
+application/hub/interfaces/visitor/pool/listener/class_ListenerPoolVisitor.php -text
application/hub/loader.php -text
application/hub/main/.htaccess -text
application/hub/main/class_ -text
application/hub/main/iterator/class_ -text
application/hub/main/iterator/class_BaseIterator.php -text
application/hub/main/iterator/pool/.htaccess -text
-application/hub/main/iterator/pool/class_ShutdownPoolIterator.php -text
+application/hub/main/iterator/pool/handler/.htaccess -text
+application/hub/main/iterator/pool/handler/class_Handler -text
+application/hub/main/iterator/pool/handler/class_HandlerPoolIterator.php -text
+application/hub/main/iterator/pool/shutdown/.htaccess -text
+application/hub/main/iterator/pool/shutdown/class_Shutdown -text
+application/hub/main/iterator/pool/shutdown/class_ShutdownPoolIterator.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/tcp/decorators/class_ClientTcpListenerDecorator.php -text
application/hub/main/listener/tcp/decorators/class_HubTcpListenerDecorator.php -text
application/hub/main/listener/udp/.htaccess -text
+application/hub/main/listener/udp/class_ -text
application/hub/main/listener/udp/class_UdpListener.php -text
application/hub/main/listener/udp/decorators/.htaccess -text
application/hub/main/listener/udp/decorators/class_ClientUdpListenerDecorator.php -text
application/hub/main/visitor/.htaccess -text
application/hub/main/visitor/class_ -text
application/hub/main/visitor/class_BaseVisitor.php -text
-application/hub/main/visitor/shutdown/.htaccess -text
-application/hub/main/visitor/shutdown/class_Shutdown -text
-application/hub/main/visitor/shutdown/class_ShutdownListenerPoolVisitor.php -text
+application/hub/main/visitor/pool/.htaccess -text
+application/hub/main/visitor/pool/class_ -text
+application/hub/main/visitor/pool/handler/.htaccess -text
+application/hub/main/visitor/pool/handler/class_Handler -text
+application/hub/main/visitor/pool/handler/class_HandlerListenerPoolVisitor.php -text
+application/hub/main/visitor/pool/shutdown/.htaccess -text
+application/hub/main/visitor/pool/shutdown/class_Shutdown -text
+application/hub/main/visitor/pool/shutdown/class_ShutdownListenerPoolVisitor.php -text
application/hub/starter.php -text
/clear-cache.sh -text
db/.htaccess -text
// CFG: POOL-ENTRIES-LIST-CLASS
$cfg->setConfigEntry('pool_entries_list_class', 'PoolEntriesList');
-// CFG: LISTENER-POOL-VISITOR-CLASS
-$cfg->setConfigEntry('listener_pool_visitor_class', 'ShutdownListenerPoolVisitor');
+// CFG: SHUTDOWN-LISTENER-POOL-VISITOR-CLASS
+$cfg->setConfigEntry('shutdown_listener_pool_visitor_class', 'ShutdownListenerPoolVisitor');
// CFG: SHUTDOWN-POOL-ITERATOR-CLASS
$cfg->setConfigEntry('shutdown_pool_iterator_class', 'ShutdownPoolIterator');
+// CFG: HANDLER-LISTENER-POOL-VISITOR-CLASS
+$cfg->setConfigEntry('handler_listener_pool_visitor_class', 'HandlerListenerPoolVisitor');
+
+// CFG: HANDLER-POOL-ITERATOR-CLASS
+$cfg->setConfigEntry('handler_pool_iterator_class', 'HandlerPoolIterator');
+
// CFG: LIST-GROUP-CLASS
$cfg->setConfigEntry('list_group_class', 'ListGroupList');
* @return void
*/
function initListener();
+
+ /**
+ * "Listens" for incoming network packages
+ *
+ * @return void
+ */
+ function doListen();
}
//
+++ /dev/null
-<?php
-/**
- * A default client pool class
- *
- * @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/>.
- */
-interface PoolableClient extends Poolable {
- /**
- * Adds a socket resource to the client pool
- *
- * @param $socketResource A valid (must be!) socket resource
- * @return void
- * @todo 0% done
- */
- function addClient ($socketResource);
-}
-
-//
-?>
+++ /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 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 PoolableListener extends Poolable {
- /**
- * Adds a listener instance to this pool
- *
- * @param $listenerInstance An instance of a Listenable class
- * @return void
- */
- function addListener (Listenable $listenerInstance);
-}
-
-//
-?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A default client pool class
+ *
+ * @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/>.
+ */
+interface PoolableClient extends Poolable {
+ /**
+ * Adds a socket resource to the client pool
+ *
+ * @param $socketResource A valid (must be!) socket resource
+ * @return void
+ * @todo 0% done
+ */
+ function addClient ($socketResource);
+}
+
+//
+?>
--- /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 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 PoolableListener extends Poolable {
+ /**
+ * Adds a listener instance to this pool
+ *
+ * @param $listenerInstance An instance of a Listenable class
+ * @return void
+ */
+ function addListener (Listenable $listenerInstance);
+
+ /**
+ * Handle the listeners by asking them for received network packages
+ *
+ * @return void
+ */
+ function handleListenerPool ();
+}
+
+//
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * An interface for the visitor implementation for pools
+ *
+ * @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/>.
+ */
+interface ListenerPoolVisitor extends PoolVisitor {
+ /**
+ * Visits the given listener instance
+ *
+ * @param $listenerInstance A Listenable instance
+ * @return void
+ */
+ function visitListener (Listenable $listenerInstance);
+
+ /**
+ * Visits the given listener instance
+ *
+ * @param $listenerInstance A Listenable instance
+ * @return void
+ */
+ function visitDecorator (Listenable $listenerInstance);
+}
+
+//
+?>
// the attribute $hubIsActive to true
$nodeInstance->activateHub($requestInstance, $responseInstance);
+ // Debug message
+ $this->debugOutput('MAIN: --- Entering main loop. ---');
+
// ----------------------------- Main loop ----------------------------
// This is the main loop. Queried calls should come back here very fast
// so the whole application runs on nice speed. This while-loop goes
// until the hub is no longer active.
while ($nodeInstance->isHubActive()) {
+ // Handle the listeners
+ // @TODO We may have to catch some exceptions here
+ $nodeInstance->getListenerPoolInstance()->handleListenerPool();
+
+ // Handle the qeues
+ $nodeInstance->getQueryInstance()->handleQueues();
} // END - while
+
+ // Debug message
+ $this->debugOutput('MAIN: --- Leaving main loop. ---');
}
/**
+++ /dev/null
-<?php
-/**
- * A ShutdownPool iterator
- *
- * @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 ShutdownPoolIterator extends BaseIterator implements Iterator {
- /**
- * Key for the global list index
- */
- private $indexKey = 0;
-
- /**
- * Protected constructor
- *
- * @return void
- */
- protected function __construct () {
- // Call parent constructor
- parent::__construct(__CLASS__);
- }
-
- /**
- * Creates an instance of this class
- *
- * @param $listInstance A list of a IteratorAggregate
- * @return $iteratorInstance An instance a Iterator class
- */
- public final static function createShutdownPoolIterator (IteratorAggregate $listInstance) {
- // Get new instance
- $iteratorInstance = new ShutdownPoolIterator();
-
- // Set the list
- $iteratorInstance->setListInstance($listInstance);
-
- // Return the prepared instance
- return $iteratorInstance;
- }
-
- /**
- * Getter for current value from group or generic
- *
- * @return $current Current value in iteration
- * @throws IndexOutOfBoundsException If $indexKey is out of bounds
- */
- public function current () {
- // Default is null
- $current = null;
-
- // Is the entry valid?
- if (!$this->valid()) {
- // Throw an exception here
- throw new IndexOutOfBoundsException($this->key(), self::EXCEPTION_INDEX_OUT_OF_BOUNDS);
- } // END - if
-
- // Now get the entry
- $current = $this->getListInstance()->getEntry($this->key());
-
- // Return it
- return $current;
- }
-
- /**
- * Getter for key from group or generic
- *
- * @return $indexKey Current key in iteration
- */
- public function key () {
- return $this->indexKey;
- }
-
- /**
- * Advances to the next entry
- *
- * @return void
- */
- public function next () {
- $this->indexKey++;
- }
-
- /**
- * Rewinds to the beginning of the iteration
- *
- * @return void
- */
- public function rewind () {
- $this->indexKey = 0;
- }
-
- /**
- * Checks wether the current entry is valid (not at the end of the list)
- *
- * @return $isValid Wether the current entry is there
- */
- public function valid () {
- // Check for total active clients and if we are not at the end
- $isValid = ($this->key() < $this->getListInstance()->count());
-
- // Return result
- return $isValid;
- }
-}
-
-// [EOF]
-?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A handler ??? iterator
+ *
+ * @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 Handler???Iterator extends BaseIterator implements Iterator {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @return $iteratorInstance An instance a Iterator class
+ */
+ public final static function createHandler???Iterator () {
+ // Get new instance
+ $iteratorInstance = new Handler???Iterator();
+
+ // Return the prepared instance
+ return $iteratorInstance;
+ }
+
+ /**
+ * Getter for current value from group or generic
+ *
+ * @return $current Current value in iteration
+ */
+ public function current () {
+ // Default is null
+ $current = null;
+
+ $this->partialStub('Please implement this method.');
+
+ // Return it
+ return $current;
+ }
+
+ /**
+ * Getter for key from group or generic
+ *
+ * @return $key Current key in iteration
+ */
+ public function key () {
+ // Default is null
+ $key = null;
+
+ $this->partialStub('Please implement this method.');
+
+ // Return it
+ return $key;
+ }
+
+ /**
+ * Advances to the next entry
+ *
+ * @return void
+ */
+ public function next () {
+ $this->partialStub('Please implement this method.');
+ }
+
+ /**
+ * Rewinds to the beginning of the iteration
+ *
+ * @return void
+ */
+ public function rewind () {
+ $this->partialStub('Please implement this method.');
+ }
+
+ /**
+ * Checks wether the current entry is valid (not at the end of the list)
+ *
+ * @return void
+ */
+ public function valid () {
+ $this->partialStub('Please implement this method.');
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * A HandlerPool iterator
+ *
+ * @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
+ * @todo This current implementation is not recommended, use a
+ * @todo latency-based iteration or similar approaches
+ *
+ * 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 HandlerPoolIterator extends BaseIterator implements Iterator {
+ /**
+ * Key for the global list index
+ */
+ private $indexKey = 0;
+
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @param $listInstance A list of a IteratorAggregate
+ * @return $iteratorInstance An instance a Iterator class
+ */
+ public final static function createHandlerPoolIterator (IteratorAggregate $listInstance) {
+ // Get new instance
+ $iteratorInstance = new HandlerPoolIterator();
+
+ // Set the list
+ $iteratorInstance->setListInstance($listInstance);
+
+ // Return the prepared instance
+ return $iteratorInstance;
+ }
+
+ /**
+ * Getter for current value from group or generic
+ *
+ * @return $current Current value in iteration
+ * @throws IndexOutOfBoundsException If $indexKey is out of bounds
+ */
+ public function current () {
+ // Default is null
+ $current = null;
+
+ // Is the entry valid?
+ if (!$this->valid()) {
+ // Throw an exception here
+ throw new IndexOutOfBoundsException($this->key(), self::EXCEPTION_INDEX_OUT_OF_BOUNDS);
+ } // END - if
+
+ // Now get the entry
+ $current = $this->getListInstance()->getEntry($this->key());
+
+ // Return it
+ return $current;
+ }
+
+ /**
+ * Getter for key from group or generic
+ *
+ * @return $indexKey Current key in iteration
+ */
+ public function key () {
+ return $this->indexKey;
+ }
+
+ /**
+ * Advances to the next entry
+ *
+ * @return void
+ */
+ public function next () {
+ $this->indexKey++;
+ }
+
+ /**
+ * Rewinds to the beginning of the iteration
+ *
+ * @return void
+ */
+ public function rewind () {
+ $this->indexKey = 0;
+ }
+
+ /**
+ * Checks wether the current entry is valid (not at the end of the list)
+ *
+ * @return $isValid Wether the current entry is there
+ */
+ public function valid () {
+ // Check for total active clients and if we are not at the end
+ $isValid = ($this->key() < $this->getListInstance()->count());
+
+ // Return result
+ return $isValid;
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A shutdown ??? iterator
+ *
+ * @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 Shutdown???Iterator extends BaseIterator implements Iterator {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @return $iteratorInstance An instance a Iterator class
+ */
+ public final static function createShutdown???Iterator () {
+ // Get new instance
+ $iteratorInstance = new Shutdown???Iterator();
+
+ // Return the prepared instance
+ return $iteratorInstance;
+ }
+
+ /**
+ * Getter for current value from group or generic
+ *
+ * @return $current Current value in iteration
+ */
+ public function current () {
+ // Default is null
+ $current = null;
+
+ $this->partialStub('Please implement this method.');
+
+ // Return it
+ return $current;
+ }
+
+ /**
+ * Getter for key from group or generic
+ *
+ * @return $key Current key in iteration
+ */
+ public function key () {
+ // Default is null
+ $key = null;
+
+ $this->partialStub('Please implement this method.');
+
+ // Return it
+ return $key;
+ }
+
+ /**
+ * Advances to the next entry
+ *
+ * @return void
+ */
+ public function next () {
+ $this->partialStub('Please implement this method.');
+ }
+
+ /**
+ * Rewinds to the beginning of the iteration
+ *
+ * @return void
+ */
+ public function rewind () {
+ $this->partialStub('Please implement this method.');
+ }
+
+ /**
+ * Checks wether the current entry is valid (not at the end of the list)
+ *
+ * @return void
+ */
+ public function valid () {
+ $this->partialStub('Please implement this method.');
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * A ShutdownPool iterator
+ *
+ * @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 ShutdownPoolIterator extends BaseIterator implements Iterator {
+ /**
+ * Key for the global list index
+ */
+ private $indexKey = 0;
+
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @param $listInstance A list of a IteratorAggregate
+ * @return $iteratorInstance An instance a Iterator class
+ */
+ public final static function createShutdownPoolIterator (IteratorAggregate $listInstance) {
+ // Get new instance
+ $iteratorInstance = new ShutdownPoolIterator();
+
+ // Set the list
+ $iteratorInstance->setListInstance($listInstance);
+
+ // Return the prepared instance
+ return $iteratorInstance;
+ }
+
+ /**
+ * Getter for current value from group or generic
+ *
+ * @return $current Current value in iteration
+ * @throws IndexOutOfBoundsException If $indexKey is out of bounds
+ */
+ public function current () {
+ // Default is null
+ $current = null;
+
+ // Is the entry valid?
+ if (!$this->valid()) {
+ // Throw an exception here
+ throw new IndexOutOfBoundsException($this->key(), self::EXCEPTION_INDEX_OUT_OF_BOUNDS);
+ } // END - if
+
+ // Now get the entry
+ $current = $this->getListInstance()->getEntry($this->key());
+
+ // Return it
+ return $current;
+ }
+
+ /**
+ * Getter for key from group or generic
+ *
+ * @return $indexKey Current key in iteration
+ */
+ public function key () {
+ return $this->indexKey;
+ }
+
+ /**
+ * Advances to the next entry
+ *
+ * @return void
+ */
+ public function next () {
+ $this->indexKey++;
+ }
+
+ /**
+ * Rewinds to the beginning of the iteration
+ *
+ * @return void
+ */
+ public function rewind () {
+ $this->indexKey = 0;
+ }
+
+ /**
+ * Checks wether the current entry is valid (not at the end of the list)
+ *
+ * @return $isValid Wether the current entry is there
+ */
+ public function valid () {
+ // Check for total active clients and if we are not at the end
+ $isValid = ($this->key() < $this->getListInstance()->count());
+
+ // Return result
+ return $isValid;
+ }
+}
+
+// [EOF]
+?>
<?php
/**
- *
+ * A ??? listener
*
* @author Roland Haeder <webmaster@ship-simu.org>
* @version 0.0.0
public function initListener() {
$this->partialStub('Need to implement this method.');
}
+
+ /**
+ * "Listens" for incoming network packages
+ *
+ * @return void
+ * @todo 0% done
+ */
+ public function doListen() {
+ $this->partialStub('Need to implement this method.');
+ }
}
// [EOF]
*/
public function accept (Visitor $visitorInstance) {
// Debug message
- $this->debugOutput('LISTENER: ' . $visitorInstance->__toString() . ' has visited - START');
+ //* DEBUG: */ $this->debugOutput('LISTENER: ' . $visitorInstance->__toString() . ' has visited - START');
// Visit this listener
$visitorInstance->visitListener($this);
// Visit the pool if set
if ($this->getPoolInstance() instanceof Poolable) {
- $this->getPoolInstance()->accept($visitor);
+ $this->getPoolInstance()->accept($visitorInstance);
} // END - if
// Debug message
- $this->debugOutput('LISTENER: ' . $visitorInstance->__toString() . ' has visited - FINISHED');
+ //* DEBUG: */ $this->debugOutput('LISTENER: ' . $visitorInstance->__toString() . ' has visited - FINISHED');
}
}
*/
public function accept (Visitor $visitorInstance) {
// Debug message
- $this->debugOutput('DECO-LISTENER: ' . $visitorInstance->__toString() . ' has visited - START');
+ //* DEBUG: */ $this->debugOutput('DECO-LISTENER: ' . $visitorInstance->__toString() . ' has visited - START');
// Visit this decorator
$visitorInstance->visitDecorator($this);
// Visit the covered class
- $this->getListenerInstance()->accept($visitorInstance);
+ $visitorInstance->visitListener($this);
// Debug message
- $this->debugOutput('DECO-LISTENER: ' . $visitorInstance->__toString() . ' has visited - FINISHED');
+ //* DEBUG: */ $this->debugOutput('DECO-LISTENER: ' . $visitorInstance->__toString() . ' has visited - FINISHED');
}
}
socket_close($mainSocket);
?>
+<?php
+/**
+ * A TCP ??? listener
+ *
+ * @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 ???Listener extends BaseListener implements Listenable, Visitable {
+ /**
+ * 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;
+ }
+
+ /**
+ * Initializes the listener by setting up the required socket server
+ *
+ * @return void
+ * @todo 0% done
+ */
+ public function initListener() {
+ $this->partialStub('Need to implement this method.');
+ }
+
+ /**
+ * "Listens" for incoming network packages
+ *
+ * @return void
+ * @todo 0% done
+ */
+ public function doListen() {
+ $this->partialStub('Need to implement this method.');
+ }
+}
+
+// [EOF]
+?>
// Output message
$this->debugOutput('LISTENER: TCP listener now ready on IP ' . $this->getListenAddress() . ', port ' . $this->getListenPort() . ' for service.');
}
+
+ /**
+ * "Listens" for incoming network packages
+ *
+ * @return void
+ * @todo 0% done
+ */
+ public function doListen() {
+ $this->partialStub('Need to implement this method.');
+ }
}
// [EOF]
public function initListener() {
$this->partialStub('WARNING: This method should not be called.');
}
+
+ /**
+ * "Listens" for incoming network packages
+ *
+ * @return void
+ */
+ public function doListen() {
+ // Handle generic TCP package
+ $this->getListenerInstance()->doListen();
+
+ // Handle client TCP package
+ $this->partialStub('Need to handle client TCP package.');
+ }
}
// [EOF]
public function initListener() {
$this->partialStub('WARNING: This method should not be called.');
}
+
+ /**
+ * "Listens" for incoming network packages
+ *
+ * @return void
+ */
+ public function doListen() {
+ // Handle generic TCP package
+ $this->getListenerInstance()->doListen();
+
+ // Handle hub TCP package
+ $this->partialStub('Need to handle hub TCP package.');
+ }
}
// [EOF]
--- /dev/null
+<?php
+/**
+ * An UDP ??? listener
+ *
+ * @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 Udp???Listener extends BaseListener implements Listenable, Visitable {
+ /**
+ * 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 createUdp???Listener (NodeHelper $nodeInstance) {
+ // Get new instance
+ $listenerInstance = new Udp???Listener();
+
+ // Set the application instance
+ $listenerInstance->setNodeInstance($nodeInstance);
+
+ // Return the prepared instance
+ return $listenerInstance;
+ }
+
+ /**
+ * Initializes the listener by setting up the required socket server
+ *
+ * @return void
+ * @todo 0% done
+ */
+ public function initListener() {
+ $this->partialStub('Need to implement this method.');
+ }
+
+ /**
+ * "Listens" for incoming network packages
+ *
+ * @return void
+ * @todo 0% done
+ */
+ public function doListen() {
+ $this->partialStub('Need to implement this method.');
+ }
+}
+
+// [EOF]
+?>
<?php
/**
- * A UDP connection listener
+ * An UDP connection listener
*
* @author Roland Haeder <webmaster@ship-simu.org>
* @version 0.0.0
// Output message
$this->debugOutput('LISTENER: UDP listener now ready on IP ' . $this->getListenAddress() . ', port ' . $this->getListenPort() . ' for service.');
}
+
+ /**
+ * "Listens" for incoming network packages
+ *
+ * @return void
+ * @todo 0% done
+ */
+ public function doListen() {
+ $this->partialStub('Need to implement this method.');
+ }
}
// [EOF]
public function initListener() {
$this->partialStub('WARNING: This method should not be called.');
}
+
+ /**
+ * "Listens" for incoming network packages
+ *
+ * @return void
+ */
+ public function doListen() {
+ // Look for generic packages first
+ $this->getListenerInstance()->doListen();
+
+ // Handle this client UDP package
+ $this->partialStub('Need to handle client UDP package.');
+ }
}
// [EOF]
public function initListener() {
$this->partialStub('WARNING: This method should not be called.');
}
+
+ /**
+ * "Listens" for incoming network packages
+ *
+ * @return void
+ */
+ public function doListen() {
+ // Handle generic package first
+ $this->getListenerInstance()->doListen();
+
+ // Handle hub UDP package
+ $this->partialStub('Need to handle hub UDP package.');
+ }
}
// [EOF]
*/
public function accept (Visitor $visitorInstance) {
// Debug message
- $this->debugOutput('POOL: ' . $visitorInstance->__toString() . ' has visited - START');
+ //* DEBUG: */ $this->debugOutput('POOL: ' . $visitorInstance->__toString() . ' has visited - START');
// Visit this pool
$visitorInstance->visitPool($this);
// Get a new iterator instance
- $iteratorInstance = ObjectFactory::createObjectByConfiguredName('shutdown_pool_iterator_class', array($this->poolEntriesInstance));
+ $iteratorInstance = ObjectFactory::createObjectByConfiguredName($visitorInstance->getVisitorMode() . '_pool_iterator_class', array($this->poolEntriesInstance));
// Reset the counter
$iteratorInstance->rewind();
// Is this entry visitable?
if ($poolEntry instanceof Visitable) {
// Visit this entry as well
+ print __METHOD__.':'.$poolEntry."\n";
$poolEntry->accept($visitorInstance);
} else {
// Cannot visit this entry
} // END - while
// Debug message
- $this->debugOutput('POOL: ' . $visitorInstance->__toString() . ' has visited - FINISHED');
+ //* DEBUG: */ $this->debugOutput('POOL: ' . $visitorInstance->__toString() . ' has visited - FINISHED');
}
}
);
}
+ /**
+ * Handle the listeners by asking them for received network packages.
+ * You should not add any debug lines here because they will be executed
+ * in the main loop and may be a performance impact.
+ *
+ * @return void
+ */
+ public function handleListenerPool () {
+ // Get a visitor instance
+ $visitorInstance = ObjectFactory::createObjectByConfiguredName('handler_listener_pool_visitor_class');
+
+ // Start the visit
+ $this->accept($visitorInstance);
+ }
+
/**
* Run the shutdown seqeuence by a Visitor Pattern
*
$this->debugOutput('POOL: Shutting down listener pool - START');
// Get a new visitor
- $visitorInstance = ObjectFactory::createObjectByConfiguredName('listener_pool_visitor_class');
+ $visitorInstance = ObjectFactory::createObjectByConfiguredName('shutdown_listener_pool_visitor_class');
// Start visiting
$this->accept($visitorInstance);
protected function __construct () {
// Call parent constructor
parent::__construct(__CLASS__);
+
+ // Set visitor mode
+ $this->setVisitorMode('???');
}
/**
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class BaseVisitor extends BaseHubSystem {
+ /**
+ * Mode of the visitor (the first word of the concrete class' name)
+ */
+ private $visitorMode = 'invalid';
+
/**
* Protected constructor
*
$this->removeNumberFormaters();
$this->removeSystemArray();
}
+
+ /**
+ * Setter for visitor mode
+ *
+ * @param $visitorMode New visitor mode to set
+ * @return void
+ */
+ protected final function setVisitorMode ($visitorMode) {
+ $this->visitorMode = (string) $visitorMode;
+ }
+
+ /**
+ * Getter for visitor mode
+ *
+ * @return $visitorMode New visitor mode to set
+ */
+ public final function getVisitorMode () {
+ return $this->visitorMode;
+ }
}
// [EOF]
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A ??? visitor
+ *
+ * @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 ???Visitor extends BaseVisitor implements PoolVisitor {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Set visitor mode
+ $this->setVisitorMode('???');
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @return $visitorInstance An instance a Visitorable class
+ */
+ public final static function create???Visitor () {
+ // Get new instance
+ $visitorInstance = new ???Visitor();
+
+ // Return the prepared instance
+ return $visitorInstance;
+ }
+
+ /**
+ * Visits the given pool instance
+ *
+ * @param $poolInstance A Poolable instance
+ * @return void
+ * @todo 0%
+ */
+ public function visitPool (Poolable $poolInstance) {
+ $this->partialStub('Please implement this method.');
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A ??? handler visitor
+ *
+ * @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 Handler???Visitor extends BaseVisitor implements PoolVisitor {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Set visitor mode
+ $this->setVisitorMode('handler');
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @return $visitorInstance An instance a Visitorable class
+ */
+ public final static function createHandler???Visitor () {
+ // Get new instance
+ $visitorInstance = new Handler???Visitor();
+
+ // Return the prepared instance
+ return $visitorInstance;
+ }
+
+ /**
+ * Visits the given pool instance
+ *
+ * @param $poolInstance A Poolable instance
+ * @return void
+ * @todo 0%
+ */
+ public function visitPool (Poolable $poolInstance) {
+ $this->partialStub('Please implement this method.');
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * A ListenerPool handler visitor
+ *
+ * @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 HandlerListenerPoolVisitor extends BaseVisitor implements ListenerPoolVisitor {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Set visitor mode
+ $this->setVisitorMode('handler');
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @return $visitorInstance An instance a Visitorable class
+ */
+ public final static function createHandlerListenerPoolVisitor () {
+ // Get new instance
+ $visitorInstance = new HandlerListenerPoolVisitor();
+
+ // Return the prepared instance
+ return $visitorInstance;
+ }
+
+ /**
+ * Visits the given pool instance
+ *
+ * @param $poolInstance A Poolable instance
+ * @return void
+ * @todo Find some use of doListen() method in listener pool classes
+ */
+ public function visitPool (Poolable $poolInstance) {
+ // The pool itself wont listen to any connections but maybe we need
+ // this stub for something later on
+ // $poolInstance->doListen();
+ }
+
+ /**
+ * Visits the given decorator instance
+ *
+ * @param $listenerInstance A Listenable instance
+ * @return void
+ * @todo Find some use of doListen() method in listener decorator classes
+ */
+ public function visitDecorator (Listenable $listenerInstance) {
+ // The decorator itself wont listen to any connections but maybe we need
+ // this stub for something later on
+ // $listenerInstance->doListen();
+ }
+
+ /**
+ * Visits the given listener instance
+ *
+ * @param $listenerInstance A listenerable instance
+ * @return void
+ */
+ public function visitListener (Listenable $listenerInstance) {
+ // Just call the listener->doListen
+ $listenerInstance->doListen();
+ }
+}
+
+//
+?>
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * A ??? shutdown visitor
+ *
+ * @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 Shutdown???Visitor extends BaseVisitor implements PoolVisitor {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Set visitor mode
+ $this->setVisitorMode('shutdown');
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @return $visitorInstance An instance a Visitorable class
+ */
+ public final static function createShutdown???Visitor () {
+ // Get new instance
+ $visitorInstance = new Shutdown???Visitor();
+
+ // Return the prepared instance
+ return $visitorInstance;
+ }
+
+ /**
+ * Visits the given pool instance
+ *
+ * @param $poolInstance A Poolable instance
+ * @return void
+ * @todo 0%
+ */
+ public function visitPool (Poolable $poolInstance) {
+ $this->partialStub('Please implement this method.');
+ }
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/**
+ * A ListenerPool shutdown visitor
+ *
+ * @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 ShutdownListenerPoolVisitor extends BaseVisitor implements PoolVisitor {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+
+ // Set visitor mode
+ $this->setVisitorMode('shutdown');
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @return $visitorInstance An instance a Visitorable class
+ */
+ public final static function createShutdownListenerPoolVisitor () {
+ // Get new instance
+ $visitorInstance = new ShutdownListenerPoolVisitor();
+
+ // Return the prepared instance
+ return $visitorInstance;
+ }
+
+ /**
+ * Visits the given pool instance
+ *
+ * @param $poolInstance A Poolable instance
+ * @return void
+ */
+ public function visitPool (Poolable $poolInstance) {
+ // Debug message
+ $this->debugOutput('VISITOR: Visit of ' . $poolInstance->__toString() . ' - START');
+
+ // Pre-shutdown the pool
+ $poolInstance->preShutdown();
+
+ // Debug message
+ $this->debugOutput('VISITOR: Visit of ' . $poolInstance->__toString() . ' - FINISHED');
+ }
+}
+
+//
+?>
+++ /dev/null
-Deny from all
+++ /dev/null
-<?php
-/**
- * A ??? shutdown visitor
- *
- * @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 Shutdown???Visitor extends BaseVisitor implements PoolVisitor {
- /**
- * Protected constructor
- *
- * @return void
- */
- protected function __construct () {
- // Call parent constructor
- parent::__construct(__CLASS__);
- }
-
- /**
- * Creates an instance of this class
- *
- * @return $visitorInstance An instance a Visitorable class
- */
- public final static function createShutdown???Visitor () {
- // Get new instance
- $visitorInstance = new Shutdown???Visitor();
-
- // Return the prepared instance
- return $visitorInstance;
- }
-}
-
-// [EOF]
-?>
+++ /dev/null
-<?php
-/**
- * A ListenerPool shutdown visitor
- *
- * @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 ShutdownListenerPoolVisitor extends BaseVisitor implements PoolVisitor {
- /**
- * Protected constructor
- *
- * @return void
- */
- protected function __construct () {
- // Call parent constructor
- parent::__construct(__CLASS__);
- }
-
- /**
- * Creates an instance of this class
- *
- * @return $visitorInstance An instance a Visitorable class
- */
- public final static function createShutdownListenerPoolVisitor () {
- // Get new instance
- $visitorInstance = new ShutdownListenerPoolVisitor();
-
- // Return the prepared instance
- return $visitorInstance;
- }
-
- /**
- * Visits the given pool instance
- *
- * @param $poolInstance A Poolable instance
- * @return void
- */
- public function visitPool (Poolable $poolInstance) {
- // Debug message
- $this->debugOutput('VISITOR: Visit of ' . $poolInstance->__toString() . ' - START');
-
- // Pre-shutdown the pool
- $poolInstance->preShutdown();
-
- // Debug message
- $this->debugOutput('VISITOR: Visit of ' . $poolInstance->__toString() . ' - FINISHED');
- }
-}
-
-//
-?>