code: public function setListener($listener)
      {
          $listener->getSharedManager()->attach('*', NotificationEvent::EVENT_NOTIFICATION_HTML, array($this,'createOutput'), 1);
          $this->notificationListener = $listener;
      }
docs: attach a Listener, that is liable for storing the notifications
  @param $listener