From: Roland Häder Date: Wed, 8 Jul 2009 21:02:36 +0000 (+0000) Subject: Interface Poolable rewritten to PoolableListener and kept as generic interface X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b67362def2c86812570ddce8627e712314843061;p=hub.git Interface Poolable rewritten to PoolableListener and kept as generic interface --- diff --git a/.gitattributes b/.gitattributes index c19a615d1..5313adb66 100644 --- a/.gitattributes +++ b/.gitattributes @@ -19,6 +19,7 @@ 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/query/.htaccess -text application/hub/interfaces/query/class_Queryable.php -text application/hub/interfaces/queues/.htaccess -text diff --git a/application/hub/interfaces/pool/class_Poolable.php b/application/hub/interfaces/pool/class_Poolable.php index 1f58cb080..8a9511748 100644 --- a/application/hub/interfaces/pool/class_Poolable.php +++ b/application/hub/interfaces/pool/class_Poolable.php @@ -22,13 +22,6 @@ * along with this program. If not, see . */ interface Poolable extends FrameworkInterface { - /** - * Adds a listener instance to this pool - * - * @param $listenerInstance An instance of a Listenable class - * @return void - */ - function addListener (Listenable $listenerInstance); } // diff --git a/application/hub/interfaces/pool/class_PoolableClient.php b/application/hub/interfaces/pool/class_PoolableClient.php index 36f258d76..c74c72f52 100644 --- a/application/hub/interfaces/pool/class_PoolableClient.php +++ b/application/hub/interfaces/pool/class_PoolableClient.php @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -interface PoolableClient extends FrameworkInterface { +interface PoolableClient extends Poolable { /** * Adds a socket resource to the client pool * diff --git a/application/hub/interfaces/pool/class_PoolableListener.php b/application/hub/interfaces/pool/class_PoolableListener.php new file mode 100644 index 000000000..162d8a6c7 --- /dev/null +++ b/application/hub/interfaces/pool/class_PoolableListener.php @@ -0,0 +1,35 @@ + + * @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 . + */ +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); +} + +// +?> diff --git a/application/hub/main/nodes/class_BaseHubNode.php b/application/hub/main/nodes/class_BaseHubNode.php index c76e89776..5bf97fb0a 100644 --- a/application/hub/main/nodes/class_BaseHubNode.php +++ b/application/hub/main/nodes/class_BaseHubNode.php @@ -316,7 +316,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable { public function activateHub () { // Checks wether a listener is still active and shuts it down if one // is still listening - if (($this->checkIfListenerIsActive()) && ($this->isHubActive())) { + if (($this->determineIfListenerIsActive()) && ($this->isHubActive())) { // Shutdown them down before they can hurt anything $this->shutdownListenerPool(); } // END - if diff --git a/application/hub/main/pools/listener/class_DefaultListenerPool.php b/application/hub/main/pools/listener/class_DefaultListenerPool.php index 051f7e622..1340c8954 100644 --- a/application/hub/main/pools/listener/class_DefaultListenerPool.php +++ b/application/hub/main/pools/listener/class_DefaultListenerPool.php @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class DefaultListenerPool extends BasePool implements Poolable { +class DefaultListenerPool extends BasePool implements PoolableListener { /** * Protected constructor *