use of com.ning.metrics.meteo.binder.RealtimeSystemModule in project meteo by pierre.
the class RealtimeSystem method main.
public static void main(final String[] args) throws Exception {
final Injector injector = Guice.createInjector(new RealtimeSystemModule(), new ServletModule() {
@Override
protected void configureServlets() {
// Static files
bind(DefaultServlet.class).asEagerSingleton();
serve("/media/*").with(DefaultServlet.class);
serve("*").with(GuiceContainer.class, new HashMap<String, String>() {
{
put(PackagesResourceConfig.PROPERTY_PACKAGES, "com.ning.metrics.meteo.server.resources");
}
});
}
});
final SubscribersCompiler subscribersCompiler = injector.getInstance(SubscribersCompiler.class);
subscribersCompiler.startAll();
final JettyServer jetty = injector.getInstance(JettyServer.class);
jetty.start(injector);
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
subscribersCompiler.stopAll();
jetty.stop();
}
});
}
Aggregations