Skip to content
Snippets Groups Projects
Commit 25ccbe82 authored by Hallvard Trætteberg's avatar Hallvard Trætteberg
Browse files

Forenklet med lambda.

parent c08f8ffc
No related branches found
No related tags found
No related merge requests found
Pipeline #49152 passed
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment