public function onKernelResponse(FilterResponseEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        $response = $event->getResponse();
        $request = $event->getRequest();

        // extract various info from route
        $routeName = $request->get('_route');
        $routeParts = explode('.', $routeName);
        $routeType = end($routeParts);

        $this->linkHeader = LinkHeader::fromResponse($response);

        // add common headers
        $this->addCommonHeaders($request, $response);

        // add self Link header
        $selfUrl = $this->addSelfLinkHeader($routeName, $routeType, $request);
        // dispatch this!

        // add paging Link element when applicable
        if ($routeType == 'all' && $request->attributes->get('paging')) {
            $this->generatePagingLinksHeaders($routeName, $request, $response);
        }

        // add schema link header element
        $this->generateSchemaLinkHeader($routeName, $request, $response);

        // finally set link header
        $response->headers->set(
            'Link',
            (string) $this->linkHeader
        );

        $event->setResponse($response);

        // dispatch the "selfaware" event
        $event->getRequest()->attributes->set('selfLink', $selfUrl);
        $dispatcher->dispatch('graviton.rest.response.selfaware', $event);
    }