// Get handler from registry
$nodeInstance = NodeObjectFactory::createNodeInstance();
} elseif (($requestInstance instanceof Requestable) && ($responseInstance instanceof Responseable)) {
+ // The default node-mode is from our configuration
+ $nodeMode = $this->getConfigInstance()->getConfigEntry('node_default_mode');
+
+ // Is the node 'mode' parameter set?
+ if ($requestInstance->isRequestElementSet('mode')) {
+ // Then use this which overrides the config entry temporarily
+ $nodeMode = $requestInstance->getRequestElement('mode');
+ } else {
+ // Set it for easier re-usage
+ $requestInstance->setRequestElement('mode', $nodeMode);
+ }
+
+ // Now convert the node-mode in a class name
+ $className = 'Hub' . $this->convertToClassName($nodeMode) . 'Node';
+
// Get the node instance
$nodeInstance = ObjectFactory::createObjectByName($className, array($requestInstance));
* @return void
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
- // The default node-mode is from our configuration
- $nodeMode = $this->getConfigInstance()->getConfigEntry('node_default_mode');
- //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE-INIT-FILTER[' . __METHOD__ . ':' . __LINE__ . ']: Got default node mode ' . $nodeMode . ' from configuration.');
-
- // Is the node 'mode' parameter set?
- if ($requestInstance->isRequestElementSet('mode')) {
- // Then use this which overrides the config entry temporarily
- $nodeMode = $requestInstance->getRequestElement('mode');
- } else {
- // Set it for easier re-usage
- $requestInstance->setRequestElement('mode', $nodeMode);
- }
-
- // Now convert the node-mode in a class name
- $className = 'Hub' . $this->convertToClassName($nodeMode) . 'Node';
-
- // And try to instance it
+ // Try to instance it by using a factory
try {
// Get an instance
$nodeInstance = NodeObjectFactory::createNodeInstance($requestInstance, $responseInstance);