use of io.cdap.cdap.gateway.handlers.MonitorHandler in project cdap by caskdata.
the class MonitorHandlerModule method configure.
@Override
protected void configure() {
// Only MonitorHandler use MasterServiceManager
install(new PrivateModule() {
@Override
protected void configure() {
if (isHadoop) {
addHadoopBindings(binder());
} else {
addNonHadoopBindings(binder());
}
bind(DatasetFramework.class).annotatedWith(Names.named("local.ds.framework")).toProvider(DatasetFrameworkProvider.class);
// Need to expose ServiceStore for master and standalone main to start/stop it
bind(ServiceStore.class).to(DatasetServiceStore.class).in(Scopes.SINGLETON);
expose(ServiceStore.class);
// Expose the MonitorHandler so that it can be bounded to the multibinder
bind(MonitorHandler.class);
expose(MonitorHandler.class);
}
});
Multibinder<HttpHandler> handlerBinder = Multibinder.newSetBinder(binder(), HttpHandler.class, Names.named(Constants.AppFabric.HANDLERS_BINDING));
handlerBinder.addBinding().to(MonitorHandler.class);
}
Aggregations