+ $this->getPoolEntriesInstance()->addEntry('pool', $poolEntry);
+ }
+
+ /**
+ * Accepts the visitor to process the visit "request"
+ *
+ * @param $visitorInstance An instance of a Visitor class
+ * @return void
+ */
+ public function accept (Visitor $visitorInstance) {
+ // Debug message
+ //* NOISY-DEBUG: */ $this->debugOutput('POOL: ' . $visitorInstance->__toString() . ' has visited - START');
+
+ // Visit this pool
+ $visitorInstance->visitPool($this);
+
+ // Do we have a registry instance for this visitor's iterator?
+ if (Registry::getRegistry()->instanceExists($visitorInstance->getVisitorMode() . '_pool_iterator')) {
+ // Get the instance from registry
+ $iteratorInstance = Registry::getRegistry()->getInstance($visitorInstance->getVisitorMode() . '_pool_iterator');
+ } else {
+ // Get a new iterator instance
+ $iteratorInstance = ObjectFactory::createObjectByConfiguredName($visitorInstance->getVisitorMode() . '_pool_iterator_class', array($this->getPoolEntriesInstance()));
+
+ // Add it to the registry
+ Registry::getRegistry()->addInstance($visitorInstance->getVisitorMode() . '_pool_iterator', $iteratorInstance);
+ }
+
+ // Reset the counter
+ $iteratorInstance->rewind();
+
+ // Visit all registered entries
+ while ($iteratorInstance->valid()) {
+ // Get current entry
+ $poolEntry = $iteratorInstance->current();
+
+ // Is this entry visitable?
+ if ($poolEntry instanceof Visitable) {
+ // Visit this entry as well
+ //* NOISY-DEBUG: */ $this->debugOutput('BASE-POOL: Going to visit pooled object ' . $poolEntry->__toString() . ' with visitor ' . $visitorInstance->__toString() . ' ...');
+ $poolEntry->accept($visitorInstance);
+ } else {
+ // Cannot visit this entry
+ $this->partialStub('Pool entry with key ' . $iteratorInstance->key() . ' has improper type ' . gettype($poolEntry) . ', reason: not implementing Visitable.');
+ }
+
+ // Advance to next entry
+ $iteratorInstance->next();
+ } // END - while
+
+ // Debug message
+ //* NOISY-DEBUG: */ $this->debugOutput('POOL: ' . $visitorInstance->__toString() . ' has visited - FINISHED');
+ }
+
+ /**
+ * Gets the array from specified list
+ *
+ * @param $list The list identifier we should return
+ * @return $array The requested array
+ */
+ protected final function getArrayFromList ($list) {
+ // Get the array
+ $array = $this->getPoolEntriesInstance()->getArrayFromList($list);
+
+ // Return it
+ return $array;
+ }
+
+ /**
+ * Checks whether the given connection type is valid
+ *
+ * @param $connectionType Type of connection, can be 'incoming', 'outgoing' or 'server'
+ * @return $isValid Whether the provided connection type is valid
+ */
+ protected function isValidConnectionType ($connectionType) {
+ // Is it valid?
+ $isValid = in_array($connectionType, $this->connectionTypes, true);
+
+ // Return result
+ return $isValid;