* @version 0.0.0 * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 . */ class BaseHubSystem extends BaseFrameworkSystem { /** * An instance of a node */ private $nodeInstance = null; /** * Listener instance */ private $listenerInstance = null; /** * A network package handler instance */ private $packageInstance = null; /** * Protected constructor * * @param $className Name of the class * @return void */ protected function __construct ($className) { // Call parent constructor parent::__construct($className); } /** * Setter for listener instance * * @param $listenerInstance A Listenable instance * @return void */ protected final function setListenerInstance (Listenable $listenerInstance) { $this->listenerInstance = $listenerInstance; } /** * Getter for listener instance * * @return $listenerInstance A Listenable instance */ protected final function getListenerInstance () { return $this->listenerInstance; } /** * 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; } /** * Setter for network package handler instance * * @param $packageInstance The network package handler instance we shall set * @return void */ protected final function setPackageInstance (Networkable $packageInstance) { $this->packageInstance = $packageInstance; } /** * Getter for network package handler instance * * @return $packageInstance The network package handler instance we shall set */ protected final function getPackageInstance () { return $this->packageInstance; } /** * Shuts down a given socket resource. This method does only ease calling * the right visitor. * * @param $socketResource A valid socket resource * @return void */ public function shutdownSocket ($socketResource) { // Debug message $this->debugOutput('Shutting down socket ' . $socketResource . ' ...'); // Set socket resource $this->setSocketResource($socketResource); // Get a visitor instance $visitorInstance = ObjectFactory::createObjectByConfiguredName('shutdown_socket_visitor_class'); // Call the visitor $this->accept($visitorInstance); } } // [EOF] ?>