]> git.mxchange.org Git - hub.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Mon, 26 Oct 2020 14:50:07 +0000 (15:50 +0100)
committerRoland Häder <roland@mxchange.org>
Mon, 26 Oct 2020 14:51:21 +0000 (15:51 +0100)
- introduced BaseHubTask for holding nodeInstance
- added more noisy debug lines
- some more rewrites (WIP!)

Signed-off-by: Roland Häder <roland@mxchange.org>
58 files changed:
application/hub/classes/commands/console/class_HubConsoleMainCommand.php
application/hub/classes/container/socket/class_SocketContainer.php
application/hub/classes/database/frontend/class_BaseHubDatabaseWrapper.php
application/hub/classes/database/frontend/node/class_NodeDistributedHashTableDatabaseWrapper.php
application/hub/classes/discovery/recipient/socket/class_PackageSocketDiscovery.php
application/hub/classes/factories/node/class_NodeObjectFactory.php
application/hub/classes/factories/states/node/class_NodeStateFactory.php
application/hub/classes/filter/task/node/class_NodeTaskHandlerInitializerFilter.php
application/hub/classes/handler/data/answer-status/announcement/class_NodeAnnouncementAnswerOkayHandler.php
application/hub/classes/handler/data/class_BaseDataHandler.php
application/hub/classes/handler/data/message-types/announcement/class_NodeMessageAnnouncementHandler.php
application/hub/classes/handler/data/message-types/answer/class_NodeMessageAnnouncementAnswerHandler.php
application/hub/classes/handler/data/message-types/answer/class_NodeMessageRequestNodeListAnswerHandler.php
application/hub/classes/handler/data/message-types/dht/class_NodeMessageDhtBootstrapHandler.php
application/hub/classes/handler/data/message-types/requests/class_NodeMessageRequestNodeListHandler.php
application/hub/classes/handler/data/message-types/self-connect/class_NodeMessageSelfConnectHandler.php
application/hub/classes/handler/package/class_NetworkPackageHandler.php
application/hub/classes/handler/raw_data/class_BaseRawDataHandler.php
application/hub/classes/listener/class_BaseListener.php
application/hub/classes/states/dht/booting/class_DhtBootingState.php
application/hub/classes/states/node/active/class_NodeActiveState.php
application/hub/classes/tasks/apt-proxy/class_AptProxyListenerTask.php
application/hub/classes/tasks/chat/class_ChatTelnetListenerTask.php
application/hub/classes/tasks/crawler/class_BaseUrlSourceTask.php
application/hub/classes/tasks/crawler/communicator/class_CrawlerNodeCommunicatorTask.php
application/hub/classes/tasks/crawler/document_parser/class_CrawlerDocumentParserTask.php
application/hub/classes/tasks/crawler/mime_sniffer/class_CrawlerMimeSnifferTask.php
application/hub/classes/tasks/crawler/ping/class_CrawlerPingTask.php
application/hub/classes/tasks/crawler/publisher/class_CrawlerRemoteJobPublisherTask.php
application/hub/classes/tasks/crawler/snippet_extractor/class_CrawlerSnippetExtractorTask.php
application/hub/classes/tasks/crawler/structure_analyzer/class_CrawlerStructureAnalyzerTask.php
application/hub/classes/tasks/crawler/url_crawler/local/class_CrawlerLocalUrlCrawlerTask.php
application/hub/classes/tasks/crawler/url_crawler/remote/class_CrawlerRemoteUrlCrawlerTask.php
application/hub/classes/tasks/cruncher/class_CruncherKeyProducerTask.php
application/hub/classes/tasks/cruncher/class_CruncherTestUnitProducerTask.php
application/hub/classes/tasks/cruncher/class_CruncherWorkUnitFetcherTask.php
application/hub/classes/tasks/miner/block_fetcher/class_MinerBlockFetcherTask.php
application/hub/classes/tasks/miner/block_producer/class_MinerRealGenesisBlockProducerTask.php
application/hub/classes/tasks/miner/block_producer/class_MinerTestGenesisBlockProducerTask.php
application/hub/classes/tasks/miner/communicator/class_MinerNodeCommunicatorTask.php
application/hub/classes/tasks/network/class_NetworkPackageReaderTask.php
application/hub/classes/tasks/network/class_NetworkPackageWriterTask.php
application/hub/classes/tasks/node/announcement/class_NodeAnnouncementTask.php
application/hub/classes/tasks/node/chunks/class_NodeChunkAssemblerTask.php
application/hub/classes/tasks/node/decoder/class_NodePackageDecoderTask.php
application/hub/classes/tasks/node/dht/class_NodeDhtBootstrapTask.php
application/hub/classes/tasks/node/dht/class_NodeDhtInitializationTask.php
application/hub/classes/tasks/node/dht/class_NodeDhtLateBootstrapTask.php
application/hub/classes/tasks/node/dht/class_NodeDhtPublicationCheckTask.php
application/hub/classes/tasks/node/dht/class_NodeDhtPublicationTask.php
application/hub/classes/tasks/node/dht/class_NodeDhtQueryTask.php
application/hub/classes/tasks/node/listener/class_NodeSocketListenerTask.php
application/hub/classes/tasks/node/ping/class_NodePingTask.php
application/hub/classes/tasks/node/self_connect/class_NodeSelfConnectTask.php
application/hub/classes/tasks/node/tags/class_NodePackageTagsInitTask.php
application/hub/classes/tasks/node/update/class_NodeUpdateCheckTask.php
application/hub/classes/tools/hub/class_HubTools.php
application/hub/interfaces/handler/network/class_Networkable.php

index fbdd04ce9e415586655ffa140c96e1ebc4fbf4e6..6923cb7ea50415ec0e57d23501415f1b51702e22 100644 (file)
@@ -88,6 +88,7 @@ class HubConsoleMainCommand extends BaseCommand implements Commandable {
                self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BOOTSTRAP: Bootstrap finished.');
 
                // Get node instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MAIN-COMMAND: Creating node instance ...');
                $nodeInstance = NodeObjectFactory::createNodeInstance();
 
                // Add some node-specific filters, e.g. announcement
index bad9de06911fc8922a481fd68d3b1f1dfc369f1e..bc3abcdddc78d794516bedca328475c7f2acc53f 100644 (file)
@@ -88,6 +88,26 @@ class SocketContainer extends BaseHubContainer implements StorableSocket, Visita
         */
        private $socketType;
 
+       /**
+        * Peer address
+        */
+       private $peerAddress;
+
+       /**
+        * Peer port
+        */
+       private $peerPort;
+
+       /**
+        * Sender address
+        */
+       private $senderAddress;
+
+       /**
+        * Sender port
+        */
+       private $senderPort;
+
        /**
         * Protected constructor
         *
@@ -1531,7 +1551,7 @@ class SocketContainer extends BaseHubContainer implements StorableSocket, Visita
        /**
         * Getter for socket type
         *
-        * @return      $socketType             Stocket type
+        * @return      $socketType             Socket type
         */
        public function getSocketType () {
                return $this->socketType;
@@ -1547,4 +1567,80 @@ class SocketContainer extends BaseHubContainer implements StorableSocket, Visita
                $this->socketType = $socketType;
        }
 
+       /**
+        * Getter for peer address
+        *
+        * @return      $peerAddress    Peer address
+        */
+       public function getPeerAddress () {
+               return $this->peerAddress;
+       }
+
+       /**
+        * Setter for peer address
+        *
+        * @param       $peerAddress    Peer address
+        * @return      void
+        */
+       public function setPeerAddress ($peerAddress) {
+               $this->peerAddress = $peerAddress;
+       }
+
+       /**
+        * Getter for peer port
+        *
+        * @return      $peerPort       Peer port
+        */
+       public function getPeerPort () {
+               return $this->peerPort;
+       }
+
+       /**
+        * Setter for peer port
+        *
+        * @param       $peerPort       Peer port
+        * @return      void
+        */
+       public function setPeerPort ($peerPort) {
+               $this->peerPort = $peerPort;
+       }
+
+       /**
+        * Getter for sender address
+        *
+        * @return      $senderAddress  Sender address
+        */
+       public function getSenderAddress () {
+               return $this->senderAddress;
+       }
+
+       /**
+        * Setter for sender address
+        *
+        * @param       $senderAddress  Sender address
+        * @return      void
+        */
+       public function setSenderAddress ($senderAddress) {
+               $this->senderAddress = $senderAddress;
+       }
+
+       /**
+        * Getter for sender port
+        *
+        * @return      $senderPort     Sender port
+        */
+       public function getSenderPort () {
+               return $this->senderPort;
+       }
+
+       /**
+        * Setter for sender port
+        *
+        * @param       $senderPort     Sender port
+        * @return      void
+        */
+       public function setSenderPort ($senderPort) {
+               $this->senderPort = $senderPort;
+       }
+
 }
index f776e8091cb2f50663b515977cdf69fbbf05c0d0..bad6fb5964f0ec7053ebcb5dee2b9e8b40b1caa3 100644 (file)
@@ -8,6 +8,7 @@ use Org\Shipsimu\Hub\Handler\Network\RawData\HandleableRawData;
 use Org\Shipsimu\Hub\Generic\HubInterface;
 use Org\Shipsimu\Hub\Information\ShareableInfo;
 use Org\Shipsimu\Hub\Locator\Node\LocateableNode;
+use Org\Shipsimu\Hub\Node\Node;
 use Org\Shipsimu\Hub\Pool\Poolable;
 
 // Import framework stuff
@@ -62,6 +63,11 @@ abstract class BaseHubDatabaseWrapper extends BaseDatabaseWrapper implements Hub
         */
        private $universalNodeLocatorInstance = NULL;
 
+       /**
+        * Node instance
+        */
+       private $nodeInstance = NULL;
+
        /**
         * Protected constructor
         *
@@ -253,4 +259,23 @@ abstract class BaseHubDatabaseWrapper extends BaseDatabaseWrapper implements Hub
                return $this->listenerInstance;
        }
 
+       /**
+        * Setter for node instance
+        *
+        * @param       $nodeInstance   A Node instance
+        * @return      void
+        */
+       public final function setNodeInstance (Node $nodeInstance) {
+               $this->nodeInstance = $nodeInstance;
+       }
+
+       /**
+        * Getter for node instance
+        *
+        * @return      $nodeInstance   A Node instance
+        */
+       public function getNodeInstance () {
+               return $this->nodeInstance;
+       }
+
 }
index ba1a180d76379f985ff89e4a0fe5112124030a79..cc07f0bc5c5c4136eab3c0d264bfbbdde4d279b8 100644 (file)
@@ -89,6 +89,13 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseHubDatabaseWrapper imp
                // Set (primary!) table name
                $wrapperInstance->setTableName(self::DB_TABLE_NODE_DHT);
 
+               // Get node instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER: Creating node instance ...');
+               $nodeInstance = NodeObjectFactory::createNodeInstance();
+
+               // And set it here
+               $wrapperInstance->setNodeInstance($nodeInstance);
+
                // Return the instance
                return $wrapperInstance;
        }
@@ -157,8 +164,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseHubDatabaseWrapper imp
                // Debug message
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER: CALLED!');
 
-               // Get node/request instances
-               $nodeInstance = NodeObjectFactory::createNodeInstance();
+               // Get request instances
                $requestInstance = FrameworkBootstrap::getRequestInstance();
 
                // Get a dataset instance
@@ -168,7 +174,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseHubDatabaseWrapper imp
                $dataSetInstance->setUniqueKey(self::DB_COLUMN_NODE_ID);
 
                // Get Universal Node Locator and "explode" it
-               $unlInstance = $nodeInstance->determineUniversalNodeLocator();
+               $unlInstance = $this->getNodeInstance()->determineUniversalNodeLocator();
 
                // Get external UNL
                $externalUnl = $unlInstance->getExternalUnl();
@@ -179,7 +185,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseHubDatabaseWrapper imp
                assert($externalUnl !== 'invalid');
 
                // Get an array of all accepted object types
-               $objectList = $nodeInstance->getListFromAcceptedObjectTypes();
+               $objectList = $this->getNodeInstance()->getListFromAcceptedObjectTypes();
 
                // Make sure this is an array
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER: objectList()=' . count($objectList));
@@ -188,13 +194,13 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseHubDatabaseWrapper imp
                // Add public node data
                $dataSetInstance->addCriteria(self::DB_COLUMN_NODE_MODE       , $requestInstance->getRequestElement('mode'));
                $dataSetInstance->addCriteria(self::DB_COLUMN_EXTERNAL_ADDRESS, $externalUnl);
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER: nodeInstance->nodeId=' . $nodeInstance->getNodeId());
-               $dataSetInstance->addCriteria(self::DB_COLUMN_NODE_ID         , $nodeInstance->getNodeId());
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER: nodeInstance->sessionId=' . $nodeInstance->getSessionId());
-               $dataSetInstance->addCriteria(self::DB_COLUMN_SESSION_ID      , $nodeInstance->getSessionId());
-               $dataSetInstance->addCriteria(self::DB_COLUMN_PRIVATE_KEY_HASH, $nodeInstance->getNodePrivateKeyHash());
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER: nodeInstance->nodeId=' . $this->getNodeInstance()->getNodeId());
+               $dataSetInstance->addCriteria(self::DB_COLUMN_NODE_ID         , $this->getNodeInstance()->getNodeId());
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER: nodeInstance->sessionId=' . $this->getNodeInstance()->getSessionId());
+               $dataSetInstance->addCriteria(self::DB_COLUMN_SESSION_ID      , $this->getNodeInstance()->getSessionId());
+               $dataSetInstance->addCriteria(self::DB_COLUMN_PRIVATE_KEY_HASH, $this->getNodeInstance()->getNodePrivateKeyHash());
                $dataSetInstance->addCriteria(self::DB_COLUMN_ACCEPTED_OBJECTS, implode(BaseHubNode::OBJECT_LIST_SEPARATOR, $objectList));
-               $dataSetInstance->addCriteria(self::DB_COLUMN_ACCEPT_BOOTSTRAP, $this->translateBooleanToYesNo($nodeInstance->isAcceptingDhtBootstrap()));
+               $dataSetInstance->addCriteria(self::DB_COLUMN_ACCEPT_BOOTSTRAP, $this->translateBooleanToYesNo($this->getNodeInstance()->isAcceptingDhtBootstrap()));
 
                // Return it
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER: dataSetInstance=' . $dataSetInstance->__toString() . ' - EXIT!');
@@ -212,11 +218,8 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseHubDatabaseWrapper imp
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER: CALLED!');
                $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
 
-               // Get node instance
-               $nodeInstance = NodeObjectFactory::createNodeInstance();
-
                // Get Universal Node Locator and "explode" it
-               $unlInstance = $nodeInstance->determineUniversalNodeLocator();
+               $unlInstance = $this->getNodeInstance()->determineUniversalNodeLocator();
 
                // Make sure the external address is set and not invalid
                // @TODO Bad check on UNL, better use a proper validator
@@ -226,8 +229,8 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseHubDatabaseWrapper imp
 
                // Add Universal Node Locator/node id as criteria
                $searchInstance->addCriteria(self::DB_COLUMN_EXTERNAL_ADDRESS, $externalUnl);
-               $searchInstance->addCriteria(self::DB_COLUMN_NODE_ID         , $nodeInstance->getNodeId());
-               $searchInstance->addCriteria(self::DB_COLUMN_SESSION_ID      , $nodeInstance->getSessionId());
+               $searchInstance->addCriteria(self::DB_COLUMN_NODE_ID         , $this->getNodeInstance()->getNodeId());
+               $searchInstance->addCriteria(self::DB_COLUMN_SESSION_ID      , $this->getNodeInstance()->getSessionId());
                $searchInstance->setLimit(1);
 
                // Query database and get a result instance back
@@ -277,14 +280,11 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseHubDatabaseWrapper imp
                // Assert to make sure this method is called with one record in DB (the actual backend of the DHT)
                assert($this->isLocalNodeRegistered());
 
-               // Get node instance
-               $nodeInstance = NodeObjectFactory::createNodeInstance();
-
                // Get search criteria
                $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
 
                // Search for node id and limit it to one entry
-               $searchInstance->addCriteria(self::DB_COLUMN_NODE_ID, $nodeInstance->getNodeId());
+               $searchInstance->addCriteria(self::DB_COLUMN_NODE_ID, $this->getNodeInstance()->getNodeId());
                $searchInstance->setLimit(1);
 
                // Get a prepared dataset instance
@@ -466,6 +466,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseHubDatabaseWrapper imp
         */
        public function updateNode (array $nodeData) {
                // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER: nodeData=' . print_r($nodeData, TRUE));
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER: CALLED!');
 
                // Assert on array elements
@@ -492,14 +493,8 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseHubDatabaseWrapper imp
                // Set primary key (session id)
                $dataSetInstance->setUniqueKey(self::DB_COLUMN_SESSION_ID);
 
-               // Get node instance
-               $nodeInstance = NodeObjectFactory::createNodeInstance();
-
-               // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER: nodeData=' . print_r($nodeData, TRUE));
-
                // Add all array elements
-               $nodeInstance->addArrayToDataSet($dataSetInstance, $nodeData);
+               $this->getNodeInstance()->addArrayToDataSet($dataSetInstance, $nodeData);
 
                // Remove 'node_list'
                $dataSetInstance->unsetCriteria(self::DB_COLUMN_NODE_LIST);
index 7881fa9a6a3502cf235308e6fa550066eeaa071a..3416d4da46495c39f81767719fcc779758a2feb5 100644 (file)
@@ -88,6 +88,7 @@ class PackageSocketDiscovery extends BaseRecipientDiscovery implements Discovera
                 * Get the listener pool instance, we need to lookup the matching
                 * listener->poolInstance chain there.
                 */
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-SOCKET-DISCOVERY: Creating node instance ...');
                $poolInstance = NodeObjectFactory::createNodeInstance()->getListenerPoolInstance();
 
                // Init listener instance
index 3b9529acf587f83c40cccd1117a47cc3a55d42a4..a08b7d21b22a4e663c6a89b40cdb5ce95df9aa95 100644 (file)
@@ -51,26 +51,26 @@ class NodeObjectFactory extends ObjectFactory {
         */
        public static final function createNodeInstance (Requestable $requestInstance = NULL, Responseable $responseInstance = NULL) {
                // Get new factory instance
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: requestInstance[]=%s,responseInstance[]=%s - CALLED!', gettype($requestInstance), gettype($responseInstance)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: requestInstance[]=%s,responseInstance[]=%s - CALLED!', gettype($requestInstance), gettype($responseInstance)));
                $factoryInstance = new NodeObjectFactory();
 
                // If there is no handler?
                if (GenericRegistry::getRegistry()->instanceExists('node')) {
                        // Get handler from registry
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-FACTORY: Getting node instance from registry ...');
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-FACTORY: Getting node instance from registry ...');
 
                        $nodeInstance = GenericRegistry::getRegistry()->getInstance('node');
                } elseif (($requestInstance instanceof Requestable) && ($responseInstance instanceof Responseable)) {
                        // The default node-mode is from our configuration
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-FACTORY: requestInstance and responseInstance are both set.');
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-FACTORY: requestInstance and responseInstance are both set.');
                        $nodeMode = $factoryInstance->getConfigInstance()->getConfigEntry('node_default_mode');
 
                        // Is the node 'mode' parameter set?
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: nodeMode=%s - from CONFIG', $nodeMode));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: nodeMode=%s - from CONFIG', $nodeMode));
                        if ($requestInstance->isRequestElementSet('mode')) {
                                // Then use this which overrides the config entry temporarily
                                $nodeMode = $requestInstance->getRequestElement('mode');
-                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: nodeMode=%s - from REQUEST', $nodeMode));
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: nodeMode=%s - from REQUEST', $nodeMode));
                        } else {
                                // Set it for easier re-usage
                                $requestInstance->setRequestElement('mode', $nodeMode);
@@ -84,18 +84,18 @@ class NodeObjectFactory extends ObjectFactory {
                        );
 
                        // Get the node instance
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: Loading class with className=%s ...', $className));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: Loading class with className=%s ...', $className));
                        $nodeInstance = ObjectFactory::createObjectByName($className);
 
                        // Get a registry
                        $applicationInstance = GenericRegistry::getRegistry()->getInstance('application');
 
                        // Add node-specific filters
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: Registering node-specific filters, responseInstance[]=%s', gettype($responseInstance)));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: Registering node-specific filters, responseInstance[]=%s', gettype($responseInstance)));
                        $nodeInstance->addExtraFilters($applicationInstance->getControllerInstance(), $responseInstance);
 
                        // Add it to the registry
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: Adding nodeInstance=%s to registry ...', $nodeInstance->__toString()));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: Adding nodeInstance=%s to registry ...', $nodeInstance->__toString()));
                        GenericRegistry::getRegistry()->addInstance('node', $nodeInstance);
                } else {
                        // Throw an exception here
@@ -103,7 +103,7 @@ class NodeObjectFactory extends ObjectFactory {
                }
 
                // Return the instance
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: nodeInstance=%s - EXIT!', $nodeInstance->__toString()));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: nodeInstance=%s - EXIT!', $nodeInstance->__toString()));
                return $nodeInstance;
        }
 
index a68111368993e795e14ee13479b4e941f987ac7a..2086cf0a4865224035c52533ec027c4ff5500add 100644 (file)
@@ -57,6 +57,7 @@ class NodeStateFactory extends ObjectFactory {
                // Is the node instance set?
                if (is_null($nodeInstance)) {
                        // Get node instance from registry
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NOTE-STATE-FACTORY: Creating node instance ...');
                        $nodeInstance = NodeObjectFactory::createNodeInstance();
                } // END - if
 
index 058b02818b1a4e578b5618202a680a091f551bfc..dd980171d32da5b96b708b56d55a485739606208 100644 (file)
@@ -70,6 +70,7 @@ class NodeTaskHandlerInitializerFilter extends BaseNodeFilter implements Filtera
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get node instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-TASK-HANDLER-INIT-FILTER: Creating node instance ...');
                $nodeInstance = NodeObjectFactory::createNodeInstance();
 
                // Get a new task handler instance
index 8b0e0ba9d3e9b1f09c652ccdf220af15de5981d4..fb926640ea6153d0842dd27729081d43d487fe9d 100644 (file)
@@ -95,6 +95,7 @@ class NodeAnnouncementAnswerOkayHandler extends BaseAnswerStatusHandler implemen
                $handlerInstance->registerTask('dht_late_bootstrap', $taskInstance);
 
                // Get the node instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-MESSAGE-HANDLER: Creating node instance ...');
                $nodeInstance = NodeObjectFactory::createNodeInstance();
 
                // Change state
@@ -124,6 +125,7 @@ class NodeAnnouncementAnswerOkayHandler extends BaseAnswerStatusHandler implemen
         */
        protected function initMessageConfigurationData (array $messageData) {
                // Get node instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-MESSAGE-HANDLER: Creating node instance ...');
                $nodeInstance = NodeObjectFactory::createNodeInstance();
 
                // Get an array of all accepted object types
index df149e5fcff8014bd3b0f490ea2b1bbfe6a4e0fe..380c9439e61c92d7039164b88634866a9ca65f8a 100644 (file)
@@ -109,12 +109,13 @@ abstract class BaseDataHandler extends BaseHubHandler implements HubInterface {
         */
        protected function prepareAnswerMessage (array $messageData, Deliverable $packageInstance) {
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATA-HANDLER:Going to send an answer message for ' . $this->getHandlerName() . ' ...');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-DATA-HANDLER:Going to send an answer message for ' . $this->getHandlerName() . ' ...');
 
                // Get a helper instance based on this handler's name
                $helperInstance = ObjectFactory::createObjectByConfiguredName('node_answer_' . $this->getHandlerName() . '_helper_class', array($messageData));
 
                // Get node instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-DATA-HANDLER: Creating node instance ...');
                $nodeInstance = NodeObjectFactory::createNodeInstance();
 
                // Load descriptor XML
@@ -130,7 +131,7 @@ abstract class BaseDataHandler extends BaseHubHandler implements HubInterface {
                $helperInstance->getTemplateInstance()->compileConfigInVariables();
 
                // Deliver the package
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-DHT-FACADE: Calling helperInstance->sendPackage(%s) ...', $nodeInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-DATA-HANDLER: Calling helperInstance->sendPackage(%s) ...', $nodeInstance->__toString()));
                $helperInstance->sendPackage($nodeInstance);
 
                /*
@@ -139,7 +140,7 @@ abstract class BaseDataHandler extends BaseHubHandler implements HubInterface {
                $this->removeMessageConfigurationData($messageData);
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATA-HANDLER:Answer message has been prepared.');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-DATA-HANDLER:Answer message has been prepared.');
        }
 
        /**
@@ -151,7 +152,7 @@ abstract class BaseDataHandler extends BaseHubHandler implements HubInterface {
         */
        protected function prepareNextMessage (array $messageData, Deliverable $packageInstance) {
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATA-HANDLER:Going to send next message ...');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-DATA-HANDLER:Going to send next message ...');
 
                // Get a helper instance based on this handler's name
                $helperInstance = ObjectFactory::createObjectByConfiguredName('node_next_' . $this->getHandlerName() . '_helper_class', array($messageData));
@@ -181,7 +182,7 @@ abstract class BaseDataHandler extends BaseHubHandler implements HubInterface {
                $this->removeMessageConfigurationData($messageData);
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATA-HANDLER:Next message has been prepared.');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-DATA-HANDLER:Next message has been prepared.');
        }
 
        /**
index 4f87b3911fc9cd747a8a22b75dd146a18b545e54..b2454547845182caa877954c426230d2d68e056a 100644 (file)
@@ -109,6 +109,7 @@ class NodeMessageAnnouncementHandler extends BaseMessageHandler implements Handl
         */
        public function handleMessageData (array $messageData, Receivable $packageInstance) {
                // Get node instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-MESSAGE-HANDLER: Creating node instance ...');
                $nodeInstance = NodeObjectFactory::createNodeInstance();
 
                // Is this node accepting announcements?
index 0ce455121d9afc9c1f7daa031703dbf7c932defc..272f70a088d0f61f22e9353aca0142d1787cb5b0 100644 (file)
@@ -111,6 +111,7 @@ class NodeMessageAnnouncementAnswerHandler extends BaseMessageHandler implements
         */
        public function handleMessageData (array $messageData, Receivable $packageInstance) {
                // Get node instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-MESSAGE-HANDLER: Creating node instance ...');
                $nodeInstance = NodeObjectFactory::createNodeInstance();
 
                // Has this node attempted to announce itself?
index 4d28c0ef3fa993d7c2f8e2a574d1e05844febfbb..bf552b046da06062c2b3d90c7f2f66dceee95adb 100644 (file)
@@ -94,6 +94,7 @@ class NodeMessageRequestNodeListAnswerHandler extends BaseMessageHandler impleme
         */
        public function handleMessageData (array $messageData, Receivable $packageInstance) {
                // Get node instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-MESSAGE-HANDLER: Creating node instance ...');
                $nodeInstance = NodeObjectFactory::createNodeInstance();
 
                // Has this node attempted to announce itself?
index 2d526408ed0bdbecfc76800b53fc963a2bcd2e35..266699eed51946cbbe7bd7cf11301c76b22a031f 100644 (file)
@@ -104,6 +104,7 @@ class NodeMessageDhtBootstrapHandler extends BaseMessageHandler implements Handl
         */
        public function handleMessageData (array $messageData, Receivable $packageInstance) {
                // Is this node accepting DHT bootstrap requests?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-MESSAGE-HANDLER: Creating node instance ...');
                if (!NodeObjectFactory::createNodeInstance()->isAcceptingDhtBootstrap()) {
                        /*
                         * This node is not accepting DHT bootstrap requests.
index e97821aab7db28b7270ca74515341c40d7d16ebe..c01178a7d5d91dece976643bdcc3040227c1a30b 100644 (file)
@@ -89,6 +89,7 @@ class NodeMessageRequestNodeListHandler extends BaseMessageHandler implements Ha
         */
        public function handleMessageData (array $messageData, Receivable $packageInstance) {
                // Get node instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-MESSAGE-HANDLER: Creating node instance ...');
                $nodeInstance = NodeObjectFactory::createNodeInstance();
 
                // Is this node accepting announcements?
index ae784ba9b7f3e7639413b9c5b2f1d86a746460f0..adcd2b4c40b14663f0f30f6bcf48fd4ac05dadc0 100644 (file)
@@ -72,6 +72,7 @@ class NodeMessageSelfConnectHandler extends BaseMessageHandler implements Handle
         */
        public function handleMessageData (array $messageData, Receivable $packageInstance) {
                // Get node instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-MESSAGE-HANDLER: Creating node instance ...');
                $nodeInstance = NodeObjectFactory::createNodeInstance();
 
                // Are node id and session id the same?
index ad5726a2293a0e2d861fc9f587f6000caef1dfe6..e7cf86680fb50137500473fa4d326106e72cfa89 100644 (file)
@@ -355,6 +355,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                $packageInstance->setAssemblerInstance($assemblerInstance);
 
                // Get node instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Creating node instance ...');
                $nodeInstance = NodeObjectFactory::createNodeInstance();
 
                // Set it locally
@@ -1193,7 +1194,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                 * Get the decoded data from the handler, this is an array with
                 * 'raw_data' and 'error_code' as elements.
                 */
-               $packageInstance = $handlerInstance->getNextRawData();
+               $packageInstance = $handlerInstance->getNextPackageInstance();
 
                // Very noisy debug message:
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: decodedData[' . gettype($packageInstance) . ']=' . print_r($packageInstance, TRUE));
index f3422631fcc18f54290043907af247feee618074..ed557f1eb2b63179fd4aa3f13c5ba5e68b5d62f4 100644 (file)
@@ -70,13 +70,13 @@ abstract class BaseRawDataHandler extends BaseHubHandler implements HandleableRa
         */
        protected function initStack () {
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('RAW-DATA-HANDLER: CALLED!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-RAW-DATA-HANDLER: CALLED!');
 
                // Init stack(s)
                $this->getStackInstance()->initStack(self::STACKER_NAME_RAW_DATA);
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('RAW-DATA-HANDLER: EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-RAW-DATA-HANDLER: EXIT!');
        }
 
        /**
@@ -87,19 +87,23 @@ abstract class BaseRawDataHandler extends BaseHubHandler implements HandleableRa
         */
        protected function addRawDataToStacker ($rawData) {
                // Trace message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('RAW-DATA-HANDLER: rawData(%d)=%s - CALLED!', strlen($rawData), $rawData));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-RAW-DATA-HANDLER: rawData(%d)=%s - CALLED!', strlen($rawData), $rawData));
+
+               // Get package data instance
+               $packageInstance = ObjectFactory::createObjectByConfiguredName('package_data_class');
+
+               // Set all data
+               $packageInstance->setRawData($rawData);
+               $packageInstance->setErrorCode($this->getErrorCode());
 
                /*
                 * Add the deocoded data and error code to the stacker so other classes
                 * (e.g. NetworkPackage) can "pop" it from the stacker.
                 */
-               $this->getStackInstance()->pushNamed(self::STACKER_NAME_RAW_DATA, array(
-                       HandleableRawData::PACKAGE_RAW_DATA   => $rawData,
-                       HandleableRawData::PACKAGE_ERROR_CODE => $this->getErrorCode()
-               ));
+               $this->getStackInstance()->pushNamed(self::STACKER_NAME_RAW_DATA, $packageInstance);
 
                // Trace message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('RAW-DATA-HANDLER: EXIT!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-RAW-DATA-HANDLER: EXIT!');
        }
 
        /**
@@ -109,13 +113,13 @@ abstract class BaseRawDataHandler extends BaseHubHandler implements HandleableRa
         */
        public function isRawDataPending () {
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('RAW-DATA-HANDLER: CALLED!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-RAW-DATA-HANDLER: CALLED!');
 
                // Does the stacker have some entries (not empty)?
                $isPending = (!$this->getStackInstance()->isStackEmpty(self::STACKER_NAME_RAW_DATA));
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('RAW-DATA-HANDLER: isPending=%d - EXIT!', intval($isPending)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-RAW-DATA-HANDLER: isPending=%d - EXIT!', intval($isPending)));
 
                // Return it
                return $isPending;
@@ -124,14 +128,14 @@ abstract class BaseRawDataHandler extends BaseHubHandler implements HandleableRa
        /**
         * "Getter" for next raw data from the stacker
         *
-        * @return      $rawData        Raw data from the stacker
+        * @return      $packageInstance        An instance of a DeliverablePackage class
         */
-       public function getNextRawData () {
+       public function getNextPackageInstance () {
                // "Pop" the raw data from the stacker
-               $rawData = $this->getStackInstance()->popNamed(self::STACKER_NAME_RAW_DATA);
+               $packageInstance = $this->getStackInstance()->popNamed(self::STACKER_NAME_RAW_DATA);
 
                // And return it
-               return $rawData;
+               return $packageInstance;
        }
 
        /**
@@ -144,16 +148,17 @@ abstract class BaseRawDataHandler extends BaseHubHandler implements HandleableRa
         */
        protected function ifRecipientMatchesOwnUniversalNodeLocator (DeliverablePackage $packageInstance) {
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('RAW-DATA-HANDLER: packageInstance=%s - CALLED!', $packageInstance->__toString()));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-RAW-DATA-HANDLER: packageInstance=%s - CALLED!', $packageInstance->__toString()));
 
                // Construct own address first
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-RAW-DATA-HANDLER: Creating node instance ...');
                $ownAddress = NodeObjectFactory::createNodeInstance()->determineUniversalNodeLocator();
 
                // Does it match?
                $matches = ($ownAddress === $packageInstance->getRecipientUnl());
 
                // Trace message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('RAW-DATA-HANDLER: matches=%d - EXIT!', intval($matches)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-RAW-DATA-HANDLER: matches=%d - EXIT!', intval($matches)));
 
                // Return result
                return $matches;
index 2adc9de9324d2a13cd1766d939e6d57dcdcf9460..5205df3089192d4879d9b5a952a5f5c21ff11171 100644 (file)
@@ -382,6 +382,7 @@ abstract class BaseListener extends BaseHubSystem implements Visitable {
                } // END - if
 
                // Get node instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: Creating node instance ...', strtoupper($this->getProtocolName())));
                $nodeInstance = NodeObjectFactory::createNodeInstance();
 
                // Get a connection info instance
index a5bf58ccccb4526050dbcc1d77124b115ddb8b85..9152c024424a5d047ed53c0ddd629b7d0c87a8ec 100644 (file)
@@ -56,11 +56,10 @@ class DhtBootingState extends BaseDhtState implements Stateable {
        public final static function createDhtBootingState (Distributable $dhtInstance) {
                // Get new instance
                $stateInstance = new DhtBootingState();
-
-               // Debug message
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-STATE: Has changed from ' . $dhtInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.');
 
                // Get node instance and enable DHT bootstrap requests
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-BOOTING-STATE: Creating node instance ...');
                NodeObjectFactory::createNodeInstance()->enableAcceptDhtBootstrap();
 
                // Update DHT node info as well
index a846d9b706d6bb43b0fca0b0747dde23c02d5e91..bc4a87abcb8984bd99c99b830f4ff7d46ec88b31 100644 (file)
@@ -55,6 +55,7 @@ class NodeActiveState extends BaseNodeState implements Stateable {
                $stateInstance = new NodeActiveState();
 
                // Get node instance and set 'active' flag
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-ACTIVE-STATE: Creating node instance ...');
                NodeObjectFactory::createNodeInstance()->enableIsActive();
 
                // Return the prepared instance
index 355077ad1bf9b1471c803c7b94994df7fe591913..554fa2e6a9bf4344a357c993caa62b9d90d3908e 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\AptProxy\Task\Listener;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Task\BaseHubTask;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
 use Org\Mxchange\CoreFramework\Task\Taskable;
@@ -30,7 +33,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class AptProxyListenerTask extends BaseTask implements Taskable, Visitable {
+class AptProxyListenerTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index a64fb0cf3ac6546228e51e4e1934cd40b22ff4ac..64a9f11081e8fbd1c4c86b855ede449c37339ed3 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Chat\Task\Listener\Telnet;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Task\BaseHubTask;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
 use Org\Mxchange\CoreFramework\Task\Taskable;
@@ -30,7 +33,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class ChatTelnetListenerTask extends BaseTask implements Taskable, Visitable {
+class ChatTelnetListenerTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index f5a9dd18ddcff2ff42a7a4322607568dd36eac8b..6e97311047a54b9bc4665fafb3fbfae815f9931b 100644 (file)
@@ -5,6 +5,7 @@ namespace Org\Shipsimu\Hub\Crawler\Task\Source\Url;
 // Import application-specific stuff
 use Org\Shipsimu\Hub\Crawler\Source\Url\UrlSource;
 use Org\Shipsimu\Hub\Crawler\Source\Url\UrlSourceObjectFactory;
+use Org\Shipsimu\Hub\Task\BaseHubTask;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
@@ -31,7 +32,7 @@ use Org\Mxchange\CoreFramework\Task\BaseTask;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-abstract class BaseUrlSourceTask extends BaseTask {
+abstract class BaseUrlSourceTask extends BaseHubTask {
 
        /**
         * An instance of a UrlSource class
index a64a03054ce94c12eb854bee028078ecb02cae7d..c73a639d3e71f4910ecbd3f505890c3be1aaa616 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Shipsimu\Hub\Crawler\Task\Communicator\Node;
 
 // Import application-specific stuff
 use Org\Shipsimu\Hub\Factory\Communicator\CommunicatorFactory;
+use Org\Shipsimu\Hub\Task\BaseHubTask;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
@@ -34,7 +35,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class CrawlerNodeCommunicatorTask extends BaseTask implements Taskable, Visitable {
+class CrawlerNodeCommunicatorTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index 6aa9286b7add5c35e9b33acba545b0f9f58504ed..082014ee2f4279871d1cfeb386ef64c5dc6bf0b6 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Crawler\Task\Parser\Document;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Task\BaseHubTask;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
 use Org\Mxchange\CoreFramework\Task\Taskable;
@@ -30,7 +33,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class CrawlerDocumentParserTask extends BaseTask implements Taskable, Visitable {
+class CrawlerDocumentParserTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index d78bcd54d9a85694e3ae1d3fe59bb22bfee6afb9..d3de517abc76f9a8f31019af8d64f4a01d9b863b 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Crawler\Task\Sniffer\Mime;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Task\BaseHubTask;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
 use Org\Mxchange\CoreFramework\Task\Taskable;
@@ -30,7 +33,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class CrawlerMimeSnifferTask extends BaseTask implements Taskable, Visitable {
+class CrawlerMimeSnifferTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index b7ca226c48f6f180fc0fee8508007b543095c424..1b180c78a6b3b7146d5ad3d803187398850d515a 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Crawler\Task\Ping;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Task\BaseHubTask;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
 use Org\Mxchange\CoreFramework\Task\Taskable;
@@ -30,7 +33,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class CrawlerPingTask extends BaseTask implements Taskable, Visitable {
+class CrawlerPingTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index 18e44d2be17be0e8005ae82e65ea4d68f450fb6d..3be4e604de6bc8174b1fbb413bf5978e5626a89a 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Crawler\Task\Publisher\Job\Remote;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Task\BaseHubTask;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
 use Org\Mxchange\CoreFramework\Task\Taskable;
@@ -30,7 +33,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class CrawlerRemoteJobPublisherTask extends BaseTask implements Taskable, Visitable {
+class CrawlerRemoteJobPublisherTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index 0fd0211a69bd39a5fd20647257285c736dfc83dd..cb09e18173e0d04cca8ceced680e53fb34fe3317 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Crawler\Task\SnippetExtractor;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Task\BaseHubTask;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
 use Org\Mxchange\CoreFramework\Task\Taskable;
@@ -30,7 +33,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class CrawlerSnippetExtractorTask extends BaseTask implements Taskable, Visitable {
+class CrawlerSnippetExtractorTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index ad3778f1cb75c8ced03f5ba7e75ea597301d7499..5d131ad8054588d3fc641537be96bde2a49c37a8 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Crawler\Task\Analyzer\DocumentStructure;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Task\BaseHubTask;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
 use Org\Mxchange\CoreFramework\Task\Taskable;
@@ -30,7 +33,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class CrawlerStructureAnalyzerTask extends BaseTask implements Taskable, Visitable {
+class CrawlerStructureAnalyzerTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index c5769aaf8ec57ed592c41e701f2aa424d0d47054..278f3c686301238c7bcba468d2e445dc7721e1cf 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Crawler\Task\Crawler\LocalUrl;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Task\BaseHubTask;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
 use Org\Mxchange\CoreFramework\Task\Taskable;
@@ -30,7 +33,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class CrawlerLocalUrlCrawlerTask extends BaseTask implements Taskable, Visitable {
+class CrawlerLocalUrlCrawlerTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index 256542303bb047f4fb28f242d21d89e8d4425455..d6dfd56d013cf44201721cc736dae12bd7ff0a3e 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Crawler\Task\Crawler\RemoteUrl;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Task\BaseHubTask;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
 use Org\Mxchange\CoreFramework\Task\Taskable;
@@ -30,7 +33,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class CrawlerRemoteUrlCrawlerTask extends BaseTask implements Taskable, Visitable {
+class CrawlerRemoteUrlCrawlerTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index ccd7c6f3c1241c7dc9d3e9d37b2719c772cddfee..b70f468e188b337ec3034a42a65c7d94e013b2b4 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Cruncher\Producer\Key;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Task\BaseHubTask;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
 use Org\Mxchange\CoreFramework\Task\Taskable;
@@ -30,7 +33,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class CruncherKeyProducerTask extends BaseTask implements Taskable, Visitable {
+class CruncherKeyProducerTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index efdd5a4a28b9bc86271ed452553a37225e657bfd..4f04633cbb2daa33f4ab07ef2d13653d8c8f2ce3 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Cruncher\Task\Producer\Unit;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Task\BaseHubTask;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
 use Org\Mxchange\CoreFramework\Task\Taskable;
@@ -30,7 +33,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class CruncherTestUnitProducerTask extends BaseTask implements Taskable, Visitable {
+class CruncherTestUnitProducerTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index 31a67510549a7d1ca2ec7d92c5f170888337e816..10f1a71708dcd7746caced177de45e4ba1378c13 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Cruncher\Task\Fetcher\WorkUnit;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Task\BaseHubTask;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 use Org\Mxchange\CoreFramework\Task\BaseTask;
@@ -32,7 +35,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class CruncherWorkUnitFetcherTask extends BaseTask implements Taskable, Visitable {
+class CruncherWorkUnitFetcherTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index a960699623abc2c034a84031ea78364f8b3a6c90..1ae6a208b14fd44d73dce4db381c53ab7b42b225 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Miner\Task\Fetcher\Block;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Task\BaseHubTask;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 use Org\Mxchange\CoreFramework\Task\BaseTask;
@@ -32,7 +35,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class MinerBlockFetcherTask extends BaseTask implements Taskable, Visitable {
+class MinerBlockFetcherTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index 89a7e2dc704897254071a6f53a1874e99cf66791..49c13e7f76295dc7c2e9f42372070670a72fc52f 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Miner\Task\Producer\GenesisBlock;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Task\BaseHubTask;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 use Org\Mxchange\CoreFramework\Task\BaseTask;
@@ -31,7 +34,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class MinerRealGenesisBlockProducerTask extends BaseTask implements Taskable, Visitable {
+class MinerRealGenesisBlockProducerTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index f0ee3c2097146b92ad2829d6f6ba5d313e6926ab..8e722f6cfb9c49e83d711c8a5454aa127d11b7cd 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Miner\Task\Producer\GenesisBlock;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Task\BaseHubTask;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
 use Org\Mxchange\CoreFramework\Task\Taskable;
@@ -30,7 +33,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class MinerTestGenesisBlockProducerTask extends BaseTask implements Taskable, Visitable {
+class MinerTestGenesisBlockProducerTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index fd4dbdaadcf133b31f0192c29963629a13c2b951..e36633b0f4bf67176d9437e2a54e791f8018e5b0 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Shipsimu\Hub\Miner\Task\Communicator\Node;
 
 // Import application-specific stuff
 use Org\Shipsimu\Hub\Factory\Communicator\CommunicatorFactory;
+use Org\Shipsimu\Hub\Task\BaseHubTask;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
@@ -33,7 +34,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class MinerNodeCommunicatorTask extends BaseTask implements Taskable, Visitable {
+class MinerNodeCommunicatorTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index 8a697f817a49d9e6af0ec0edb87fa220830f8378..f7a97036cc3951438f3022557b4048320cdbe596 100644 (file)
@@ -5,6 +5,7 @@ namespace Org\Shipsimu\Hub\Task\Network\Reader;
 // Import application-specific stuff
 use Org\Shipsimu\Hub\Factory\Handler\Network\NetworkPackageHandlerFactory;
 use Org\Shipsimu\Hub\Factory\Network\NetworkPackageFactory;
+use Org\Shipsimu\Hub\Task\BaseHubTask;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
@@ -34,7 +35,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class NetworkPackageReaderTask extends BaseTask implements Taskable, Visitable {
+class NetworkPackageReaderTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index 8296bcb5e75abedf53fcd88e9adb480d447e3336..5500ebc86ff74b6b42e7fd65064c40fbaaaa5e17 100644 (file)
@@ -5,6 +5,7 @@ namespace Org\Shipsimu\Hub\Task\Network\Writer;
 // Import application-specific stuff
 use Org\Shipsimu\Hub\Factory\Handler\Network\NetworkPackageHandlerFactory;
 use Org\Shipsimu\Hub\Factory\Network\NetworkPackageFactory;
+use Org\Shipsimu\Hub\Task\BaseHubTask;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
@@ -34,7 +35,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class NetworkPackageWriterTask extends BaseTask implements Taskable, Visitable {
+class NetworkPackageWriterTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index dbbf9d49a967460e04ab5aec9706b0f9ed6bd29f..5e430f2a6c8f854744b511855f84d6ca2de30469 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Shipsimu\Hub\Node\Task\Announcement;
 
 // Import application-specific stuff
 use Org\Shipsimu\Hub\Factory\Node\NodeObjectFactory;
+use Org\Shipsimu\Hub\Task\BaseHubTask;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
@@ -33,7 +34,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class NodeAnnouncementTask extends BaseTask implements Taskable, Visitable {
+class NodeAnnouncementTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
@@ -75,6 +76,7 @@ class NodeAnnouncementTask extends BaseTask implements Taskable, Visitable {
         */
        public function executeTask () {
                // Get the node instance and announce us
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-ANNOUNCEMENT-TASK: Creating node instance ...');
                NodeObjectFactory::createNodeInstance()->announceToUpperNodes($this);
        }
 
index eb32ab7f08d9ee44da36333b3adebd73a7cbec63..5e3205991998446faa833ca052559ff6cb9a9634 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Shipsimu\Hub\Node\Task\Assembler;
 
 // Import application-specific stuff
 use Org\Shipsimu\Hub\Factory\Handler\Chunk\ChunkHandlerFactory;
+use Org\Shipsimu\Hub\Task\BaseHubTask;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
@@ -33,7 +34,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class NodeChunkAssemblerTask extends BaseTask implements Taskable, Visitable {
+class NodeChunkAssemblerTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index 79766ea468068fa728596c0026ca7e06b20008b7..399a9131aff0fe2548daf4f50eb7f38adb2557d4 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Shipsimu\Hub\Node\Task\Decoder;
 
 // Import application-specific stuff
 use Org\Shipsimu\Hub\Factory\Decoder\DecoderFactory;
+use Org\Shipsimu\Hub\Task\BaseHubTask;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
@@ -33,7 +34,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class NodePackageDecoderTask extends BaseTask implements Taskable, Visitable {
+class NodePackageDecoderTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index c1703028ce878fda7de22e0538ae660de379b763..4017181bc0523a82aa827659e816f04960217ba1 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Shipsimu\Hub\Node\Task\Dht\Bootstrap;
 
 // Import application-specific stuff
 use Org\Shipsimu\Hub\Factory\Dht\DhtObjectFactory;
+use Org\Shipsimu\Hub\Task\BaseHubTask;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
@@ -33,7 +34,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class NodeDhtBootstrapTask extends BaseTask implements Taskable, Visitable {
+class NodeDhtBootstrapTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index 7bcf94e741d2ae491bd718a5e454301049d66f61..48586cf54db06c08629e924eb2c25ba218571c31 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Shipsimu\Hub\Node\Task\Dht\Initialization;
 
 // Import application-specific stuff
 use Org\Shipsimu\Hub\Factory\Dht\DhtObjectFactory;
+use Org\Shipsimu\Hub\Task\BaseHubTask;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
@@ -33,7 +34,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class NodeDhtInitializationTask extends BaseTask implements Taskable, Visitable {
+class NodeDhtInitializationTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index 06a2479b42a62eb0cc2a80643bcfc226ce19c8b6..0f1b0530487e3c7fcb860a61c74ed6ff02d42062 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Shipsimu\Hub\Node\Task\Dht\Bootstrap\Late;
 
 // Import application-specific stuff
 use Org\Shipsimu\Hub\Factory\Dht\DhtObjectFactory;
+use Org\Shipsimu\Hub\Task\BaseHubTask;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
@@ -33,7 +34,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class NodeDhtLateBootstrapTask extends BaseTask implements Taskable, Visitable {
+class NodeDhtLateBootstrapTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index a36cc1a8bf9c14cfe320ef4f178d8779a1dfec22..0e08c0d55c794fc81b7be88cd5545cc11f29b512 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Shipsimu\Hub\Node\Task\Dht\Check\Publication;
 
 // Import application-specific stuff
 use Org\Shipsimu\Hub\Factory\Dht\DhtObjectFactory;
+use Org\Shipsimu\Hub\Task\BaseHubTask;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
@@ -33,7 +34,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class NodeDhtPublicationCheckTask extends BaseTask implements Taskable, Visitable {
+class NodeDhtPublicationCheckTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index 30187eac55c6f60c3ac129312a2e9625d4ef7b36..b4c65c4e7ac97bc27d13adba7571137c8074ede3 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Shipsimu\Hub\Node\Task\Dht\Publication;
 
 // Import application-specific stuff
 use Org\Shipsimu\Hub\Factory\Dht\DhtObjectFactory;
+use Org\Shipsimu\Hub\Task\BaseHubTask;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
@@ -33,7 +34,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class NodeDhtPublicationTask extends BaseTask implements Taskable, Visitable {
+class NodeDhtPublicationTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index 70df5717aaeb7ad0017875740c92921ce06f1790..ffc0950d5a23eb6f6f51c8339c6339ce8c04bd0a 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Shipsimu\Hub\Node\Task\Dht\Query;
 
 // Import application-specific stuff
 use Org\Shipsimu\Hub\Factory\Dht\DhtObjectFactory;
+use Org\Shipsimu\Hub\Task\BaseHubTask;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
@@ -33,7 +34,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class NodeDhtQueryTask extends BaseTask implements Taskable, Visitable {
+class NodeDhtQueryTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index fce578f5cf90c22e055485841ef43281f4dfc99f..784b6452b8de036e9342c78587c8d62ed4247cf4 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Shipsimu\Hub\Node\Task\Listener\Socket;
 
 // Import application-specific stuff
 use Org\Shipsimu\Hub\Factory\Node\NodeObjectFactory;
+use Org\Shipsimu\Hub\Task\BaseHubTask;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
@@ -33,7 +34,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class NodeSocketListenerTask extends BaseTask implements Taskable, Visitable {
+class NodeSocketListenerTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
@@ -53,6 +54,13 @@ class NodeSocketListenerTask extends BaseTask implements Taskable, Visitable {
                // Get new instance
                $taskInstance = new NodeSocketListenerTask();
 
+               // Get the node instance from registry
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('LISTENER-TASK: Creating node instance ...');
+               $nodeInstance = NodeObjectFactory::createNodeInstance();
+
+               // And set it here
+               $taskInstance->setNodeInstance($nodeInstance);
+
                // Return the prepared instance
                return $taskInstance;
        }
@@ -64,12 +72,9 @@ class NodeSocketListenerTask extends BaseTask implements Taskable, Visitable {
         * @return      void
         */
        public function accept (Visitor $visitorInstance) {
-               // Get the node instance from registry
-               $nodeInstance = NodeObjectFactory::createNodeInstance();
-
                // Visit the pool listener task
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('LISTENER-TASK: Going to visit object ' . $nodeInstance->getListenerPoolInstance()->__toString() . ' ...');
-               $nodeInstance->getListenerPoolInstance()->accept($visitorInstance);
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('LISTENER-TASK: Going to visit object ' . $this->getNodeInstance()->getListenerPoolInstance()->__toString() . ' ...');
+               $this->getNodeInstance()->getListenerPoolInstance()->accept($visitorInstance);
 
                // Visit this task
                // @TODO Do we need to visit this task? $visitorInstance->visitTask($this);
index cf9e9e0264ddda1de585ac58206eeccc3c2f5db4..7d952ee28eec5819e3c5aa64d3151b71b4eed6e9 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Node\Ping;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Task\BaseHubTask;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Lists\Listable;
 use Org\Mxchange\CoreFramework\Task\BaseTask;
@@ -31,7 +34,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class NodePingTask extends BaseTask implements Taskable, Visitable {
+class NodePingTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index ec2541e417591d1c8bd50b5f181534592a0b0728..73e17b0c763071d93f4b5b122c532d54af3556d6 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Shipsimu\Hub\Node\Task\SelfConnect;
 
 // Import application-specific stuff
 use Org\Shipsimu\Hub\Factory\Node\NodeObjectFactory;
+use Org\Shipsimu\Hub\Task\BaseHubTask;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
@@ -33,7 +34,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class NodeSelfConnectTask extends BaseTask implements Taskable, Visitable {
+class NodeSelfConnectTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
@@ -75,6 +76,7 @@ class NodeSelfConnectTask extends BaseTask implements Taskable, Visitable {
         */
        public function executeTask () {
                // Get the node instance and try it
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-SELF-CONNECT-TASK: Creating node instance ...');
                NodeObjectFactory::createNodeInstance()->doSelfConnection($this);
        }
 
@@ -85,7 +87,7 @@ class NodeSelfConnectTask extends BaseTask implements Taskable, Visitable {
         * @todo        0% done
         */
        public function doShutdown () {
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-SELF-CONNECTTASK: Shutting down...');
+               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-SELF-CONNECT-TASK: Shutting down...');
        }
 
 }
index 7ab62f1628872e6d10e181098ae63c38806df636..65d963882ba577ce6e6b38a20de40cbf0a197533 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Shipsimu\Hub\Node\Task\Initialization\Tag;
 
 // Import application-specific stuff
 use Org\Shipsimu\Hub\Factory\Tag\Package\PackageTagsFactory;
+use Org\Shipsimu\Hub\Task\BaseHubTask;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
@@ -33,7 +34,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class NodePackageTagsInitTask extends BaseTask implements Taskable, Visitable {
+class NodePackageTagsInitTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index c04d95d8f54748f7114a9bb2a1cd400022220f4a..86df7c647c605824a9c0cd984101b82a8480658c 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Node\Check\Update;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Task\BaseHubTask;
+
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Task\BaseTask;
 use Org\Mxchange\CoreFramework\Task\Taskable;
@@ -30,7 +33,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class NodeUpdateCheckTask extends BaseTask implements Taskable, Visitable {
+class NodeUpdateCheckTask extends BaseHubTask implements Taskable, Visitable {
        /**
         * Protected constructor
         *
index 9dd5d43d044965f839b30ecfc2df8df08f1f9c48..0729124946d78fe16b76a93ad7f26e4f9b4034d2 100644 (file)
@@ -115,6 +115,7 @@ class HubTools extends BaseHubSystem {
                        $recipientUniversalNodeLocator = $recipient[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_EXTERNAL_ADDRESS];
                } else {
                        // Get the instance, this might throw a NPE
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HUB-TOOLS: Creating node instance ...');
                        $nodeInstance = NodeObjectFactory::createNodeInstance();
 
                        // Is the session id the same?
index 8f221b08c3bebcea31d1da513ede6f4a3f4b264f..d851b6ec42408be8a631e31a01a1de7860150c28 100644 (file)
@@ -54,6 +54,6 @@ interface Networkable extends HandleableDataSet, HandleableRawData {
         *
         * @return      $packageInstance        An instance of a DeliverablePackage class
         */
-       function getNextRawData ();
+       function getNextPackageInstance ();
 
 }