public class CollectingDocumentListener
extends java.lang.Object
implements org.ojai.DocumentListener
failed(Exception), and then
call super.failed() in order to release the semaphore.
Because this materializes the whole result set, don't use it for anything other than
very small result sets.| Constructor and Description |
|---|
CollectingDocumentListener(java.util.List<org.ojai.Document> docList,
java.util.concurrent.Semaphore doneSem)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
documentArrived(org.ojai.Document doc) |
void |
eos() |
void |
failed(java.lang.Exception ex) |
java.lang.Exception |
getException() |
public CollectingDocumentListener(java.util.List<org.ojai.Document> docList,
java.util.concurrent.Semaphore doneSem)
docList - the list to add documents todoneSem - the semaphore to release when the result set is complete or when an error occurspublic java.lang.Exception getException()
public boolean documentArrived(org.ojai.Document doc)
documentArrived in interface org.ojai.DocumentListenerpublic void eos()
eos in interface org.ojai.DocumentListenerpublic void failed(java.lang.Exception ex)
failed in interface org.ojai.DocumentListener