]> git.mxchange.org Git - hub.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sun, 26 Feb 2023 09:19:27 +0000 (10:19 +0100)
committerRoland Häder <roland@mxchange.org>
Tue, 28 Feb 2023 10:05:35 +0000 (11:05 +0100)
- invoke CryptoHelper::getSelfInstance() rather than creating new instances
  over ObjectFactory
- this also removed the overhead of initialization
- updated 'core' framework

application/hub/classes/handler/chunks/class_ChunkHandler.php
application/hub/classes/handler/package/class_NetworkPackageHandler.php
application/hub/classes/nodes/class_BaseHubNode.php
application/hub/classes/package/fragmenter/class_PackageFragmenter.php
application/hub/classes/source/units/class_TestUnitSource.php
core

index bd50a1e8e3a5de68613daea3186e8b69ad3108ed..e14a6b18e9461ea628374a5cb0777320fd0cfaa5 100644 (file)
@@ -12,6 +12,7 @@ use Org\Shipsimu\Hub\Traits\Fragmenter\FragmentableTrait;
 use Org\Mxchange\CoreFramework\Assertion\AssertionException;
 use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
+use Org\Mxchange\CoreFramework\Helper\Crypto\CryptoHelper;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
 use Org\Mxchange\CoreFramework\Utils\Strings\StringUtils;
 use Org\Mxchange\CoreFramework\Traits\Crypto\CryptoTrait;
@@ -136,7 +137,7 @@ class ChunkHandler extends BaseHubHandler implements HandleableChunks, Registera
                $handlerInstance->setStackInstance($stackInstance);
 
                // Get a crypto instance ...
-               $cryptoInstance = ObjectFactory::createObjectByConfiguredName('crypto_class');
+               $cryptoInstance = CryptoHelper::getSelfInstance();
 
                // ... and set it in this handler
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CHUNK-HANDLER: Setting cryptoInstance=%s ...', $cryptoInstance->__toString()));
index fa18fa497c4ff559be0e1a86da4845ec7611b624..1d3998479a73a56833994478301dd6c1a4f7c4d9 100644 (file)
@@ -40,6 +40,7 @@ use Org\Mxchange\CoreFramework\Factory\Registry\Socket\SocketRegistryFactory;
 use Org\Mxchange\CoreFramework\Feature\FrameworkFeature;
 use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
+use Org\Mxchange\CoreFramework\Helper\Crypto\CryptoHelper;
 use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
@@ -381,7 +382,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                $handlerInstance->setVisitorInstance($visitorInstance);
 
                // Get crypto instance and set it, too
-               $cryptoInstance = ObjectFactory::createObjectByConfiguredName('crypto_class');
+               $cryptoInstance = CryptoHelper::getSelfInstance();
                $handlerInstance->setCryptoInstance($cryptoInstance);
 
                // Get a singleton package assembler instance from factory and set it here, too
index 2f12486c35d717e752cbc2f0fb50d32638e1cf56..bf84d0061979583173381754a5c638528966631f 100644 (file)
@@ -29,6 +29,7 @@ use Org\Mxchange\CoreFramework\Factory\Database\Frontend\DatabaseFrontendFactory
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
 use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
+use Org\Mxchange\CoreFramework\Helper\Crypto\CryptoHelper;
 use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
@@ -151,7 +152,7 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
                $this->setFrontendInstance($frontendInstance);
 
                // Get a crypto instance
-               $cryptoInstance = ObjectFactory::createObjectByConfiguredName('crypto_class');
+               $cryptoInstance = CryptoHelper::getSelfInstance();
 
                // Set it here
                $this->setCryptoInstance($cryptoInstance);
index 7c0a63e0add150a47aede3c8a17ba409973a9ae0..dc59b6d5ae19517f4c0b9b6787886debad596c85 100644 (file)
@@ -13,6 +13,7 @@ use Org\Mxchange\CoreFramework\Assertion\AssertionException;
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
+use Org\Mxchange\CoreFramework\Helper\Crypto\CryptoHelper;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
 use Org\Mxchange\CoreFramework\Traits\Crypto\CryptoTrait;
 use Org\Mxchange\CoreFramework\Utils\Strings\StringUtils;
@@ -155,7 +156,7 @@ class PackageFragmenter extends BaseHubSystem implements Fragmentable, Registera
                $fragmenterInstance = new PackageFragmenter();
 
                // Get a crypto instance
-               $cryptoInstance = ObjectFactory::createObjectByConfiguredName('crypto_class');
+               $cryptoInstance = CryptoHelper::getSelfInstance();
 
                // Set it here
                $fragmenterInstance->setCryptoInstance($cryptoInstance);
index 7052977df2bdda763fe3c9452735fbf117310d6f..e1f2f20adfd318d72bac82d8462bfff80c910f57 100644 (file)
@@ -9,6 +9,7 @@ use Org\Shipsimu\Hub\Crawler\Source\BaseSource;
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Crypto\RandomNumber\RandomNumberGenerator;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
+use Org\Mxchange\CoreFramework\Helper\Crypto\CryptoHelper;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
 
 /**
@@ -63,7 +64,7 @@ class TestUnitSource extends BaseSource implements UnitSource, Registerable {
                $sourceInstance->setRngInstance($rngInstance);
 
                // And also a crypto instance (for our encrypted messages)
-               $cryptoInstance = ObjectFactory::createObjectByConfiguredName('crypto_class');
+               $cryptoInstance = CryptoHelper::getSelfInstance();
                $sourceInstance->setCryptoInstance($cryptoInstance);
 
                // Return the prepared instance
diff --git a/core b/core
index 53f5e597b72bedb2995dca43e04d88f37eaa5e88..12e4c5a35325464e30bcfd223f121a105ebca91e 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit 53f5e597b72bedb2995dca43e04d88f37eaa5e88
+Subproject commit 12e4c5a35325464e30bcfd223f121a105ebca91e