Composite OsidList Pattern

Chain many lists end to end — drained serially into one.

Overview

A composite OsidList chains N source lists in serial: it drains the first source completely before advancing to the second, and so on. To the consumer it looks like a single continuous list. Sources may be added concurrently while the consumer is already reading; signalling completion tells the list that no further sources will arrive.

By default the list runs in hard-error mode — an error from any source aborts iteration. Constructed in soft mode, an error instead closes the failing source and advances to the next, letting the remaining sources drain.

Javadoc Reference

net.okapia.osid.streams.spi

Class Declaration Pattern

public final class CompositeOsidObjectList
extends AbstractCompositeOsidList<OsidObject>
implements OsidObjectList

Constructor Pattern

CompositeOsidObjectList()

Creates a composite list in hard-error mode, where an error from a source aborts iteration.

CompositeOsidObjectList(boolean soft)
ParameterTypeDescription
soft boolean if true, an error from a source closes that source and advances to the next instead of aborting

Adding Sources

public void addOsidObjectList(OsidObjectList list)
ParameterTypeDescription
list OsidObjectList a source list to be drained after all previously added lists are exhausted