-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
34 lines (29 loc) · 816 Bytes
/
Main.java
File metadata and controls
34 lines (29 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.benglasser.http;
import com.benglasser.http.modules.MainModule;
import com.google.inject.Guice;
import com.google.inject.Injector;
import java.io.IOException;
import java.util.concurrent.ExecutorService;
/**
* Created by bglasser on 10/19/15.
*/
public class Main
{
public static void main(String[] args) throws IOException
{
Injector injector = Guice.createInjector(new MainModule());
HttpServer myServer = injector.getInstance(HttpServer.class);
myServer.start();
Runtime.getRuntime().addShutdownHook(new Thread()
{
@Override
public void run()
{
//TODO: once there is a shutdown hook in HttpServer this would be an ideal place to call it.
System.out.println("Shutting down...");
}
});
// run forever
for (; ; ) ;
}
}