From: Roland Häder Date: Wed, 2 Dec 2020 18:50:23 +0000 (+0100) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=42e3d60b1112447d4dbfc6f6b2e67773ba0ab60f;p=hub.git Continued: - replaced $handlerInstance with HandleableTrait trait - udpated core framework Signed-off-by: Roland Häder --- diff --git a/application/hub/classes/handler/class_BaseHubHandler.php b/application/hub/classes/handler/class_BaseHubHandler.php index 2539a063e..cc3cbe8e1 100644 --- a/application/hub/classes/handler/class_BaseHubHandler.php +++ b/application/hub/classes/handler/class_BaseHubHandler.php @@ -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; - } - } diff --git a/application/hub/classes/listener/class_BaseListener.php b/application/hub/classes/listener/class_BaseListener.php index 395ed284d..c556b63fa 100644 --- a/application/hub/classes/listener/class_BaseListener.php +++ b/application/hub/classes/listener/class_BaseListener.php @@ -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 diff --git a/application/hub/classes/registry/objects/class_ObjectTypeRegistry.php b/application/hub/classes/registry/objects/class_ObjectTypeRegistry.php index ac76ae8b5..cf1169ca9 100644 --- a/application/hub/classes/registry/objects/class_ObjectTypeRegistry.php +++ b/application/hub/classes/registry/objects/class_ObjectTypeRegistry.php @@ -59,7 +59,5 @@ class ObjectTypeRegistry extends BaseRegistry implements Register { // Return the instance return self::$registryInstance; } -} -// [EOF] -?> +} diff --git a/core b/core index bed2c6a3c..2a3f63506 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit bed2c6a3cf04dd79cbe36186852dd3628d5200a4 +Subproject commit 2a3f6350600cf6ad214923c57aef772dc5c0cb76