]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/package/class_NetworkPackage.php
Typo fixed, visitor introduced, SVN property set:
[hub.git] / application / hub / main / package / class_NetworkPackage.php
index bdadfa7f8a4f296f04a2dbb4d4d64c58207fd1e0..d54d99b04dc6b7aecb2da612a07a3b6c6dc66b58 100644 (file)
@@ -131,13 +131,6 @@ class NetworkPackage extends BaseFrameworkSystem implements Deliverable, Receiva
        protected function __construct () {
                // Call parent constructor
                parent::__construct(__CLASS__);
-
-               // We need to initialize a stack here for our packages even those
-               // which have no recipient address and stamp... ;-)
-               $stackerInstance = ObjectFactory::createObjectByConfiguredName('network_package_stacker_class');
-
-               // At last, set it in this class
-               $this->setStackerInstance($stackerInstance);
        }
 
        /**
@@ -153,6 +146,19 @@ class NetworkPackage extends BaseFrameworkSystem implements Deliverable, Receiva
                // Now set the compressor instance
                $packageInstance->setCompressorInstance($compressorInstance);
 
+               // We need to initialize a stack here for our packages even those
+               // which have no recipient address and stamp... ;-)
+               $stackerInstance = ObjectFactory::createObjectByConfiguredName('network_package_stacker_class');
+
+               // At last, set it in this class
+               $packageInstance->setStackerInstance($stackerInstance);
+
+               // Get a visitor instance for speeding up things
+               $visitorInstance = ObjectFactory::createObjectByConfiguredName('node_raw_data_monitor_visitor_class', array($packageInstance));
+
+               // Set it in this package
+               $packageInstance->setVisitorInstance($visitorInstance);
+
                // Return the prepared instance
                return $packageInstance;
        }
@@ -465,8 +471,15 @@ class NetworkPackage extends BaseFrameworkSystem implements Deliverable, Receiva
         * @return      $hasArrived             Wether new raw package data has arrived for processing
         */
        public function isNewRawDataPending (PoolableListener $poolInstance) {
-               // @TODO Add some content here
-               $this->partialStub('Do something here. poolInstance=' . $poolInstance->__toString());
+               // By default no new data has arrived
+               $hasArrived = false;
+
+               // Visit the pool
+               $poolInstance->accept($this->getVisitorInstance());
+               // @TODO Check for if new data has arrived
+
+               // Return the status
+               return $hasArrived;
        }
 
        /**