public class TLcyCompositeInputStreamFactory extends TLcyGenericComposite<ILcdInputStreamFactory> implements ILcdInputStreamFactory
Composite implementation (see composite design pattern) of ILcdInputStreamFactory
.
You can use the TLcyCompositeInputStreamFactory
in two ways:
ILcyLucyEnv
:
ILcdInputStreamFactory
services registered in the Lucy back-end until one succeeds.
TLcyCompositeInputStreamFactory
s will add and remove the
factory as a service in the Lucy back-end.
ILcyLucyEnv
:
ILcdInputStreamFactory
registered in this instance until one succeeds.
TLcyCompositeInputStreamFactory
s will only be performed
on this instance.
You can also loop over the underlying ILcdInputStreamFactory
s yourself using the
standard iterator.
ILcdInputStreamFactory
PRIORITY_DEFAULT, PRIORITY_FALLBACK
Constructor and Description |
---|
TLcyCompositeInputStreamFactory()
Create a new empty composite factory that will act on factories registered in this instance only.
|
TLcyCompositeInputStreamFactory(ILcyLucyEnv aLucyEnv)
Create a composite factory that will act on the factories registered in the Lucy back-end.
|
Modifier and Type | Method and Description |
---|---|
InputStream |
createInputStream(String aSource)
Delegates to the first input stream factory whose
createInputStream() method
does not throw an exception. |
add, add, getList, getPriority, iterator, remove
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canCreateInputStream
forEach, spliterator
public TLcyCompositeInputStreamFactory()
public TLcyCompositeInputStreamFactory(ILcyLucyEnv aLucyEnv)
aLucyEnv
- The Lucy back-endpublic InputStream createInputStream(String aSource) throws IOException
createInputStream()
method
does not throw an exception.createInputStream
in interface ILcdInputStreamFactory
aSource
- an accessible data source.IOException
.IOException
- If none of the available ILcdInputStreamFactory
instances could create an input stream.ILcdInputStreamFactory.canCreateInputStream(String)