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

Signed-off-by: Roland Häder <roland@mxchange.org>
application/hub/classes/handler/class_BaseHubHandler.php
application/hub/classes/listener/class_BaseListener.php
application/hub/classes/registry/objects/class_ObjectTypeRegistry.php
core

index 2539a063e9942c9af4807eeb35b4166b9e63ee9b..cc3cbe8e1a92b31e26cc59adcc3367dc54cebd82 100644 (file)
@@ -15,7 +15,7 @@ use Org\Shipsimu\Hub\Traits\Node\NodeTrait;
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
 use Org\Mxchange\CoreFramework\Handler\BaseHandler;
 use Org\Mxchange\CoreFramework\Handler\Handleable;
-use Org\Mxchange\CoreFramework\Registry\Register;
+use Org\Mxchange\CoreFramework\Traits\Registry\RegisterTrait;
 use Org\Mxchange\CoreFramework\Traits\Stacker\StackableTrait;
 
 /**
@@ -44,6 +44,7 @@ abstract class BaseHubHandler extends BaseHandler implements Handleable, HubInte
        // Load traits
        use ListenableTrait;
        use NodeTrait;
+       use RegisterTrait;
        use StackableTrait;
 
        /**
@@ -61,11 +62,6 @@ abstract class BaseHubHandler extends BaseHandler implements Handleable, HubInte
         */
        private $assemblerInstance = NULL;
 
-       /**
-        * Registry instance (implementing Register)
-        */
-       private $registryInstance = NULL;
-
        /**
         * Protected constructor
         *
@@ -136,23 +132,4 @@ abstract class BaseHubHandler extends BaseHandler implements Handleable, HubInte
                return $this->assemblerInstance;
        }
 
-       /**
-        * Setter for registry instance
-        *
-        * @param       $registryInstance               An instance of a Register class
-        * @return      void
-        */
-       protected final function setRegistryInstance (Register $registryInstance) {
-               $this->registryInstance = $registryInstance;
-       }
-
-       /**
-        * Getter for registry instance
-        *
-        * @return      $registryInstance       The debug registry instance
-        */
-       protected final function getRegistryInstance () {
-               return $this->registryInstance;
-       }
-
 }
index 395ed284d94f812b94c0d5953d82bc262e1d1bf1..c556b63fa4087b4314ec7ecee9121b1cbe942445 100644 (file)
@@ -21,11 +21,11 @@ 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\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\Traits\Registry\RegisterTrait;
 use Org\Mxchange\CoreFramework\Visitor\Visitable;
 use Org\Mxchange\CoreFramework\Visitor\Visitor;
 
@@ -59,6 +59,7 @@ abstract class BaseListener extends BaseHubSystem implements Visitable {
        // Load traits
        use IteratorTrait;
        use HandleableTrait;
+       use RegisterTrait;
        use StorableSocketTrait;
 
        // Exception code constants
@@ -91,11 +92,6 @@ abstract class BaseListener extends BaseHubSystem implements Visitable {
         */
        private $protocolName = 'invalid';
 
-       /**
-        * Registry instance (implementing Register)
-        */
-       private $registryInstance = NULL;
-
        /**
         * Protected constructor
         *
@@ -106,11 +102,8 @@ abstract class BaseListener extends BaseHubSystem implements Visitable {
                // Call parent constructor
                parent::__construct($className);
 
-               // Get a socket registry instance (singleton)
-               $registryInstance = SocketRegistryFactory::createSocketRegistryInstance();
-
-               // And set it here for later on making lesser calls
-               $this->setRegistryInstance($registryInstance);
+               // Set socket registry here for later on making lesser calls
+               $this->setRegistryInstance(SocketRegistryFactory::createSocketRegistryInstance());
        }
 
        /**
@@ -224,25 +217,6 @@ abstract class BaseListener extends BaseHubSystem implements Visitable {
                $this->protocolName = $protocolName;
        }
 
-       /**
-        * Setter for registry instance
-        *
-        * @param       $registryInstance               An instance of a Register class
-        * @return      void
-        */
-       protected final function setRegistryInstance (Register $registryInstance) {
-               $this->registryInstance = $registryInstance;
-       }
-
-       /**
-        * Getter for registry instance
-        *
-        * @return      $registryInstance       The debug registry instance
-        */
-       protected final function getRegistryInstance () {
-               return $this->registryInstance;
-       }
-
        /**
         * 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 ac76ae8b5d37443349f769c81cfbcde2f396efc8..cf1169ca91ba5000752cfbb48871343b4a521e56 100644 (file)
@@ -59,7 +59,5 @@ class ObjectTypeRegistry extends BaseRegistry implements Register {
                // Return the instance
                return self::$registryInstance;
        }
-}
 
-// [EOF]
-?>
+}
diff --git a/core b/core
index bed2c6a3cf04dd79cbe36186852dd3628d5200a4..2a3f6350600cf6ad214923c57aef772dc5c0cb76 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit bed2c6a3cf04dd79cbe36186852dd3628d5200a4
+Subproject commit 2a3f6350600cf6ad214923c57aef772dc5c0cb76