Package net.sf.qxs.io

Examples of net.sf.qxs.io.OutputStreamSplitter


   
    private void createOutputStreams()
    {
      for (Map.Entry<String, ? extends OutputStream> e : data.getOutputPipes().entrySet())
      {
        OutputStreamSplitter os = new OutputStreamSplitter(true);
        os.add(e.getValue());
       
        ByteArrayOutputStream splitter_out = new ByteArrayOutputStream();
        catchers.put(e.getKey(), splitter_out);
        os.add(splitter_out);
       
        mod_out.put(e.getKey(), os);
      }
    }
View Full Code Here


      Plug plug = e.getValue().iterator().next();
      ModuleWrapper source = mod2wrap.get(plug.getModule());
      if (source == null)
        throw new IllegalArgumentException(String.format("Trying to export %s/%s as %s, but there is no module by the name of '%s'", plug.getModule().toString(), plug.getPort(), e.getKey(), plug.getModule().toString()));

      OutputStreamSplitter splitter = source.oss.get(plug.getPort());
      if (splitter == null)
        throw new IllegalArgumentException(String.format("Trying to export %s/%s as %s, but %s has no output stream by the name of '%s'", plug.getModule().toString(), plug.getPort(), e.getKey(), plug.getModule().toString(), plug.getPort()));

      splitter.add(pipeline_out);
    }

    // create data importer threads
    if (data_access != null)
      for (Map.Entry<String,Collection<Plug>> e : pipeline.getInputPipes().entrySet())
    {
      Collection<? extends InputStream> pipeline_in = data_access.getInputPipes().get(e.getKey());
      if (pipeline_in == null)
        continue;
     
      for (InputStream is : pipeline_in)
      {
        OutputStreamSplitter os = new OutputStreamSplitter(true);
        splitters.add(new StreamConnector("data importer", is, os));
       
        for (Plug target : e.getValue())
        {
          ModuleWrapper target_wrapper = mod2wrap.get(target.getModule());
          target_wrapper.connect(target.getPort(), os);
        }
      }
    }
   
    // create module input streams
    for (Map.Entry<Plug,Collection<Plug>> e : pipeline.getConnectors().entrySet())
    {
      Plug source = e.getKey();
      ModuleWrapper source_wrapper = mod2wrap.get(source.getModule());
      OutputStreamSplitter source_stream = source_wrapper.oss.get(source.getPort());
     
      for (Plug target : e.getValue())
      {
        ModuleWrapper target_wrapper = mod2wrap.get(target.getModule());
        target_wrapper.connect(target.getPort(), source_stream);
View Full Code Here

      oss = new HashMap<String,OutputStreamSplitter>();
      ModuleDefinition pipemod = mod.getPipelineModule();

      for (String pipe : pipemod.getOutputPipeTypes().keySet())
        oss.put(pipe, new OutputStreamSplitter(true));
    }
View Full Code Here

TOP

Related Classes of net.sf.qxs.io.OutputStreamSplitter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.