/**
* A ListenerPool shutdown visitor
*
- * @author Roland Haeder <webmaster@ship-simu.org>
+ * @author Roland Haeder <webmaster@shipsimu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub Developer Team
* @license GNU GPL 3.0 or any newer version
- * @link http://www.ship-simu.org
+ * @link http://www.shipsimu.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
/**
* Creates an instance of this class
*
- * @return $visitorInstance An instance a Visitorable class
+ * @return $visitorInstance An instance a Visitorable class
*/
- public final static function createShutdownListenerPoolVisitor () {
+ public static final function createShutdownListenerPoolVisitor () {
// Get new instance
$visitorInstance = new ShutdownListenerPoolVisitor();
*/
public function visitPool (Poolable $poolInstance) {
// Debug message
- $this->debugOutput('VISITOR: Visit of ' . $poolInstance->__toString() . ' - START');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: Visit of ' . $poolInstance->__toString() . ' - CALLED!');
// Pre-shutdown the pool
$poolInstance->preShutdown();
// Debug message
- $this->debugOutput('VISITOR: Visit of ' . $poolInstance->__toString() . ' - FINISHED');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: Visit of ' . $poolInstance->__toString() . ' - EXIT!');
+ }
+
+ /**
+ * Visits the given decorator instance
+ *
+ * @param $decoratorInstance A Listenable decorator instance
+ * @return void
+ */
+ public function visitDecorator (Listenable $decoratorInstance) {
+ // Debug message
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: Visit of ' . $decoratorInstance->__toString() . ' - CALLED!');
+
+ // Pre-shutdown the pool
+ $decoratorInstance->doShutdown();
+
+ // Debug message
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: Visit of ' . $decoratorInstance->__toString() . ' - EXIT!');
+ }
+
+ /**
+ * Visits the given listener instance
+ *
+ * @param $listenerInstance A Listenable class instance
+ * @return void
+ */
+ public function visitListener (Listenable $listenerInstance) {
+ // Debug message
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: Visit of ' . $listenerInstance->__toString() . ' - CALLED!');
+
+ // Pre-shutdown the pool
+ $listenerInstance->doShutdown();
+
+ // Debug message
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ' ]: Visit of ' . $listenerInstance->__toString() . ' - EXIT!');
}
}