// Own namespace
namespace Org\Shipsimu\Hub\Discovery\Recipient;
-// Import framework stuff
+// Import application-specific stuff
use Org\Shipsimu\Hub\Discovery\Node\BaseNodeDiscovery;
use Org\Shipsimu\Hub\Discovery\Recipient\DiscoverableRecipient;
use Org\Shipsimu\Hub\Factory\Lists\Recipient\RecipientListFactory;
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Lists\Listable;
+
/**
* A PackageRecipient discovery class
*
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
abstract class BaseRecipientDiscovery extends BaseNodeDiscovery implements DiscoverableRecipient {
+ /**
+ * Instance of the list
+ */
+ private $listInstance = NULL;
+
/**
* Protected constructor
*
$this->setListInstance($listInstance);
}
+ /**
+ * Setter for the list instance
+ *
+ * @param $listInstance A list of Listable
+ * @return void
+ */
+ protected final function setListInstance (Listable $listInstance) {
+ $this->listInstance = $listInstance;
+ }
+
+ /**
+ * Getter for the list instance
+ *
+ * @return $listInstance A list of Listable
+ */
+ protected final function getListInstance () {
+ return $this->listInstance;
+ }
+
/**
* "Getter" for recipient iterator
*
namespace Org\Shipsimu\Hub\Node\Ping;
// Import application-specific stuff
+use Org\Shipsimu\Hub\Factory\Node\NodeObjectFactory;
use Org\Shipsimu\Hub\Task\BaseHubTask;
// Import framework stuff
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * but WITHOUT ANY WARRANTY; without even the6 implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class NodePingTask extends BaseHubTask implements Taskable, Visitable {
+ /**
+ * Instance of the list
+ */
+ private $listInstance = NULL;
+
/**
* Protected constructor
*
/**
* Creates an instance of this class
*
- * @param $listInstance A Listable instance
* @return $taskInstance An instance of a Taskable/Visitable class
*/
- public static final function createNodePingTask (Listable $listInstance) {
+ public static final function createNodePingTask () {
// Get new instance
$taskInstance = new NodePingTask();
- // Se the list instance in this task
- $taskInstance->setListInstance($listInstance);
+ // Get node instance
+ $nodeInstance = NodeObjectFactory::createNodeInstance();
- // Init ping iterator instance
- $iteratorInstance = $listInstance->getListIterator();
+ // Get list instance from it
+ $listInstance = $nodeInstance->getListenerPoolInstance()->getPoolEntriesInstance();
- // Set it as well
- $taskInstance->setIteratorInstance($iteratorInstance);
+ // Set the list instance in this task
+ $taskInstance->setListInstance($listInstance);
// Return the prepared instance
return $taskInstance;
}
+ /**
+ * Setter for the list instance
+ *
+ * @param $listInstance A list of Listable
+ * @return void
+ */
+ protected final function setListInstance (Listable $listInstance) {
+ $this->listInstance = $listInstance;
+ }
+
+ /**
+ * Getter for the list instance
+ *
+ * @return $listInstance A list of Listable
+ */
+ protected final function getListInstance () {
+ return $this->listInstance;
+ }
+
/**
* Accepts the visitor to process the visitor
*