]> git.mxchange.org Git - hub.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Wed, 2 Dec 2020 18:38:57 +0000 (19:38 +0100)
committerRoland Häder <roland@mxchange.org>
Wed, 2 Dec 2020 18:38:57 +0000 (19:38 +0100)
- replaced $handlerInstance with HandleableTrait
- added deeper namespace
- updated core framework

Signed-off-by: Roland Häder <roland@mxchange.org>
application/hub/classes/decoder/class_BaseDecoder.php
application/hub/classes/helper/connection/ipv4/class_BaseIpV4ConnectionHelper.php
application/hub/classes/listener/class_BaseListener.php
application/hub/classes/package/assembler/class_PackageAssembler.php
application/hub/classes/tasks/network/class_NetworkPackageReaderTask.php
application/hub/classes/tasks/network/class_NetworkPackageWriterTask.php
application/hub/classes/tasks/node/chunks/class_NodeChunkAssemblerTask.php
application/hub/config.php
core

index 9849337d63c945f599233dca6fcb75dd9908b7bc..8dc5285d9d8c4d06307a1fd2f5c4dd4cd408cf84 100644 (file)
@@ -7,7 +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\Traits\Handler\HandleableTrait;
 use Org\Mxchange\CoreFramework\Traits\Stacker\StackableTrait;
 
 /**
@@ -34,6 +34,7 @@ use Org\Mxchange\CoreFramework\Traits\Stacker\StackableTrait;
  */
 abstract class BaseDecoder extends BaseHubSystem {
        // Load traits
+       use HandleableTrait;
        use StackableTrait;
 
        /**
@@ -41,11 +42,6 @@ abstract class BaseDecoder extends BaseHubSystem {
         */
        private $packageHandlerInstance = NULL;
 
-       /**
-        * Handler instance
-        */
-       private $handlerInstance = NULL;
-
        /**
         * Protected constructor
         *
@@ -76,23 +72,4 @@ abstract class BaseDecoder extends BaseHubSystem {
                return $this->packageHandlerInstance;
        }
 
-       /**
-        * 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 407b84537ca362650c6511ebed88cd251b5dd681..c0b72c7e953abfd2c400fd0f3503628b4c2d7593 100644 (file)
@@ -10,7 +10,7 @@ use Org\Shipsimu\Hub\Traits\Container\Socket\StorableSocketTrait;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
-use Org\Mxchange\CoreFramework\Handler\Handleable;
+use Org\Mxchange\CoreFramework\Traits\Handler\HandleableTrait;
 
 /**
  * A ??? connection helper class
@@ -37,6 +37,7 @@ use Org\Mxchange\CoreFramework\Handler\Handleable;
  */
 abstract class BaseIpV4ConnectionHelper extends BaseConnectionHelper {
        // Load traits
+       use HandleableTrait;
        use StorableSocketTrait;
 
        /**
@@ -44,11 +45,6 @@ abstract class BaseIpV4ConnectionHelper extends BaseConnectionHelper {
         */
        private $protocolName = 'invalid';
 
-       /**
-        * Handler instance
-        */
-       private $handlerInstance = NULL;
-
        /**
         * Protected constructor
         *
@@ -79,25 +75,6 @@ abstract class BaseIpV4ConnectionHelper extends BaseConnectionHelper {
                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.
index 3d27b7a29207561f4948d0a76044c1db1bc8d296..395ed284d94f812b94c0d5953d82bc262e1d1bf1 100644 (file)
@@ -21,10 +21,10 @@ 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;
+use Org\Mxchange\CoreFramework\Traits\Handler\HandleableTrait;
 use Org\Mxchange\CoreFramework\Traits\Iterator\IteratorTrait;
 use Org\Mxchange\CoreFramework\Visitor\Visitable;
 use Org\Mxchange\CoreFramework\Visitor\Visitor;
@@ -58,6 +58,7 @@ use \LogicException;
 abstract class BaseListener extends BaseHubSystem implements Visitable {
        // Load traits
        use IteratorTrait;
+       use HandleableTrait;
        use StorableSocketTrait;
 
        // Exception code constants
@@ -95,11 +96,6 @@ abstract class BaseListener extends BaseHubSystem implements Visitable {
         */
        private $registryInstance = NULL;
 
-       /**
-        * Handler instance
-        */
-       private $handlerInstance = NULL;
-
        /**
         * Protected constructor
         *
@@ -247,25 +243,6 @@ 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 a6e776c6fc59d570d371f4865925e487f2ec8789..c27fcb807b59242d5113b5c59223c3ba79cb753c 100644 (file)
@@ -16,8 +16,8 @@ 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\Traits\Handler\HandleableTrait;
 use Org\Mxchange\CoreFramework\Traits\Stacker\StackableTrait;
 use Org\Mxchange\CoreFramework\Traits\Stream\Input\InputStreamTrait;
 use Org\Mxchange\CoreFramework\Utils\String\StringUtils;
@@ -52,6 +52,7 @@ use \BadMethodCallException;
  */
 class PackageAssembler extends BaseHubSystem implements Assembler, Registerable, Visitable {
        // Load traits
+       use HandleableTrait;
        use InputStreamTrait;
        use StackableTrait;
 
@@ -80,11 +81,6 @@ class PackageAssembler extends BaseHubSystem implements Assembler, Registerable,
         */
        private $packageHandlerInstance = NULL;
 
-       /**
-        * Handler instance
-        */
-       private $handlerInstance = NULL;
-
        /**
         * Protected constructor
         *
@@ -114,11 +110,8 @@ class PackageAssembler extends BaseHubSystem implements Assembler, Registerable,
                // And set it
                $assemblerInstance->setInputStreamInstance($streamInstance);
 
-               // Now get a chunk handler instance
-               $handlerInstance = ChunkHandlerFactory::createChunkHandlerInstance();
-
-               // Set handler instance
-               $assemblerInstance->setHandlerInstance($handlerInstance);
+               // Set chunk handler instance
+               $assemblerInstance->setHandlerInstance(ChunkHandlerFactory::createChunkHandlerInstance());
 
                // Get stacker instance
                $stackInstance = ObjectFactory::createObjectByConfiguredName('multiple_message_stacker_class');
@@ -163,25 +156,6 @@ class PackageAssembler extends BaseHubSystem implements Assembler, Registerable,
                return $this->packageHandlerInstance;
        }
 
-       /**
-        * 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 e315aa3bdf756985288071d1558bbe3ab460fb12..743339e2926f9c9fae1ad6178bcfe5247b1f7ea0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 // Own namespace
-namespace Org\Shipsimu\Hub\Task\Network\Reader;
+namespace Org\Shipsimu\Hub\Node\Task\Network\Reader;
 
 // Import application-specific stuff
 use Org\Shipsimu\Hub\Factory\Handler\Network\NetworkPackageHandlerFactory;
index 48631e8a843b3f574416e5f3b896eebb25ad7307..eef135a2733223f4b00af8ddde1f7637f54ffa9c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 // Own namespace
-namespace Org\Shipsimu\Hub\Task\Network\Writer;
+namespace Org\Shipsimu\Hub\Node\Task\Network\Writer;
 
 // Import application-specific stuff
 use Org\Shipsimu\Hub\Factory\Handler\Network\NetworkPackageHandlerFactory;
index 33c1d749a9c2df489abc39750615880ec062b75a..62a52167b73b1a991d607f97b040f359c266b46d 100644 (file)
@@ -10,6 +10,7 @@ use Org\Shipsimu\Hub\Task\BaseHubTask;
 use Org\Mxchange\CoreFramework\Handler\Handleable;
 use Org\Mxchange\CoreFramework\Task\BaseTask;
 use Org\Mxchange\CoreFramework\Task\Taskable;
+use Org\Mxchange\CoreFramework\Traits\Handler\HandleableTrait;
 use Org\Mxchange\CoreFramework\Visitor\Visitable;
 use Org\Mxchange\CoreFramework\Visitor\Visitor;
 
@@ -36,10 +37,8 @@ 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;
+       // Load traits
+       use HandleableTrait;
 
        /**
         * Protected constructor
@@ -51,25 +50,6 @@ 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
         *
index a6de31980a3c03e582fd3ef32b37edbbeeb02da1..da82e3287c74f1e787158222f8e31f32f85d3806 100644 (file)
@@ -565,10 +565,10 @@ $cfg->setConfigEntry('node_ping_task_class', 'Org\Shipsimu\Hub\Node\Ping\NodePin
 $cfg->setConfigEntry('node_announcement_task_class', 'Org\Shipsimu\Hub\Filter\Activation\Node\Announcement\NodeAnnouncementTask');
 
 // CFG: NODE-PACKAGE-WRITER-TASK-CLASS
-$cfg->setConfigEntry('node_package_writer_task_class', 'Org\Shipsimu\Hub\Task\Network\Writer\NetworkPackageWriterTask');
+$cfg->setConfigEntry('node_package_writer_task_class', 'Org\Shipsimu\Hub\Node\Task\Network\Writer\NetworkPackageWriterTask');
 
 // CFG: NODE-PACKAGE-READER-TASK-CLASS
-$cfg->setConfigEntry('node_package_reader_task_class', 'Org\Shipsimu\Hub\Task\Network\Reader\NetworkPackageReaderTask');
+$cfg->setConfigEntry('node_package_reader_task_class', 'Org\Shipsimu\Hub\Node\Task\Network\Reader\NetworkPackageReaderTask');
 
 // CFG: NODE-SOCKET-LISTENER-TASK-CLASS
 $cfg->setConfigEntry('node_socket_listener_task_class', 'Org\Shipsimu\Hub\Node\Task\Listener\Socket\NodeSocketListenerTask');
diff --git a/core b/core
index ef7a7e55c59c9e887e6bb09c8c02b8126309f716..bed2c6a3cf04dd79cbe36186852dd3628d5200a4 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit ef7a7e55c59c9e887e6bb09c8c02b8126309f716
+Subproject commit bed2c6a3cf04dd79cbe36186852dd3628d5200a4