All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sdmlib.models.taskflows.SDMTaskWrap Maven / Gradle / Ivy

Go to download

SDMLib is a light weight modeling library. SDMLib intentionally comes without any tool or editor.

There is a newer version: 2.3.2341
Show newest version
package org.sdmlib.models.taskflows;

import java.io.IOException;

import de.uniks.networkparser.json.JsonArray;

class SDMTaskWrap implements Runnable
{
   /**
    * 
    */
   private final SocketReader socketReader;
   private String line;

   public SDMTaskWrap(SocketReader socketReader, String line)
   {
      this.socketReader = socketReader;
      this.line = line;
   }

   @Override
   public void run()
   {
      try
      {
         Object obj = this.socketReader.socketThread.idMap
            .decode(new JsonArray().withValue(line));

         if (obj instanceof FetchFileFlow)
         {
            FetchFileFlow fetchFileFlow = (FetchFileFlow) obj;
            try
            {
               fetchFileFlow.setOut(this.socketReader.connection
                  .getOutputStream());
            }
            catch (IOException e)
            {
               // TODO Auto-generated catch block
               e.printStackTrace();
            }
         }

         ((Runnable) obj).run();
      }
      catch (Exception e)
      {
         // TODO Auto-generated catch block
         e.printStackTrace();
      }
   }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy