Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] AsyncContentProvider under-documented

I need to implement an AsyncContentProvider, but the contract for this interface appears to be significantly under-documented.

When available content has been exhausted, DeferredContentProviderIterator.next() returns null, so this is presumably part of the contract.

DeferredContentProviderIterator implements Callback, but the contract for this is nowhere mentioned. Is this part of the ContentProvider contract like Closeable is, or is this specific to AsyncContentProvider? Is Callback a required or optional interface on AsyncContentProvider iterators? It appears to expect to have succeeded() or failed() called for every ByteBuffer returned from next(), including nulls, is this correct? Is there an additional succeeded()/failed() call after the iterator indicates no more elements?

DeferredContentProvider appears to notify the Listener once for each (non-null) ByteBuffer plus once when closed. (Except not after failed() is called.) Is this necessary, or would it be sufficient to notify once after each time next() returns null, possibly also needing once when the first ByteBuffer is available?




Back to the top