build error fixes

This commit is contained in:
Marcel 2021-10-17 12:12:29 +02:00
parent 6cb52ba0c6
commit d1d584bf6c
4 changed files with 11 additions and 21 deletions

View File

@ -62,21 +62,4 @@
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -5,6 +5,8 @@ import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.json.JSONObject;
@ -13,9 +15,10 @@ import ch.unisg.executorBase.executor.domain.ExecutionFinishedEvent;
public class ExecutionFinishedEventAdapter implements ExecutionFinishedEventPort {
//This is the base URI of the service interested in this event (in my setup, running locally as separate Spring Boot application)
String server = "http://127.0.0.1:8082";
Logger logger = Logger.getLogger(ExecutionFinishedEventAdapter.class.getName());
@Override
public void publishExecutionFinishedEvent(ExecutionFinishedEvent event) {
@ -35,7 +38,7 @@ public class ExecutionFinishedEventAdapter implements ExecutionFinishedEventPort
try {
client.send(request, HttpResponse.BodyHandlers.ofString());
} catch (IOException | InterruptedException e) {
e.printStackTrace();
logger.log(Level.SEVERE, e.getLocalizedMessage(), e);
// Restore interrupted state...
Thread.currentThread().interrupt();
}

View File

@ -5,6 +5,8 @@ import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;
@ -19,9 +21,10 @@ import org.json.JSONObject;
@Primary
public class GetAssignmentAdapter implements GetAssignmentPort {
//This is the base URI of the service interested in this event (in my setup, running locally as separate Spring Boot application)
String server = "http://127.0.0.1:8082";
Logger logger = Logger.getLogger(GetAssignmentAdapter.class.getName());
@Override
public Task getAssignment(ExecutorType executorType, String ip, int port) {
@ -47,7 +50,7 @@ public class GetAssignmentAdapter implements GetAssignmentPort {
return new Task(new JSONObject(response.body()).getString("taskID"));
} catch (IOException | InterruptedException e) {
e.printStackTrace();
logger.log(Level.SEVERE, e.getLocalizedMessage(), e);
// Restore interrupted state...
Thread.currentThread().interrupt();
}

View File

@ -44,6 +44,7 @@
<groupId>ch.unisg</groupId>
<artifactId>executorBase</artifactId>
<version>0.0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>