]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/listener/class_BaseListener.php
Removed deprecated code (see last commit why)
[hub.git] / application / hub / main / listener / class_BaseListener.php
index 1a767f9cb16a6eddfe596e1d32d54232b6c7aece..b81ffd2027d98f28c52c1a78a443f4fb2b481cad 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
+ * @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
  *
@@ -29,7 +29,7 @@ class BaseListener extends BaseHubSystem implements Visitable {
        /**
         * Used protocol (Default: invalid, which is indeed invalid...)
         */
-       private $protcol = 'invalid';
+       private $protocol = 'invalid';
 
        /**
         * Address (IP mostly) we shall listen on
@@ -51,11 +51,6 @@ class BaseListener extends BaseHubSystem implements Visitable {
         */
        private $poolInstance = null;
 
-       /**
-        * A network package handler instance
-        */
-       private $packageInstance = null;
-
        /**
         * Protected constructor
         *
@@ -202,7 +197,7 @@ class BaseListener extends BaseHubSystem implements Visitable {
         * @param       $poolInstance   The peer pool instance we shall set
         * @return      void
         */
-       protected final function setPoolInstance (Poolablepeer $poolInstance) {
+       protected final function setPoolInstance (PoolablePeer $poolInstance) {
                $this->poolInstance = $poolInstance;
        }
 
@@ -215,25 +210,6 @@ class BaseListener extends BaseHubSystem implements Visitable {
                return $this->poolInstance;
        }
 
-       /**
-        * 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;
-       }
-
        /**
         * Registeres the given socket resource for "this" listener instance. This
         * will be done in a seperate class to allow package writers to use it
@@ -302,7 +278,7 @@ class BaseListener extends BaseHubSystem implements Visitable {
         */
        public function accept (Visitor $visitorInstance) {
                // Debug message
-               //* DEBUG: */ $this->debugOutput('LISTENER: ' . $visitorInstance->__toString() . ' has visited ' . $this->__toString() . ' - START');
+               //* DEBUG: */ $this->debugOutput(strtoupper($this->getProtocol()) . '-LISTENER: ' . $visitorInstance->__toString() . ' has visited ' . $this->__toString() . ' - START');
 
                // Visit this listener
                $visitorInstance->visitListener($this);
@@ -313,7 +289,20 @@ class BaseListener extends BaseHubSystem implements Visitable {
                } // END - if
 
                // Debug message
-               //* DEBUG: */ $this->debugOutput('LISTENER: ' . $visitorInstance->__toString() . ' has visited ' . $this->__toString() . ' - FINISHED');
+               //* DEBUG: */ $this->debugOutput(strtoupper($this->getProtocol()) . '-LISTENER: ' . $visitorInstance->__toString() . ' has visited ' . $this->__toString() . ' - FINISHED');
+       }
+
+       /**
+        * Monitors incoming raw data from the handler and transfers it to the
+        * given receiver instance. This method should not be called, please call
+        * the decorator's version instead to seperator node/client traffic.
+        *
+        * @param       $receiverInstance       An instance of a Receivable class
+        * @return      void
+        * @throws      UnsupportedOperatorException    If this method is called by a mistake
+        */
+       public function monitorIncomingRawData (Receivable $receiverInstance) {
+               throw new UnsupportedOperationException(array($this, __FUNCTION__, $receiverInstance), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 }