From: Roland Häder Date: Mon, 26 Oct 2020 05:55:50 +0000 (+0100) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ba26e0ffd416647dda887f679af43b64cbe43ad8;p=hub.git Continued: - moved assemblerInstance to BaseHubHandler class - updated core framework Signed-off-by: Roland Häder --- diff --git a/application/hub/classes/class_BaseHubSystem.php b/application/hub/classes/class_BaseHubSystem.php index 89f5aa2e5..c20c6f96a 100644 --- a/application/hub/classes/class_BaseHubSystem.php +++ b/application/hub/classes/class_BaseHubSystem.php @@ -13,7 +13,6 @@ use Org\Shipsimu\Hub\Listener\BaseListener; use Org\Shipsimu\Hub\Listener\Listenable; use Org\Shipsimu\Hub\Locator\Node\LocateableNode; use Org\Shipsimu\Hub\Network\Delivery\Deliverable; -use Org\Shipsimu\Hub\Network\Package\Receiver\Assembler\Assembler; use Org\Shipsimu\Hub\Network\Package\DeliverablePackage; use Org\Shipsimu\Hub\Network\Package\Delivery\Fragment\Fragmentable; use Org\Shipsimu\Hub\Network\Receive\Receivable; @@ -92,11 +91,6 @@ abstract class BaseHubSystem extends BaseFrameworkSystem implements HubInterface */ private $fragmenterInstance = NULL; - /** - * Assembler instance - */ - private $assemblerInstance = NULL; - /** * Info instance */ @@ -252,25 +246,6 @@ abstract class BaseHubSystem extends BaseFrameworkSystem implements HubInterface return $this->fragmenterInstance; } - /** - * Setter for assembler instance - * - * @param $assemblerInstance An instance of an Assembler class - * @return void - */ - protected final function setAssemblerInstance (Assembler $assemblerInstance) { - $this->assemblerInstance = $assemblerInstance; - } - - /** - * Getter for assembler instance - * - * @return $assemblerInstance An instance of an Assembler class - */ - protected final function getAssemblerInstance () { - return $this->assemblerInstance; - } - /** * Setter for info instance * diff --git a/application/hub/classes/handler/class_BaseHubHandler.php b/application/hub/classes/handler/class_BaseHubHandler.php index ab424661a..ed4fd0240 100644 --- a/application/hub/classes/handler/class_BaseHubHandler.php +++ b/application/hub/classes/handler/class_BaseHubHandler.php @@ -9,6 +9,7 @@ use Org\Shipsimu\Hub\Generic\HubInterface; use Org\Shipsimu\Hub\Information\ShareableInfo; use Org\Shipsimu\Hub\Listener\Listenable; use Org\Shipsimu\Hub\Locator\Node\LocateableNode; +use Org\Shipsimu\Hub\Network\Package\Receiver\Assembler\Assembler; use Org\Shipsimu\Hub\Node\Node; use Org\Shipsimu\Hub\Pool\Poolable; @@ -70,6 +71,11 @@ abstract class BaseHubHandler extends BaseHandler implements Handleable, HubInte */ private $universalNodeLocatorInstance = NULL; + /** + * Assembler instance + */ + private $assemblerInstance = NULL; + /** * Protected constructor * @@ -280,4 +286,23 @@ abstract class BaseHubHandler extends BaseHandler implements Handleable, HubInte return $this->nodeInstance; } + /** + * Setter for assembler instance + * + * @param $assemblerInstance An instance of an Assembler class + * @return void + */ + protected final function setAssemblerInstance (Assembler $assemblerInstance) { + $this->assemblerInstance = $assemblerInstance; + } + + /** + * Getter for assembler instance + * + * @return $assemblerInstance An instance of an Assembler class + */ + protected final function getAssemblerInstance () { + return $this->assemblerInstance; + } + } diff --git a/application/hub/classes/handler/package/class_NetworkPackageHandler.php b/application/hub/classes/handler/package/class_NetworkPackageHandler.php index 11d7334d1..f489d980d 100644 --- a/application/hub/classes/handler/package/class_NetworkPackageHandler.php +++ b/application/hub/classes/handler/package/class_NetworkPackageHandler.php @@ -847,6 +847,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei $packageInstance->setPrivateKeyHash($this->getNodeInstance()->getPrivateKeyHash()); // Now prepare the temporary array and push it on the 'undeclared' stack + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE: Pushing packageInstance=%s to stack %s ...', $packageInstance->__toString(), self::STACKER_NAME_UNDECLARED)); $this->getStackInstance()->pushNamed(self::STACKER_NAME_UNDECLARED, $packageInstance); // Debug message @@ -860,15 +861,15 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei */ public function isPackageEnqueued () { // Check whether the stacker is not empty + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE: CALLED!'); $isEnqueued = ( ($this->getStackInstance()->isStackInitialized(self::STACKER_NAME_UNDECLARED)) && (!$this->getStackInstance()->isStackEmpty(self::STACKER_NAME_UNDECLARED)) ); - // Trace message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE: isEnqueued=%d - EXIT!', intval($isEnqueued))); // Return the result + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE: isEnqueued=%d - EXIT!', intval($isEnqueued))); return $isEnqueued; } diff --git a/core b/core index f6a7ed040..e1220edf0 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit f6a7ed0407c3411090a697ba0831bb0d6f4bb616 +Subproject commit e1220edf0b09e635b818aba6465f2b7d47e7d310