'Add a listener for a given question.
The listener will have
its updateRecord method called when information is available to
answer the question.'

def addListener(self, listener, question):

    now = currentTimeMillis()
    self.listeners.append(listener)
    if (question is not None):
        for record in self.cache.entriesWithName(question.name):
            if (question.answeredBy(record) and (not record.isExpired(now))):
                listener.updateRecord(self, now, record)
    self.notifyAll()
