]> git.mxchange.org Git - hub.git/commitdiff
Removed getNodeInstance() and setNodeInstance(). Please now use the following
authorRoland Haeder <roland@mxchange.org>
Sat, 22 Aug 2015 09:47:18 +0000 (11:47 +0200)
committerRoland Haeder <roland@mxchange.org>
Sat, 22 Aug 2015 09:47:18 +0000 (11:47 +0200)
expression to get a node instance:

<?php
$nodeInstance = NodeObjectFactory::createNodeInstance();
?>

Signed-off-by: Roland Haeder <roland@mxchange.org>
application/hub/exceptions/dht/class_DhtBootstrapNotAcceptedException.php
application/hub/main/class_BaseHubSystem.php
application/hub/main/handler/message-types/dht/class_NodeMessageDhtBootstrapHandler.php
application/hub/main/pools/listener/class_DefaultListenerPool.php

index 33bfea6b8fd43e12442c34aa551d6c6cf3245f9f..474d86e2b627e926551e59133f8c7526b89bb7bc 100644 (file)
@@ -35,7 +35,7 @@ class DhtBootstrapNotAcceptedException extends FrameworkException {
                $message = sprintf('[%s:%d] This node (%s) is not accepting DHT bootstrap requests, but got one from session-id=%s,unl=%s/%s,status=%s,mode=%s',
                        $messageArray[0]->__toString(),
                        $this->getLine(),
-                       $messageArray[0]->getNodeInstance()->__toString(),
+                       NodeObjectFactory::createNodeInstance()->__toString(),
                        $messageArray[1][XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_SESSION_ID],
                        $messageArray[1][XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_EXTERNAL_ADDRESS],
                        $messageArray[1][XmlDhtBootstrapTemplateEngine::DHT_BOOTSTRAP_DATA_INTERNAL_ADDRESS],
index d8b886856bd8957c49a52f2199004d5599022b8c..77bf1c3456bf5096e76cb203d92354e44a250413 100644 (file)
@@ -90,25 +90,6 @@ class BaseHubSystem extends BaseFrameworkSystem {
                parent::__construct($className);
        }
 
-       /**
-        * Getter for node instance
-        *
-        * @return      $nodeInstance   An instance of a node node
-        */
-       public final function getNodeInstance () {
-               return $this->nodeInstance;
-       }
-
-       /**
-        * Setter for node instance
-        *
-        * @param       $nodeInstance   An instance of a node node
-        * @return      void
-        */
-       protected final function setNodeInstance (NodeHelper $nodeInstance) {
-               $this->nodeInstance = $nodeInstance;
-       }
-
        /**
         * Setter for network package handler instance
         *
index 8e16c876fd8e160c300e2649065f832a52948d2c..0bf5c5964af5cad680798d461747586668834ea2 100644 (file)
@@ -73,15 +73,6 @@ class NodeMessageDhtBootstrapHandler extends BaseMessageHandler implements Handl
                // Get new instance
                $handlerInstance = new NodeMessageDhtBootstrapHandler();
 
-               // Get node instance
-               $nodeInstance = NodeObjectFactory::createNodeInstance();
-
-               // Debug message
-               self::createDebugInstance(__CLASS__)->debugOutput('POOL[' . __METHOD__ . ':' . __LINE__ . ':] Setting node ...');
-
-               // ... and set it here
-               $handlerInstance->setNodeInstance($nodeInstance);
-
                // Get a DHT instance
                $dhtInstance = DhtObjectFactory::createDhtInstance('node');
 
@@ -102,7 +93,7 @@ class NodeMessageDhtBootstrapHandler extends BaseMessageHandler implements Handl
         */
        public function handleMessageData (array $messageData, Receivable $packageInstance) {
                // Is this node accepting DHT bootstrap requests?
-               if (!$this->getNodeInstance()->isAcceptingDhtBootstrap()) {
+               if (!NodeObjectFactory::createNodeInstance()->isAcceptingDhtBootstrap()) {
                        /*
                         * This node is not accepting DHT bootstrap requests.
                         */
index 3409bd484ba1f79eecb2c04ab04aa932e7d46609..5f9cf6e4cd401004fc6ce2e1901c0c464a72be1d 100644 (file)
@@ -42,12 +42,6 @@ class DefaultListenerPool extends BasePool implements PoolableListener {
                // Get new instance
                $listenerInstance = new DefaultListenerPool();
 
-               // Debug message
-               self::createDebugInstance(__CLASS__)->debugOutput('POOL[' . __METHOD__ . ':' . __LINE__ . ':] Setting node ...');
-
-               // Set the application instance
-               $listenerInstance->setNodeInstance($nodeInstance);
-
                // Return the prepared instance
                return $listenerInstance;
        }