org.eclipse.jetty.server.Server.getHandlers()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(126)

本文整理了Java中org.eclipse.jetty.server.Server.getHandlers()方法的一些代码示例,展示了Server.getHandlers()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Server.getHandlers()方法的具体详情如下:
包路径:org.eclipse.jetty.server.Server
类名称:Server
方法名:getHandlers

Server.getHandlers介绍

暂无

代码示例

代码示例来源:origin: org.springframework.boot/spring-boot

private String getContextPath() {
  return Arrays.stream(this.server.getHandlers())
      .filter(ContextHandler.class::isInstance).map(ContextHandler.class::cast)
      .map(ContextHandler::getContextPath).collect(Collectors.joining(" "));
}

代码示例来源:origin: Alluxio/alluxio

/**
 * Adds a handler.
 *
 * @param handler the handler to add
 */
public void addHandler(AbstractHandler handler) {
 HandlerList handlers = new HandlerList();
 handlers.addHandler(handler);
 for (Handler h : mServer.getHandlers()) {
  handlers.addHandler(h);
 }
 mServer.setHandler(handlers);
}

代码示例来源:origin: apache/hbase

Handler[] handlers = webServer.getHandlers();
for (int i = 0; i < handlers.length; i++) {
 if (handlers[i].isFailed()) {

代码示例来源:origin: apache/hive

public void addRedirects(Server server) {
 RewriteHandler rewrite = new RewriteHandler();
 RedirectPatternRule redirect = new RedirectPatternRule();
 redirect.setPattern("/templeton/v1/application.wadl");
 redirect.setLocation("/templeton/application.wadl");
 rewrite.addRule(redirect);
 HandlerList handlerlist = new HandlerList();
 ArrayList<Handler> handlers = new ArrayList<Handler>();
 // Any redirect handlers need to be added first
 handlers.add(rewrite);
 // Now add all the default handlers
 for (Handler handler : server.getHandlers()) {
  handlers.add(handler);
 }
 Handler[] newlist = new Handler[handlers.size()];
 handlerlist.setHandlers(handlers.toArray(newlist));
 server.setHandler(handlerlist);
}

代码示例来源:origin: org.apache.hadoop/hadoop-common

Handler[] hs = webServer.getHandlers();
for (Handler handler : hs) {
 if (handler.isFailed()) {

代码示例来源:origin: org.springframework.boot/spring-boot

for (Handler handler : this.server.getHandlers()) {
  handleDeferredInitialize(handler);

代码示例来源:origin: apache/incubator-druid

for (Handler handler : server.getHandlers()) {
 handlerList.addHandler(handler);

代码示例来源:origin: apache/phoenix

@Override
  public void customize(Server server) {
    LOG.debug("Customizing server to allow requests for {}", USER_AUTHORIZED);
    HashLoginService login = new HashLoginService();
    login.putUser(USER_AUTHORIZED, Credential.getCredential(USER_PW), new String[] {"users"});
    login.setName("users");
    Constraint constraint = new Constraint();
    constraint.setName(Constraint.__BASIC_AUTH);
    constraint.setRoles(new String[]{"users"});
    constraint.setAuthenticate(true);
    ConstraintMapping cm = new ConstraintMapping();
    cm.setConstraint(constraint);
    cm.setPathSpec("/*");
    ConstraintSecurityHandler security = new ConstraintSecurityHandler();
    security.setAuthenticator(new BasicAuthenticator());
    security.setRealmName("users");
    security.addConstraintMapping(cm);
    security.setLoginService(login);
    // chain the PQS handler to security
    security.setHandler(server.getHandlers()[0]);
    server.setHandler(security);
  }
}

代码示例来源:origin: org.sonatype.plexus/plexus-jetty7

protected ContextHandler getContext( final Server server )
{
  Handler[] handlers = server.getHandlers();
  if ( handlers == null )
  {
    handlers = new Handler[] { server.getHandler() };
  }
  return getContextHandlerOnPath( contextPath, handlers );
}

代码示例来源:origin: org.sonatype.plexus/plexus-jetty7

public Object mangle( final Server server )
{
  Handler[] handlers = server.getHandlers();
  if ( handlers == null )
  {
    handlers = new Handler[] { server.getHandler() };
  }
  return setAppContextOnAllContextHandlers( handlers );
}

代码示例来源:origin: org.alluxio/alluxio-core-server-common

/**
 * Adds a handler.
 *
 * @param handler the handler to add
 */
public void addHandler(AbstractHandler handler) {
 HandlerList handlers = new HandlerList();
 handlers.addHandler(handler);
 for (Handler h : mServer.getHandlers()) {
  handlers.addHandler(h);
 }
 mServer.setHandler(handlers);
}

代码示例来源:origin: org.tachyonproject/tachyon-servers

public void addHandler(AbstractHandler handler) {
 HandlerList handlers = new HandlerList();
 handlers.addHandler(handler);
 for (Handler h : mServer.getHandlers()) {
  handlers.addHandler(h);
 }
 mServer.setHandler(handlers);
}

代码示例来源:origin: cn.home1/oss-lib-webmvc-spring-boot-1.4.1.RELEASE

@Override
public void customize(final Server server) {
 final HandlerCollection handlers = new HandlerCollection();
 // final RequestLog requestLog = slf4jLog();
 final RequestLog requestLog = ncsaRequestLog(applicationName);
 final RequestLogHandler logHandler = new RequestLogHandler();
 logHandler.setRequestLog(requestLog);
 handlers.addHandler(logHandler);
 asList(server.getHandlers()).forEach(handlers::addHandler);
 server.setHandler(handlers);
}

代码示例来源:origin: cn.home1/oss-lib-webmvc-spring-boot-1.4.2.RELEASE

@Override
public void customize(final Server server) {
 final HandlerCollection handlers = new HandlerCollection();
 // final RequestLog requestLog = slf4jLog();
 final RequestLog requestLog = ncsaRequestLog(applicationName);
 final RequestLogHandler logHandler = new RequestLogHandler();
 logHandler.setRequestLog(requestLog);
 handlers.addHandler(logHandler);
 asList(server.getHandlers()).forEach(handlers::addHandler);
 server.setHandler(handlers);
}

代码示例来源:origin: springside/springtime

private void customizeSpringTimeHanlder(Server server) {
    // add SpringTimeHandler as first handler
    Handler[] oldHandlers = server.getHandlers();
    SpringTimeHandler springTimeHandler = new SpringTimeHandler(applicationContext);
    
    HandlerList handlerList = new HandlerList();
    handlerList.setHandlers(ArrayUtil.prependToArray(springTimeHandler, oldHandlers, Handler.class));
    
    server.setHandler(handlerList);
  }
});

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

@Override
public void dump(Appendable out,String indent) throws IOException
{
  dumpThis(out);
  dump(out,indent,TypeUtil.asList(getHandlers()),getBeans(),TypeUtil.asList(_connectors));
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp

@Override
public void dump(Appendable out,String indent) throws IOException
{
  dumpThis(out);
  dump(out,indent,TypeUtil.asList(getHandlers()),getBeans(),TypeUtil.asList(_connectors));
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus

@Override
public void dump(Appendable out,String indent) throws IOException
{
  dumpThis(out);
  dump(out,indent,TypeUtil.asList(getHandlers()),getBeans(),TypeUtil.asList(_connectors));
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server

@Override
public void dump(Appendable out,String indent) throws IOException
{
  dumpThis(out);
  dump(out,indent,TypeUtil.asList(getHandlers()),getBeans(),TypeUtil.asList(_connectors));
}

代码示例来源:origin: com.facebook.swift/swift-service

private TestThriftServlet getServerServlet(Server server)
    throws ServletException
{
  ServletContextHandler handler = (ServletContextHandler) server.getHandlers()[0];
  return (TestThriftServlet) handler.getServletHandler().getServlets()[0].getServlet();
}

相关文章