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:

  1. With ILcyLucyEnv:
    • When asked to create an outputstream, it loops over the ILcdOutputStreamFactory services 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.
  2. Without ILcyLucyEnv:
    • When asked to create an outputstream, it loops over the ILcdOutputStreamFactory registered in this instance until one succeeds.
    • Adding and removing TLcyCompositeOutputStreamFactorys will only be performed on this instance.

You can also loop over the underlying ILcdOutputStreamFactorys yourself using the standard iterator.

Since:
10.1
See Also:
  • Constructor Details

    • TLcyCompositeOutputStreamFactory

      public TLcyCompositeOutputStreamFactory()
      Create a new empty composite factory that will act on factories registered in this instance only.
    • TLcyCompositeOutputStreamFactory

      public TLcyCompositeOutputStreamFactory(ILcyLucyEnv aLucyEnv)
      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

      public OutputStream createOutputStream(String aSource) throws IOException
      Loops over the factories in the local instance or Lucy back-end, depending on the usage.
      Specified by:
      createOutputStream in interface ILcdOutputStreamFactory
      Parameters:
      aSource - an accessible destination.
      Returns:
      The OutputStream created by the first factory that does not throw IOException. Returns null if no factories or default factory are registered.
      Throws:
      IOException - If none of the available ILcdOutputStreamFactory instances could create an output stream.