From 25ccbe82e255a176b98b076e634350f8cf95b387 Mon Sep 17 00:00:00 2001 From: Hallvard Traetteberg <hal@ntnu.no> Date: Fri, 20 Sep 2019 14:10:34 +0200 Subject: [PATCH] Forenklet med lambda. --- .../main/java/simpleex/restserver/LatLongGrizzlyApp.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/simpleexample2/restserver/src/main/java/simpleex/restserver/LatLongGrizzlyApp.java b/simpleexample2/restserver/src/main/java/simpleex/restserver/LatLongGrizzlyApp.java index 6e7fae7..dc0faf7 100644 --- a/simpleexample2/restserver/src/main/java/simpleex/restserver/LatLongGrizzlyApp.java +++ b/simpleexample2/restserver/src/main/java/simpleex/restserver/LatLongGrizzlyApp.java @@ -3,7 +3,6 @@ package simpleex.restserver; import java.net.URI; import java.util.logging.Level; import java.util.logging.Logger; - import org.glassfish.grizzly.http.server.HttpServer; import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory; import org.glassfish.jersey.server.ResourceConfig; @@ -16,12 +15,7 @@ public class LatLongGrizzlyApp { try { final ResourceConfig resourceConfig = new LatLongConfig(); final HttpServer server = GrizzlyHttpServerFactory.createHttpServer(BASE_URI, resourceConfig); - Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { - @Override - public void run() { - server.shutdownNow(); - } - })); + Runtime.getRuntime().addShutdownHook(new Thread(server::shutdownNow)); Thread.currentThread().join(); } catch (final InterruptedException ex) { Logger.getLogger(LatLongGrizzlyApp.class.getName()).log(Level.SEVERE, null, ex); -- GitLab