Search in sources :

Example 11 with MonitorHandler

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);
}
Also used : DatasetFramework(io.cdap.cdap.data2.dataset2.DatasetFramework) InMemoryDatasetFramework(io.cdap.cdap.data2.dataset2.InMemoryDatasetFramework) HttpHandler(io.cdap.http.HttpHandler) ServiceStore(io.cdap.cdap.app.store.ServiceStore) DatasetServiceStore(io.cdap.cdap.gateway.handlers.DatasetServiceStore) MonitorHandler(io.cdap.cdap.gateway.handlers.MonitorHandler) PrivateModule(com.google.inject.PrivateModule)

Aggregations

MonitorHandler (io.cdap.cdap.gateway.handlers.MonitorHandler)11 UnauthorizedException (io.cdap.cdap.security.spi.authorization.UnauthorizedException)9 HttpResponder (io.cdap.http.HttpResponder)9 DefaultFullHttpRequest (io.netty.handler.codec.http.DefaultFullHttpRequest)9 Test (org.junit.Test)9 SystemServiceId (io.cdap.cdap.proto.id.SystemServiceId)7 FullHttpRequest (io.netty.handler.codec.http.FullHttpRequest)6 HttpRequest (io.netty.handler.codec.http.HttpRequest)4 ServiceStore (io.cdap.cdap.app.store.ServiceStore)2 InstanceId (io.cdap.cdap.proto.id.InstanceId)2 HashMap (java.util.HashMap)2 PrivateModule (com.google.inject.PrivateModule)1 MasterServiceManager (io.cdap.cdap.common.twill.MasterServiceManager)1 DatasetFramework (io.cdap.cdap.data2.dataset2.DatasetFramework)1 InMemoryDatasetFramework (io.cdap.cdap.data2.dataset2.InMemoryDatasetFramework)1 DatasetServiceStore (io.cdap.cdap.gateway.handlers.DatasetServiceStore)1 Instances (io.cdap.cdap.proto.Instances)1 AuthenticationTestContext (io.cdap.cdap.security.auth.context.AuthenticationTestContext)1 DefaultContextAccessEnforcer (io.cdap.cdap.security.authorization.DefaultContextAccessEnforcer)1 InMemoryAccessController (io.cdap.cdap.security.authorization.InMemoryAccessController)1