Commit 2836f0f7 authored by Michael Menzel's avatar Michael Menzel

more refacotring

parent 5fdb22e6
This diff is collapsed.
Manifest-Version: 1.0
Main-Class: de.thm.bootstrap.Webinterface
Main-Class: de.thm.spring.run.Webinterface
package de.thm.exception;
import de.thm.serverStatistics.StatisticsCollector;
import de.thm.spring.StatisticsCollector;
import de.thm.spring.serverStatistics.StatisticsCollector;
/**
* Created by Michael Menzel on 15/2/16.
......
package de.thm.exception;
import de.thm.serverStatistics.StatisticsCollector;
import de.thm.spring.StatisticsCollector;
import de.thm.spring.serverStatistics.StatisticsCollector;
/**
* Created by Michael Menzel on 15/2/16.
......
package de.thm.bootstrap;
package de.thm.run;
import de.thm.backgroundModel.BackgroundModelFactory;
import de.thm.calc.Intersect;
......
package de.thm.bootstrap;
package de.thm.run;
import de.thm.backgroundModel.BackgroundModelFactory;
import de.thm.calc.IntersectMultithread;
......@@ -7,8 +7,8 @@ import de.thm.genomeData.Track;
import de.thm.genomeData.TrackFactory;
import de.thm.genomeData.TrackPackage;
import de.thm.positionData.Sites;
import de.thm.serverStatistics.StatisticsCollector;
import de.thm.spring.command.RunCommand;
import de.thm.spring.serverStatistics.StatisticsCollector;
import de.thm.stat.ResultCollector;
import java.util.ArrayList;
......
package de.thm.bootstrap;
package de.thm.run;
import de.thm.exception.CovariantsException;
import de.thm.genomeData.TrackFactory;
import de.thm.serverStatistics.StatisticsCollector;
import de.thm.spring.command.RunCommand;
import de.thm.spring.serverStatistics.StatisticsCollector;
import de.thm.stat.ResultCollector;
import java.io.EOFException;
......@@ -62,45 +62,44 @@ public final class BackendController {
@Override
public void run() {
try {
socket = serverSocket.accept();
System.out.println("Interface connected");
inStream = new ObjectInputStream(socket.getInputStream());
outStream = new ObjectOutputStream(socket.getOutputStream());
boolean isConnected = false;
} catch (IOException e) {
e.printStackTrace();
}
while(true) {
//if interface is connected
while(true){
try {
RunCommand command;
command = (RunCommand) inStream.readObject();
System.out.println("got a command");
socket = serverSocket.accept();
System.out.println("Interface connected");
ResultCollector collector = AnalysisHelper.runAnalysis(command);
//send collector back to interface
inStream = new ObjectInputStream(socket.getInputStream());
outStream = new ObjectOutputStream(socket.getOutputStream());
isConnected = true;
outStream.writeObject(collector);
} catch (IOException e) {
e.printStackTrace();
}
//if interface is connected
while (isConnected) {
try {
RunCommand command;
command = (RunCommand) inStream.readObject();
} catch (EOFException e){
//do nothing here
continue;
} catch (IOException e){
e.printStackTrace();
System.out.println("got a command");
} catch (ClassCastException e){
e.printStackTrace();
ResultCollector collector = AnalysisHelper.runAnalysis(command);
//send collector back to interface
} catch (ClassNotFoundException e) {
e.printStackTrace();
outStream.writeObject(collector);
} catch (CovariantsException e) {
e.printStackTrace();
}
} catch (EOFException e) {
isConnected = false;
} catch (IOException | ClassCastException | ClassNotFoundException | CovariantsException e) {
isConnected = false;
e.printStackTrace();
}
}
}
}
......
package de.thm.bootstrap;
package de.thm.run;
import de.thm.genomeData.TrackFactory;
import de.thm.positionData.Sites;
......@@ -6,6 +6,7 @@ import de.thm.positionData.UserData;
import java.io.File;
@Deprecated
public class Testruns {
public static void main(String[] args) {
......
package de.thm.serverStatistics;
package de.thm.spring.serverStatistics;
import java.io.BufferedWriter;
import java.io.File;
......
package de.thm.spring.controller;
import de.thm.spring.backend.Sessions;
import de.thm.serverStatistics.StatisticsCollector;
import de.thm.spring.serverStatistics.StatisticsCollector;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
......
package de.thm.bootstrap;
package de.thm.spring.run;
import de.thm.serverStatistics.StatisticsCollector;
import de.thm.spring.serverStatistics.StatisticsCollector;
import de.thm.spring.backend.BackendConnector;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment