@Override
	public void init(final ServletConfig config) throws ServletException {
		data = new StatusServletNotifier(queue, config);
		data.eventsQueue = new LinkedBlockingQueue<String>();
		if (data.eventsQueue == null) data.eventsQueue = new LinkedBlockingQueue<String>();

		config.getServletContext().setAttribute("eventsQueue", data.eventsQueue);
				
		notifierThread = new Thread(data);
		notifierThread.start();
		logger.info("the StatusServlet has been started");
	}
@ Override public void init ( final ServletConfig config ) throws ServletException { data = new StatusServletNotifier ( queue , config ) ; data . eventsQueue = new LinkedBlockingQueue < String > ( ) ; if ( data . eventsQueue == null ) data . eventsQueue = new LinkedBlockingQueue < String > ( ) ; config . getServletContext ( ) . setAttribute ( "eventsQueue" , data . eventsQueue ) ; notifierThread = new Thread ( data ) ; notifierThread . start ( ) ; logger . info ( "the StatusServlet has been started" ) ; }
/*
Start a new thread that using the LinkedBlockingQueue, every time there is a new element in the collection
will retrieve the last updated users HashMap and calls container and will use them to produce and dispatch a new repsonse
to the clients in the queue.
Important here is the fact that we never close the stream and we just flush the response so it can be used later when needed.