]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/class_BaseHubSystem.php
'hub' project continued:
[hub.git] / application / hub / main / class_BaseHubSystem.php
index 62c578028bb04f1efa92cbdc0ecf35bb4c821f6b..18a448d7aebfcd33a6c1c0f1fee221566e021af2 100644 (file)
@@ -66,6 +66,16 @@ class BaseHubSystem extends BaseFrameworkSystem {
         */
        private $listenerPoolInstance = NULL;
 
+       /**
+        * Fragmenter instance
+        */
+       private $fragmenterInstance = NULL;
+
+       /**
+        * Decoder instance
+        */
+       private $decoderInstance = NULL;
+
        /**
         * Protected constructor
         *
@@ -210,6 +220,44 @@ class BaseHubSystem extends BaseFrameworkSystem {
                return $this->listenerPoolInstance;
        }
 
+       /**
+        * Setter for fragmenter instance
+        *
+        * @param       $fragmenterInstance             A Fragmentable instance
+        * @return      void
+        */
+       protected final function setFragmenterInstance (Fragmentable $fragmenterInstance) {
+               $this->fragmenterInstance = $fragmenterInstance;
+       }
+
+       /**
+        * Getter for fragmenter instance
+        *
+        * @return      $fragmenterInstance             A Fragmentable instance
+        */
+       protected final function getFragmenterInstance () {
+               return $this->fragmenterInstance;
+       }
+
+       /**
+        * Setter for decoder instance
+        *
+        * @param       $decoderInstance        A Decodeable instance
+        * @return      void
+        */
+       protected final function setDecoderInstance (Decodeable $decoderInstance) {
+               $this->decoderInstance = $decoderInstance;
+       }
+
+       /**
+        * Getter for decoder instance
+        *
+        * @return      $decoderInstance        A Decodeable instance
+        */
+       protected final function getDecoderInstance () {
+               return $this->decoderInstance;
+       }
+
        /**
         * Constructs a callable method name from given socket error code. If the
         * method is not found, a generic one is used.
@@ -219,10 +267,7 @@ class BaseHubSystem extends BaseFrameworkSystem {
         * @throws      UnsupportedSocketErrorHandlerException If the error handler is not implemented
         */
        protected function getSocketErrorHandlerFromCode ($errorCode) {
-               // Set NULL, so everyone is forced to implement socket error handlers
-               $handlerName = NULL;
-
-               // Temporary create a possible name from translated error code
+               // Create a name from translated error code
                $handlerName = 'socketError' . $this->convertToClassName($this->translateSocketErrorCodeToName($errorCode)) . 'Handler';
 
                // Is the call-back method there?
@@ -382,6 +427,9 @@ class BaseHubSystem extends BaseFrameworkSystem {
                // Get a visitor instance
                $visitorInstance = ObjectFactory::createObjectByConfiguredName('shutdown_socket_visitor_class');
 
+               // Debug output
+               $this->debugOutput('HUB-SYSTEM:' . $this->__toString() . ': visitorInstance=' . $visitorInstance->__toString());
+
                // Call the visitor
                $this->accept($visitorInstance);
        }
@@ -403,6 +451,9 @@ class BaseHubSystem extends BaseFrameworkSystem {
                // Get a visitor instance
                $visitorInstance = ObjectFactory::createObjectByConfiguredName('half_shutdown_socket_visitor_class');
 
+               // Debug output
+               $this->debugOutput('HUB-SYSTEM:' . $this->__toString() . ': visitorInstance=' . $visitorInstance->__toString());
+
                // Call the visitor
                $this->accept($visitorInstance);
        }