当前位置: 首页>>代码示例>>Java>>正文


Java AdminServlet类代码示例

本文整理汇总了Java中com.codahale.metrics.servlets.AdminServlet的典型用法代码示例。如果您正苦于以下问题:Java AdminServlet类的具体用法?Java AdminServlet怎么用?Java AdminServlet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AdminServlet类属于com.codahale.metrics.servlets包,在下文中一共展示了AdminServlet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getMetricsHandler

import com.codahale.metrics.servlets.AdminServlet; //导入依赖的package包/类
private ServletContextHandler getMetricsHandler() {
    MetricRegistry registry = Metrics.getRegistry();
    HealthCheckRegistry healthCheckRegistry = Metrics.getHealthCheckRegistry();
    healthCheckRegistry.register("rotation", new Rotation(configuration.getRotationStatusFilePath()));

    registry.registerAll(new GarbageCollectorMetricSet());
    registry.registerAll(new MemoryUsageGaugeSet());
    registry.registerAll(new ThreadStatesGaugeSet());
    registry.registerAll(new JvmAttributeGaugeSet());

    ServletContextHandler servletContextHandler = new ServletContextHandler();
    servletContextHandler.setContextPath("/__metrics");
    servletContextHandler.setAttribute(MetricsServlet.class.getCanonicalName() + ".registry", registry);
    servletContextHandler.setAttribute(HealthCheckServlet.class.getCanonicalName() + ".registry", healthCheckRegistry);
    servletContextHandler.addServlet(new ServletHolder(new AdminServlet()), "/*");

    return servletContextHandler;
}
 
开发者ID:flipkart-incubator,项目名称:Poseidon,代码行数:19,代码来源:Poseidon.java

示例2: contextInitialized

import com.codahale.metrics.servlets.AdminServlet; //导入依赖的package包/类
@Override
public void contextInitialized(ServletContextEvent sce) {
    ServletContext context = sce.getServletContext();
    ServletRegistration.Dynamic
        servlet =
        context.addServlet("VmInspectionServlet", VmInspectionServlet.class);
    servlet.addMapping("/gondola/inspect");
    servlet.setLoadOnStartup(1);

    ServletRegistration.Dynamic
        servlet2 =
        context.addServlet("MetricsServlet", AdminServlet.class);
    servlet2.addMapping("/gondola/metrics/*");
    servlet2.setLoadOnStartup(0);

    ServletRegistration.Dynamic servlet3 =
        context.addServlet("static", DefaultWrapperServlet.class);
    servlet3.setInitParameter("cacheControl", "max-age=0,no-cache");
    servlet3.setInitParameter("org.eclipse.jetty.servlet.Default.dirAllowed", "false");
    servlet3.setInitParameter("welcomeServlets", "false");
    servlet3.addMapping("/static/*");
}
 
开发者ID:yahoo,项目名称:gondola,代码行数:23,代码来源:GondolaApplication.java

示例3: start

import com.codahale.metrics.servlets.AdminServlet; //导入依赖的package包/类
public void start() throws Exception {
    ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
    context.setContextPath("/");
    jettyServer.setHandler(context);

    context.addEventListener(new HealthCheckServletContextListener(healthCheckRegistry));
    context.addEventListener(new MetricsServletContextListener(metricRegistry));
    context.addServlet(new ServletHolder(new AdminServlet()), "/*");

    jettyServer.start();
}
 
开发者ID:twitter,项目名称:distributedlog,代码行数:12,代码来源:ServletReporter.java

示例4: LensServer

import com.codahale.metrics.servlets.AdminServlet; //导入依赖的package包/类
/**
 * Instantiates a new lens server.
 *
 * @param conf the conf
 * @throws IOException Signals that an I/O exception has occurred.
 */
private LensServer(HiveConf conf) throws IOException {
  startServices(conf);
  String baseURI = conf.get(LensConfConstants.SERVER_BASE_URL, LensConfConstants.DEFAULT_SERVER_BASE_URL);
  HttpServer server = GrizzlyHttpServerFactory.createHttpServer(UriBuilder.fromUri(baseURI).build(), getApp(),
    false);

  int corePoolSize = conf.getInt(LensConfConstants.GRIZZLY_CORE_POOL_SIZE,
          LensConfConstants.DEFAULT_GRIZZLY_CORE_POOL_SIZE);
  int maxPoolSize = conf.getInt(LensConfConstants.GRIZZLY_MAX_POOL_SIZE,
          LensConfConstants.DEFAULT_GRIZZLY_MAX_POOL_SIZE);

  ThreadPoolConfig config = ThreadPoolConfig.defaultConfig();
  config.setPoolName("lensserver-pool");
  config.setCorePoolSize(corePoolSize);
  config.setMaxPoolSize(maxPoolSize);
  config.setThreadFactory((new ThreadFactoryBuilder()).setNameFormat("grizzly-http-server-%d")
    .setUncaughtExceptionHandler(new JerseyProcessingUncaughtExceptionHandler()).build());

  NetworkListener listener = server.getListeners().iterator().next();
  listener.getTransport().setWorkerThreadPoolConfig(config);
  serverList.add(server);

  WebappContext adminCtx = new WebappContext("admin", "");
  MetricsServiceImpl metricsService = LensServices.get().getService(MetricsService.NAME);
  adminCtx
    .setAttribute("com.codahale.metrics.servlets.MetricsServlet.registry", (metricsService.getMetricRegistry()));
  adminCtx.setAttribute("com.codahale.metrics.servlets.HealthCheckServlet.registry", metricsService.getHealthCheck());
  final ServletRegistration sgMetrics = adminCtx.addServlet("admin", new AdminServlet());
  sgMetrics.addMapping("/admin/*");
  adminCtx.deploy(server);
}
 
开发者ID:apache,项目名称:lens,代码行数:38,代码来源:LensServer.java

示例5: buildDeploymentInfo

import com.codahale.metrics.servlets.AdminServlet; //导入依赖的package包/类
private DeploymentInfo buildDeploymentInfo(JbootServerClassloader classloader) {
    DeploymentInfo deploymentInfo = Servlets.deployment()
            .setClassLoader(classloader)
            .setResourceManager(new ClassPathResourceManager(classloader))
            .setContextPath(config.getContextPath())
            .setDeploymentName("jboot" + StringUtils.uuid())
            .setEagerFilterInit(true); //设置启动的时候,初始化servlet或filter


    JbootShiroConfig shiroConfig = Jboot.config(JbootShiroConfig.class);
    if (shiroConfig.isConfigOK()) {
        deploymentInfo.addListeners(Servlets.listener(EnvironmentLoaderListener.class));
        deploymentInfo.addFilter(
                Servlets.filter("shiro", ShiroFilter.class))
                .addFilterUrlMapping("shiro", "/*", DispatcherType.REQUEST);
    }


    deploymentInfo.addFilter(
            Servlets.filter("jfinal", JFinalFilter.class)
                    .addInitParam("configClass", Jboot.me().getJbootConfig().getJfinalConfig()))
            .addFilterUrlMapping("jfinal", "/*", DispatcherType.REQUEST);


    JbootHystrixConfig hystrixConfig = Jboot.config(JbootHystrixConfig.class);
    if (StringUtils.isNotBlank(hystrixConfig.getUrl())) {
        deploymentInfo.addServlets(
                Servlets.servlet("HystrixMetricsStreamServlet", HystrixMetricsStreamServlet.class)
                        .addMapping(hystrixConfig.getUrl()));
    }


    JbootMetricConfig metricsConfig = Jboot.config(JbootMetricConfig.class);
    if (StringUtils.isNotBlank(metricsConfig.getUrl())) {
        deploymentInfo.addServlets(
                Servlets.servlet("MetricsAdminServlet", AdminServlet.class)
                        .addMapping(metricsConfig.getUrl()));

        deploymentInfo.addListeners(Servlets.listener(JbootMetricServletContextListener.class));
        deploymentInfo.addListeners(Servlets.listener(JbootHealthCheckServletContextListener.class));
    }


    io.jboot.server.Servlets jbootServlets = new io.jboot.server.Servlets();
    ContextListeners listeners = new ContextListeners();

    JbootAppListenerManager.me().onJbootDeploy(jbootServlets, listeners);


    for (Map.Entry<String, io.jboot.server.Servlets.ServletInfo> entry : jbootServlets.getServlets().entrySet()) {
        ServletInfo servletInfo = Servlets.servlet(entry.getKey(), entry.getValue().getServletClass()).addMappings(entry.getValue().getUrlMapping());
        deploymentInfo.addServlet(servletInfo);
    }

    for (Class<? extends ServletContextListener> listenerClass : listeners.getListeners()) {
        deploymentInfo.addListeners(Servlets.listener(listenerClass));
    }


    deploymentInfo.addServlets(
            Servlets.servlet("JbootResourceServlet", JbootResourceServlet.class)
                    .addMapping("/*"));

    return deploymentInfo;
}
 
开发者ID:yangfuhai,项目名称:jboot,代码行数:66,代码来源:UnderTowServer.java

示例6: initJettyServer

import com.codahale.metrics.servlets.AdminServlet; //导入依赖的package包/类
private void initJettyServer() {
    InetSocketAddress address = new InetSocketAddress(config.getHost(), config.getPort());
    jettyServer = new Server(address);

    handler = new ServletContextHandler();
    handler.setContextPath(config.getContextPath());
    handler.setClassLoader(new JbootServerClassloader(JettyServer.class.getClassLoader()));
    handler.setResourceBase(getRootClassPath());

    JbootShiroConfig shiroConfig = Jboot.config(JbootShiroConfig.class);
    if (shiroConfig.isConfigOK()) {
        handler.addEventListener(new EnvironmentLoaderListener());
        handler.addFilter(ShiroFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST));
    }

    //JFinal
    FilterHolder jfinalFilter = handler.addFilter(JFinalFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST));
    jfinalFilter.setInitParameter("configClass", Jboot.me().getJbootConfig().getJfinalConfig());

    JbootHystrixConfig hystrixConfig = Jboot.config(JbootHystrixConfig.class);
    if (StringUtils.isNotBlank(hystrixConfig.getUrl())) {
        handler.addServlet(HystrixMetricsStreamServlet.class, hystrixConfig.getUrl());
    }


    JbootMetricConfig metricsConfig = Jboot.config(JbootMetricConfig.class);
    if (StringUtils.isNotBlank(metricsConfig.getUrl())) {
        handler.addEventListener(new JbootMetricServletContextListener());
        handler.addEventListener(new JbootHealthCheckServletContextListener());
        handler.addServlet(AdminServlet.class, metricsConfig.getUrl());
    }

    io.jboot.server.Servlets jbootServlets = new io.jboot.server.Servlets();
    ContextListeners listeners = new ContextListeners();

    JbootAppListenerManager.me().onJbootDeploy(jbootServlets, listeners);


    for (Map.Entry<String, io.jboot.server.Servlets.ServletInfo> entry : jbootServlets.getServlets().entrySet()) {
        for (String path : entry.getValue().getUrlMapping()) {
            handler.addServlet(entry.getValue().getServletClass(), path);
        }
    }


    for (Class<? extends ServletContextListener> listenerClass : listeners.getListeners()) {
        handler.addEventListener(ClassKits.newInstance(listenerClass));
    }

    jettyServer.setHandler(handler);
}
 
开发者ID:yangfuhai,项目名称:jboot,代码行数:52,代码来源:JettyServer.java

示例7: registerMetricsServlets

import com.codahale.metrics.servlets.AdminServlet; //导入依赖的package包/类
private void registerMetricsServlets(final ServletContextHandler context) {
  context.addEventListener(new ExampleHealthCheckServletContextListener());
  context.addEventListener(new ExampleMetricsServletContextListener());
  context.addServlet(AdminServlet.class, "/admin");
  context.addServlet(HealthCheckServlet.class, "/admin/healthcheck");
  context.addServlet(MetricsServlet.class, "/admin/metrics");
  context.addServlet(PingServlet.class, "/admin/ping");
  context.addServlet(ThreadDumpServlet.class, "/admin/threads");
}
 
开发者ID:dsmclaughlin,项目名称:onerepmax,代码行数:10,代码来源:JettyServer.java

示例8: main

import com.codahale.metrics.servlets.AdminServlet; //导入依赖的package包/类
/**
 * Run the Wikipedia application.
 *
 * @param args  command line arguments
 * @throws Exception if the server fails to start or crashes
 */
public static void main(String[] args) throws Exception {
    int port = 9998;

    Server server = new Server(port);
    ServletContextHandler servletContextHandler = new ServletContextHandler(ServletContextHandler.NO_SESSIONS);

    servletContextHandler.addEventListener(new MetricServletContextListener());
    servletContextHandler.addEventListener(new HealthCheckServletContextListener());

    servletContextHandler.setContextPath("/");
    servletContextHandler.setResourceBase("src/main/webapp");

    //Activate codahale metrics
    FilterHolder instrumentedFilterHolder = new FilterHolder(InstrumentedFilter.class);
    instrumentedFilterHolder.setName("instrumentedFilter");
    instrumentedFilterHolder.setAsyncSupported(true);
    servletContextHandler.addFilter(instrumentedFilterHolder, "/*", EnumSet.noneOf(DispatcherType.class));

    // Static resource handler
    ResourceHandler resourceHandler = new ResourceHandler();
    resourceHandler.setDirectoriesListed(true);
    resourceHandler.setResourceBase("src/main/webapp");

    // Add the handlers to the server
    HandlerList handlers = new HandlerList();
    handlers.setHandlers(new Handler[] { resourceHandler, servletContextHandler });
    server.setHandler(handlers);

    ServletHolder servletHolder = servletContextHandler.addServlet(ServletContainer.class, "/v1/*");
    servletHolder.setInitOrder(1);
    servletHolder.setInitParameter(
            "javax.ws.rs.Application",
            "com.yahoo.bard.webservice.application.ResourceConfig");
    servletHolder.setInitParameter(
            "jersey.config.server.provider.packages",
            "com.yahoo.bard.webservice.web.endpoints");

    servletContextHandler.addServlet(AdminServlet.class, "/*");

    server.start();

    markDimensionCacheHealthy(port);
}
 
开发者ID:yahoo,项目名称:fili,代码行数:50,代码来源:WikiMain.java

示例9: main

import com.codahale.metrics.servlets.AdminServlet; //导入依赖的package包/类
/**
 * Run a generic setup which mirrors all information from druid into fili configuration.
 *
 * @param args  Command line arguments.
 *
 * @throws Exception if the server fails to start or crashes.
 */
public static void main(String[] args) throws Exception {
    int port = SYSTEM_CONFIG.getIntProperty(FILI_PORT);

    Server server = new Server(port);
    ServletContextHandler servletContextHandler = new ServletContextHandler(ServletContextHandler.NO_SESSIONS);

    servletContextHandler.addEventListener(new MetricServletContextListener());
    servletContextHandler.addEventListener(new HealthCheckServletContextListener());

    servletContextHandler.setContextPath("/");
    servletContextHandler.setResourceBase("src/main/webapp");

    //Activate codahale metrics
    FilterHolder instrumentedFilterHolder = new FilterHolder(InstrumentedFilter.class);
    instrumentedFilterHolder.setName("instrumentedFilter");
    instrumentedFilterHolder.setAsyncSupported(true);
    servletContextHandler.addFilter(instrumentedFilterHolder, "/*", EnumSet.noneOf(DispatcherType.class));

    // Static resource handler
    ResourceHandler resourceHandler = new ResourceHandler();
    resourceHandler.setDirectoriesListed(true);
    resourceHandler.setResourceBase("src/main/webapp");

    // Add the handlers to the server
    HandlerList handlers = new HandlerList();
    handlers.setHandlers(new Handler[] {resourceHandler, servletContextHandler});
    server.setHandler(handlers);

    ServletHolder servletHolder = servletContextHandler.addServlet(ServletContainer.class, "/v1/*");
    servletHolder.setInitOrder(1);
    servletHolder.setInitParameter(
            "javax.ws.rs.Application",
            "com.yahoo.bard.webservice.application.ResourceConfig"
    );
    servletHolder.setInitParameter(
            "jersey.config.server.provider.packages",
            "com.yahoo.bard.webservice.web.endpoints"
    );

    servletContextHandler.addServlet(AdminServlet.class, "/*");

    server.start();
}
 
开发者ID:yahoo,项目名称:fili,代码行数:51,代码来源:GenericMain.java

示例10: adminServer

import com.codahale.metrics.servlets.AdminServlet; //导入依赖的package包/类
@Bean(initMethod="start", destroyMethod="stop")
@Order(0)
public Server adminServer(
           @Value("${admin.hostname}") String hostname,
           @Value("${admin.port}") int port) {

       // set up servlets
       ServletContextHandler context = new ServletContextHandler(ServletContextHandler.NO_SESSIONS | ServletContextHandler.NO_SECURITY);
	context.setErrorHandler(null);
	context.setWelcomeFiles(new String[] { "/" });
	
	// enable gzip
	context.addFilter(GzipFilter.class, "/*", null);
	
	// add common admin servlets
	context.addServlet(new ServletHolder(new HealthServlet(healthCheckRegistry)), "/healthcheck");
	context.addServlet(new ServletHolder(new ClasspathResourceServlet("com/kixeye/chassis/transport/admin", "/admin/", "index.html")), "/admin/*");
	context.addServlet(new ServletHolder(new PropertiesServlet()), "/admin/properties");
	context.addServlet(new ServletHolder(new ClasspathDumpServlet()), "/admin/classpath");

       // add websocket servlets if WebSockets have been initialized
       if (mappingRegistry != null && messageRegistry != null) {
           context.addServlet(new ServletHolder(new ProtobufMessagesDocumentationServlet(appName, mappingRegistry, messageRegistry)), "/schema/messages/protobuf");
           context.addServlet(new ServletHolder(new ProtobufEnvelopeDocumentationServlet()), "/schema/envelope/protobuf");
       }
	
       // add metric servlets if Metric has been initialized
       if (metricRegistry != null && healthCheckRegistry != null) {
           context.getServletContext().setAttribute(MetricsServlet.METRICS_REGISTRY, metricRegistry);
           context.getServletContext().setAttribute(HealthCheckServlet.HEALTH_CHECK_REGISTRY, healthCheckRegistry);
           
           ServletHolder holder = new ServletHolder(new AdminServlet());
           holder.setInitParameter("service-name", System.getProperty("app.name"));
           context.addServlet(holder, "/metrics/*");
       }

       // create the server
   	InetSocketAddress address = StringUtils.isBlank(hostname) ? new InetSocketAddress(port) : new InetSocketAddress(hostname, port);
   	
   	Server server = new Server();

   	JettyConnectorRegistry.registerHttpConnector(server, address);
       server.setHandler(context);
   
	return server;
}
 
开发者ID:Kixeye,项目名称:chassis,代码行数:47,代码来源:AdminTransportConfiguration.java

示例11: metricsServlet

import com.codahale.metrics.servlets.AdminServlet; //导入依赖的package包/类
@Produces
public ServletDescriptor metricsServlet() {
    String[] uris = new String[]{metricsConfig.getBaseUri()};
    WebInitParam[] params = null;
    return new ServletDescriptor("Metrics", uris, uris, 1, params, false, AdminServlet.class);
}
 
开发者ID:hammock-project,项目名称:hammock,代码行数:7,代码来源:MetricsServletProvider.java

示例12: metricServer

import com.codahale.metrics.servlets.AdminServlet; //导入依赖的package包/类
@Provides
@Singleton
private Server metricServer(final MetricRegistry metricRegistry) throws Exception {
    metricRegistry.registerAll(new GarbageCollectorMetricSet());
    metricRegistry.registerAll(new MemoryUsageGaugeSet());
    metricRegistry.registerAll(new ThreadStatesGaugeSet());

    final HealthCheckRegistry notUsed = new HealthCheckRegistry();

    AdminServletContextListener ascl =  new AdminServletContextListener() {

        @Override
        protected MetricRegistry getMetricRegistry() {
            return metricRegistry;
        }

        @Override
        protected HealthCheckRegistry getHealthCheckRegistry() {
            return notUsed;
        }
    };

    final Server server = new Server(7070);
    ServletContextHandler context = new ServletContextHandler();
    context.addEventListener(ascl);
    context.setContextPath("/");
    context.setInitParameter(MetricsServlet.DURATION_UNIT, TimeUnit.MILLISECONDS.toString());
    context.setInitParameter(MetricsServlet.RATE_UNIT, TimeUnit.SECONDS.toString());
    server.setHandler(context);
    ServletHolder holder = new ServletHolder(new AdminServlet());
    context.addServlet(holder, "/*");

    server.start();

    Runtime.getRuntime().addShutdownHook(new Thread() {
        @Override
        public void run() {
            try {
                server.stop();
            } catch (Exception e) {
                throw new AssertionError(e);
            }
        }
    });

    return server;
}
 
开发者ID:eshioji,项目名称:toy-java8,代码行数:48,代码来源:Java8Module.java

示例13: StartReportingMetricsToHTTP

import com.codahale.metrics.servlets.AdminServlet; //导入依赖的package包/类
public StartReportingMetricsToHTTP(CommandBuilder builder, Config config, Command parent, 
                                   Command child, final MorphlineContext context) {
  
  super(builder, config, parent, child, context);      

  this.port = getConfigs().getInt(config, "port", 8080);
  final TimeUnit defaultDurationUnit = getConfigs().getTimeUnit(config, "defaultDurationUnit", TimeUnit.MILLISECONDS);
  final TimeUnit defaultRateUnit = getConfigs().getTimeUnit(config, "defaultRateUnit", TimeUnit.SECONDS); 
  validateArguments();

  synchronized (SERVERS) {
    Server server = SERVERS.get(port);
    if (server == null) {
      ServletContextHandler servletContextHandler = new ServletContextHandler();
      servletContextHandler.addServlet(AdminServlet.class, "/*");
      
      servletContextHandler.addEventListener(new MetricsServlet.ContextListener() {      
        @Override
        protected MetricRegistry getMetricRegistry() {
          return context.getMetricRegistry();
        }
        @Override
        protected TimeUnit getRateUnit() {
          return defaultRateUnit;
        }
        @Override
        protected TimeUnit getDurationUnit() {
          return defaultDurationUnit;
        }
      });
      
      servletContextHandler.addEventListener(new HealthCheckServlet.ContextListener() {         
        @Override
        protected HealthCheckRegistry getHealthCheckRegistry() {
          return context.getHealthCheckRegistry();
        }
      });
      
      server = new Server(port);
      server.setHandler(servletContextHandler);
      
      try {
        server.start();
      } catch (Exception e) {
        throw new MorphlineRuntimeException(e);
      }
      
      SERVERS.put(port, server);
    }
  }
}
 
开发者ID:cloudera,项目名称:cdk,代码行数:52,代码来源:StartReportingMetricsToHTTPBuilder.java

示例14: SentryWebServer

import com.codahale.metrics.servlets.AdminServlet; //导入依赖的package包/类
public SentryWebServer(List<EventListener> listeners, int port, Configuration conf) {
  this.port = port;
  server = new Server(port);
  ServletContextHandler servletContextHandler = new ServletContextHandler();
  ServletHolder servletHolder = new ServletHolder(AdminServlet.class);
  servletContextHandler.addServlet(servletHolder, "/*");

  for(EventListener listener:listeners) {
    servletContextHandler.addEventListener(listener);
  }

  ServletHolder confServletHolder = new ServletHolder(ConfServlet.class);
  servletContextHandler.addServlet(confServletHolder, "/conf");
  servletContextHandler.getServletContext()
      .setAttribute(ConfServlet.CONF_CONTEXT_ATTRIBUTE, conf);

  ResourceHandler resourceHandler = new ResourceHandler();
  resourceHandler.setDirectoriesListed(true);
  URL url = this.getClass().getResource(RESOURCE_DIR);
  try {
    resourceHandler.setBaseResource(Resource.newResource(url.toString()));
  } catch (IOException e) {
    LOGGER.error("Got exception while setBaseResource for Sentry Service web UI", e);
  }
  resourceHandler.setWelcomeFiles(new String[]{WELCOME_PAGE});
  ContextHandler contextHandler= new ContextHandler();
  contextHandler.setHandler(resourceHandler);

  ContextHandlerCollection contextHandlerCollection = new ContextHandlerCollection();
  contextHandlerCollection.setHandlers(new Handler[]{contextHandler, servletContextHandler});

  String authMethod = conf.get(ServerConfig.SENTRY_WEB_SECURITY_TYPE);
  if (!ServerConfig.SENTRY_WEB_SECURITY_TYPE_NONE.equals(authMethod)) {
    /**
     * SentryAuthFilter is a subclass of AuthenticationFilter and
     * AuthenticationFilter tagged as private and unstable interface:
     * While there are not guarantees that this interface will not change,
     * it is fairly stable and used by other projects (ie - Oozie)
     */
    FilterHolder filterHolder = servletContextHandler.addFilter(SentryAuthFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST));
    filterHolder.setInitParameters(loadWebAuthenticationConf(conf));
  }

  server.setHandler(contextHandlerCollection);
}
 
开发者ID:apache,项目名称:incubator-sentry,代码行数:46,代码来源:SentryWebServer.java

示例15: configureInternalServlets

import com.codahale.metrics.servlets.AdminServlet; //导入依赖的package包/类
protected void configureInternalServlets(ServletContextHandler handler) {
    handler.addServlet(new ServletHolder(new AdminServlet()), "/*");
}
 
开发者ID:wotifgroup,项目名称:grails-lightweight-deploy,代码行数:4,代码来源:Launcher.java


注:本文中的com.codahale.metrics.servlets.AdminServlet类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。