public function incoming(Application $app) {

        $route = $app->getService('router')
            ->findHttpRoute($this);

        /** Route is a callback execution */
        if (!empty($route->offsetGet('action'))) {
            //Route is a callback execution
            $app::getContainer()->offsetSet(
                'callback',
                $route
            );
	    
	    return;
        }

        /** Route is a service execution */
        //Set active unit
        $app->setActiveUnit(
            Application::APPLICATION_UNIT_NAMESPACE . $route->get('unit')
        );

        //Set active service
        if (!class_exists(
            $app->getActiveUnit() .
            Application::APPLICATION_SERVICES_TRAIL .
            $route->get('service'))
        ) {
            throw new \Nuki\Exceptions\Base('No available service has been found for the provided unit');
        }
        $app->setActiveService($route->get('service'));

        //Set active process
        $process = $this->buildProcess(
            $route->get('process'),
            $app->getActiveUnit() . Application::APPLICATION_SERVICES_TRAIL . $app->getActiveService()
        );
        $app->setActiveProcess($process);

        //Add params from service call to params-handler
        /** @var Params $paramsHandler */
        $paramsHandler = $app->getService('params-handler');

        $paramsHandler->add('route-params', $route->get('params'));
    }
public function incoming(Application $app) {

        $route = $app->getService('router')
            ->findHttpRoute($this);

        /** Route is a callback execution */
        if (!empty($route->offsetGet('action'))) {
            //Route is a callback execution
            $app::getContainer()->offsetSet(
                'callback',
                $route
            );
	    
	    return;
        }

        /** Route is a service execution */
        //Set active unit
        $app->setActiveUnit(
            Application::APPLICATION_UNIT_NAMESPACE . $route->get('unit')
        );

        //Set active service
        if (!class_exists(
            $app->getActiveUnit() .
            Application::APPLICATION_SERVICES_TRAIL .
            $route->get('service'))
        ) {
            throw new \Nuki\Exceptions\Base('No available service has been found for the provided unit');
        }
        $app->setActiveService($route->get('service'));

        //Set active process
        $process = $this->buildProcess(
            $route->get('process'),
            $app->getActiveUnit() . Application::APPLICATION_SERVICES_TRAIL . $app->getActiveService()
        );
        $app->setActiveProcess($process);

        //Add params from service call to params-handler
        /** @var Params $paramsHandler */
        $paramsHandler = $app->getService('params-handler');

        $paramsHandler->add('route-params', $route->get('params'));
    }
public function incoming ( Application $ app ) { $ route = $ app -> getService ( 'router' ) -> findHttpRoute ( $ this ) ; /** Route is a callback execution */ if ( ! empty ( $ route -> offsetGet ( 'action' ) ) ) { //Route is a callback execution $ app :: getContainer ( ) -> offsetSet ( 'callback' , $ route ) ; return ; } /** Route is a service execution */ //Set active unit $ app -> setActiveUnit ( Application :: APPLICATION_UNIT_NAMESPACE . $ route -> get ( 'unit' ) ) ; //Set active service if ( ! class_exists ( $ app -> getActiveUnit ( ) . Application :: APPLICATION_SERVICES_TRAIL . $ route -> get ( 'service' ) ) ) { throw new \ Nuki \ Exceptions \ Base ( 'No available service has been found for the provided unit' ) ; } $ app -> setActiveService ( $ route -> get ( 'service' ) ) ; //Set active process $ process = $ this -> buildProcess ( $ route -> get ( 'process' ) , $ app -> getActiveUnit ( ) . Application :: APPLICATION_SERVICES_TRAIL . $ app -> getActiveService ( ) ) ; $ app -> setActiveProcess ( $ process ) ; //Add params from service call to params-handler /** @var Params $paramsHandler */ $ paramsHandler = $ app -> getService ( 'params-handler' ) ; $ paramsHandler -> add ( 'route-params' , $ route -> get ( 'params' ) ) ; }
Initialize incoming request
Determine if route contains callback or
service execution

- set callback

- set active unit
- set active service
- set active process
- register service

@param Application $app

@return void

@throws Base
Initialize incoming request Determine if route contains callback or service execution