]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/visitor/pool/shutdown/class_ShutdownListenerPoolVisitor.php
Continued rewrite:
[hub.git] / application / hub / main / visitor / pool / shutdown / class_ShutdownListenerPoolVisitor.php
index 8d48dbd0a934c93c1363182ec9a20599532c5c4f..2898e79fc1ac22b6dffc9b6eac48c7ffd0dff354 100644 (file)
@@ -2,11 +2,11 @@
 /**
  * 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
@@ -38,9 +38,9 @@ class ShutdownListenerPoolVisitor extends BaseVisitor implements PoolVisitor {
        /**
         * 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();
 
@@ -56,13 +56,47 @@ class ShutdownListenerPoolVisitor extends BaseVisitor implements PoolVisitor {
         */
        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!');
        }
 }