]> git.mxchange.org Git - hub.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Tue, 1 Dec 2020 22:41:52 +0000 (23:41 +0100)
committerRoland Häder <roland@mxchange.org>
Tue, 1 Dec 2020 22:41:52 +0000 (23:41 +0100)
- moved $handerInstance from monolithic BaseFrameworkSystem class (the class
  later cleaned from such instances is doing fine) to proper classes
- updated core framework

Signed-off-by: Roland Häder <roland@mxchange.org>
application/hub/classes/decoder/class_BaseDecoder.php
application/hub/classes/handler/protocol/class_BaseProtocolHandler.php
application/hub/classes/helper/connection/ipv4/class_BaseIpV4ConnectionHelper.php
application/hub/classes/info/class_BaseInfo.php
application/hub/classes/listener/class_BaseListener.php
application/hub/classes/listener/class_BaseListenerDecorator.php
application/hub/classes/package/assembler/class_PackageAssembler.php
application/hub/classes/tasks/node/chunks/class_NodeChunkAssemblerTask.php
core

index 73c986855d21816ea5044b5539082a46ead6ab87..b6af543810c4d769b872a88e1a2a16cb0c4200fb 100644 (file)
@@ -7,6 +7,7 @@ use Org\Shipsimu\Hub\Generic\BaseHubSystem;
 use Org\Shipsimu\Hub\Network\Delivery\Deliverable;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Handler\Handleable;
 use Org\Mxchange\CoreFramework\Stacker\Stackable;
 
 /**
@@ -42,6 +43,11 @@ abstract class BaseDecoder extends BaseHubSystem {
         */
        private $stackInstance = NULL;
 
+       /**
+        * Handler instance
+        */
+       private $handlerInstance = NULL;
+
        /**
         * Protected constructor
         *
@@ -91,4 +97,23 @@ abstract class BaseDecoder extends BaseHubSystem {
                return $this->stackInstance;
        }
 
+       /**
+        * Setter for handler instance
+        *
+        * @param       $handlerInstance        An instance of a Handleable class
+        * @return      void
+        */
+       protected final function setHandlerInstance (Handleable $handlerInstance) {
+               $this->handlerInstance = $handlerInstance;
+       }
+
+       /**
+        * Getter for handler instance
+        *
+        * @return      $handlerInstance        A Handleable instance
+        */
+       protected final function getHandlerInstance () {
+               return $this->handlerInstance;
+       }
+
 }
index d89bc6b4804ad5794b153db1e3045034b9b35081..a6fc984f60428aaa517edbf98250cd63b3caafaf 100644 (file)
@@ -61,7 +61,7 @@ abstract class BaseProtocolHandler extends BaseHubHandler implements HandleableP
         * @param       $protocolName   Name of used protocol
         * @return      void
         */
-       protected final function setProtocolName ($protocolName) {
+       protected final function setProtocolName (string $protocolName) {
                $this->protocolName = $protocolName;
        }
 
index 1c39b7fb51b034c3bb23bf27913cd055c08fb42b..853fc73abffec2972bf8b22ceb49eb3d13884c7c 100644 (file)
@@ -9,6 +9,7 @@ use Org\Shipsimu\Hub\Locator\Node\LocateableNode;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+use Org\Mxchange\CoreFramework\Handler\Handleable;
 
 /**
  * A ??? connection helper class
@@ -39,6 +40,11 @@ abstract class BaseIpV4ConnectionHelper extends BaseConnectionHelper {
         */
        private $protocolName = 'invalid';
 
+       /**
+        * Handler instance
+        */
+       private $handlerInstance = NULL;
+
        /**
         * Protected constructor
         *
@@ -50,6 +56,44 @@ abstract class BaseIpV4ConnectionHelper extends BaseConnectionHelper {
                parent::__construct($className);
        }
 
+       /**
+        * Setter for protocol name
+        *
+        * @param       $protocolName   Name of used protocol
+        * @return      void
+        */
+       protected final function setProtocolName (string $protocolName) {
+               $this->protocolName = $protocolName;
+       }
+
+       /**
+        * Getter for protocol name
+        *
+        * @return      $protocolName   Name of used protocol
+        */
+       public final function getProtocolName () {
+               return $this->protocolName;
+       }
+
+       /**
+        * Setter for handler instance
+        *
+        * @param       $handlerInstance        An instance of a Handleable class
+        * @return      void
+        */
+       protected final function setHandlerInstance (Handleable $handlerInstance) {
+               $this->handlerInstance = $handlerInstance;
+       }
+
+       /**
+        * Getter for handler instance
+        *
+        * @return      $handlerInstance        A Handleable instance
+        */
+       protected final function getHandlerInstance () {
+               return $this->handlerInstance;
+       }
+
        /**
         * Attempts to connect to a peer by given IP number and port from an UNL
         * instance with currently configured timeout.
@@ -162,23 +206,4 @@ abstract class BaseIpV4ConnectionHelper extends BaseConnectionHelper {
                $this->initSocketInstance();
        }
 
-       /**
-        * Setter for protocol name
-        *
-        * @param       $protocolName   Name of used protocol
-        * @return      void
-        */
-       protected final function setProtocolName ($protocolName) {
-               $this->protocolName = $protocolName;
-       }
-
-       /**
-        * Getter for protocol name
-        *
-        * @return      $protocolName   Name of used protocol
-        */
-       public final function getProtocolName () {
-               return $this->protocolName;
-       }
-
 }
index f56407093fe494fb7ce2bdb4725a9d9bda7d8204..200ccbc85cfc866e210eca858ab6db5ac6d9f5d0 100644 (file)
@@ -5,7 +5,7 @@ namespace Org\Shipsimu\Hub\Information;
 // Import application-specific stuff
 use Org\Shipsimu\Hub\Generic\BaseHubSystem;
 
-// Import framework-specific stuff
+// Import framework stuff
 use Org\Mxchange\CoreFramework\Helper\Helper;
 
 /**
index d4131f38fe3e23a1b678b23d93f0fd925a10c992..ba84a870d564d99751a3b8f2de1a8b78b9051e8b 100644 (file)
@@ -20,6 +20,7 @@ use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
 use Org\Mxchange\CoreFramework\Factory\Registry\Socket\SocketRegistryFactory;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
+use Org\Mxchange\CoreFramework\Handler\Handleable;
 use Org\Mxchange\CoreFramework\Registry\Register;
 use Org\Mxchange\CoreFramework\Socket\InvalidServerSocketException;
 use Org\Mxchange\CoreFramework\Socket\SocketAlreadyRegisteredException;
@@ -88,6 +89,11 @@ abstract class BaseListener extends BaseHubSystem implements Visitable {
         */
        private $registryInstance = NULL;
 
+       /**
+        * Handler instance
+        */
+       private $handlerInstance = NULL;
+
        /**
         * Protected constructor
         *
@@ -235,6 +241,25 @@ abstract class BaseListener extends BaseHubSystem implements Visitable {
                return $this->registryInstance;
        }
 
+       /**
+        * Setter for handler instance
+        *
+        * @param       $handlerInstance        An instance of a Handleable class
+        * @return      void
+        */
+       protected final function setHandlerInstance (Handleable $handlerInstance) {
+               $this->handlerInstance = $handlerInstance;
+       }
+
+       /**
+        * Getter for handler instance
+        *
+        * @return      $handlerInstance        A Handleable instance
+        */
+       public final function getHandlerInstance () {
+               return $this->handlerInstance;
+       }
+
        /**
         * Registeres the given socket resource for "this" listener instance. This
         * will be done in a seperate class to allow package writers to use it
index 6918df20152c92d9ea714ae69bf752d93ff6350b..69c9f54d22d546b5df80b10dae6f8258522c26dd 100644 (file)
@@ -74,7 +74,7 @@ abstract class BaseListenerDecorator extends BaseDecorator implements Visitable
         * @param       $protocolName   Name of used protocol
         * @return      void
         */
-       protected final function setProtocolName ($protocolName) {
+       protected final function setProtocolName (string $protocolName) {
                $this->protocolName = $protocolName;
        }
 
index 9ccbac0ee9e6a952136810153dfb7c4753b29ff5..15a7095f63ae8fa34952deeabd69e7416b94ed56 100644 (file)
@@ -16,6 +16,7 @@ use Org\Shipsimu\Hub\Network\Receive\Receivable;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
+use Org\Mxchange\CoreFramework\Handler\Handleable;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
 use Org\Mxchange\CoreFramework\Utils\String\StringUtils;
 use Org\Mxchange\CoreFramework\Stacker\Stackable;
@@ -79,6 +80,11 @@ class PackageAssembler extends BaseHubSystem implements Assembler, Registerable,
         */
        private $stackInstance = NULL;
 
+       /**
+        * Handler instance
+        */
+       private $handlerInstance = NULL;
+
        /**
         * Protected constructor
         *
@@ -175,6 +181,25 @@ class PackageAssembler extends BaseHubSystem implements Assembler, Registerable,
                return $this->stackInstance;
        }
 
+       /**
+        * Setter for handler instance
+        *
+        * @param       $handlerInstance        An instance of a Handleable class
+        * @return      void
+        */
+       protected final function setHandlerInstance (Handleable $handlerInstance) {
+               $this->handlerInstance = $handlerInstance;
+       }
+
+       /**
+        * Getter for handler instance
+        *
+        * @return      $handlerInstance        A Handleable instance
+        */
+       protected final function getHandlerInstance () {
+               return $this->handlerInstance;
+       }
+
        /**
         * Checks whether the input buffer (stacker to be more preceise) is empty.
         *
index c0cad7659b7b6b602ee7efb2a7850480bc76912d..33c1d749a9c2df489abc39750615880ec062b75a 100644 (file)
@@ -7,6 +7,7 @@ use Org\Shipsimu\Hub\Factory\Handler\Chunk\ChunkHandlerFactory;
 use Org\Shipsimu\Hub\Task\BaseHubTask;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Handler\Handleable;
 use Org\Mxchange\CoreFramework\Task\BaseTask;
 use Org\Mxchange\CoreFramework\Task\Taskable;
 use Org\Mxchange\CoreFramework\Visitor\Visitable;
@@ -35,6 +36,11 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 class NodeChunkAssemblerTask extends BaseHubTask implements Taskable, Visitable {
+       /**
+        * Handler instance
+        */
+       private $handlerInstance = NULL;
+
        /**
         * Protected constructor
         *
@@ -45,6 +51,25 @@ class NodeChunkAssemblerTask extends BaseHubTask implements Taskable, Visitable
                parent::__construct(__CLASS__);
        }
 
+       /**
+        * Setter for handler instance
+        *
+        * @param       $handlerInstance        An instance of a Handleable class
+        * @return      void
+        */
+       protected final function setHandlerInstance (Handleable $handlerInstance) {
+               $this->handlerInstance = $handlerInstance;
+       }
+
+       /**
+        * Getter for handler instance
+        *
+        * @return      $handlerInstance        A Handleable instance
+        */
+       protected final function getHandlerInstance () {
+               return $this->handlerInstance;
+       }
+
        /**
         * Creates an instance of this class
         *
diff --git a/core b/core
index 28ff0710d8eb3a2d0c1547d6ebeaae05eb50c7f6..2b0e7f20e7d554a5675c3268db6de3dd3ab3421d 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit 28ff0710d8eb3a2d0c1547d6ebeaae05eb50c7f6
+Subproject commit 2b0e7f20e7d554a5675c3268db6de3dd3ab3421d