Package com.luciad.lucy.io
Class TLcyCompositeOutputStreamFactory
java.lang.Object
com.luciad.lucy.util.TLcyGenericComposite<ILcdOutputStreamFactory>
com.luciad.lucy.io.TLcyCompositeOutputStreamFactory
- All Implemented Interfaces:
ILcdOutputStreamFactory,Iterable<ILcdOutputStreamFactory>
public class TLcyCompositeOutputStreamFactory
extends TLcyGenericComposite<ILcdOutputStreamFactory>
implements ILcdOutputStreamFactory
Composite implementation (see composite design pattern) of ILcdOutputStreamFactory.
You can use the TLcyCompositeOutputStreamFactory in two ways:
- With
ILcyLucyEnv:- When asked to create an outputstream, it loops over the
ILcdOutputStreamFactoryservices registered in the Lucy back-end until one succeeds. - Adding and removing
TLcyCompositeOutputStreamFactorys will add and remove the factory as a service in the Lucy back-end.
- When asked to create an outputstream, it loops over the
- Without
ILcyLucyEnv:- When asked to create an outputstream, it loops over the
ILcdOutputStreamFactoryregistered in this instance until one succeeds. - Adding and removing
TLcyCompositeOutputStreamFactorys will only be performed on this instance.
- When asked to create an outputstream, it loops over the
You can also loop over the underlying ILcdOutputStreamFactorys yourself using the
standard iterator.
- Since:
- 10.1
- See Also:
-
Field Summary
Fields inherited from class com.luciad.lucy.util.TLcyGenericComposite
PRIORITY_DEFAULT, PRIORITY_FALLBACK -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new empty composite factory that will act on factories registered in this instance only.TLcyCompositeOutputStreamFactory(ILcyLucyEnv aLucyEnv) Create a composite factory that will act on the factories registered in the Lucy back-end. -
Method Summary
Modifier and TypeMethodDescriptioncreateOutputStream(String aSource) Loops over the factories in the local instance or Lucy back-end, depending on the usage.Methods inherited from class com.luciad.lucy.util.TLcyGenericComposite
add, add, getList, getPriority, iterator, removeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
TLcyCompositeOutputStreamFactory
public TLcyCompositeOutputStreamFactory()Create a new empty composite factory that will act on factories registered in this instance only. -
TLcyCompositeOutputStreamFactory
Create a composite factory that will act on the factories registered in the Lucy back-end.- Parameters:
aLucyEnv- The Lucy back-end
-
-
Method Details
-
createOutputStream
Loops over the factories in the local instance or Lucy back-end, depending on the usage.- Specified by:
createOutputStreamin interfaceILcdOutputStreamFactory- Parameters:
aSource- an accessible destination.- Returns:
- The OutputStream created by the first factory that does not throw
IOException. Returnsnullif no factories or default factory are registered. - Throws:
IOException- If none of the availableILcdOutputStreamFactoryinstances could create an output stream.
-