io.undertow.Undertow.start()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(222)

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

Undertow.start介绍

暂无

代码示例

代码示例来源:origin: syncany/syncany

public void start() throws ServiceAlreadyStartedException {
  webServer.start();
}

代码示例来源:origin: jooby-project/jooby

@Override
public void start() throws Exception {
 server.start();
}

代码示例来源:origin: spring-projects/spring-framework

@Override
public void start() throws Exception {
  this.server.start();
  Undertow.ListenerInfo info = this.server.getListenerInfo().get(0);
  this.port = ((InetSocketAddress) info.getAddress()).getPort();
}

代码示例来源:origin: spring-projects/spring-framework

@Override
protected void startInternal() {
  this.server.start();
  Undertow.ListenerInfo info = this.server.getListenerInfo().get(0);
  setPort(((InetSocketAddress) info.getAddress()).getPort());
}

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

this.undertow = this.builder.build();
this.undertow.start();
this.started = true;
logger.info("Undertow started on port(s) " + getPortsDescription());

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

this.undertow = createUndertowServer();
this.undertow.start();
this.started = true;
UndertowServletWebServer.logger

代码示例来源:origin: openzipkin/brave

protected int initServer() throws Exception {
 DeploymentInfo servletBuilder = Servlets.deployment()
   .setClassLoader(getClass().getClassLoader())
   .setContextPath("/")
   .setDeploymentName("test.war");
 init(servletBuilder);
 DeploymentManager manager = Servlets.defaultContainer().addDeployment(servletBuilder);
 manager.deploy();
 server = Undertow.builder()
   .addHttpListener(0, "127.0.0.1")
   .setHandler(manager.start()).build();
 server.start();
 return ((InetSocketAddress) server.getListenerInfo().get(0).getAddress()).getPort();
}

代码示例来源:origin: networknt/light-4j

.setHandler(Handlers.header(handler, Headers.SERVER_STRING, "L")).setWorkerThreads(200).build();
server.start();
System.out.println("HOST IP " + System.getenv(STATUS_HOST_IP));

代码示例来源:origin: syncany/syncany

private void createServer() {
  logger.log(Level.FINE, "Locked to build server...");
  OAuthTokenInterceptor extractingHttpHandler = new ExtractingTokenInterceptor(ioQueue);
  IPAddressAccessControlHandler ipAddressAccessControlHandler = new IPAddressAccessControlHandler();
  ipAddressAccessControlHandler.setDefaultAllow(false);
  for (InetAddress inetAddress : allowedClients) {
    ipAddressAccessControlHandler.addAllow(inetAddress.getHostAddress());
  }
  server = Undertow.builder()
          .addHttpListener(port, "localhost")
          .setHandler(ipAddressAccessControlHandler)
          .setHandler(Handlers.path()
                          .addExactPath(createPath(extractingHttpHandler.getPathPrefix()), extractingHttpHandler)
                          .addExactPath(createPath(interceptor.getPathPrefix()), interceptor)
          )
          .build();
  logger.log(Level.INFO, "Starting token web listener...");
  server.start();
}

代码示例来源:origin: openzipkin/brave

@Setup(Level.Trial) public void init() throws Exception {
 server = Undertow.builder()
   .addHttpListener(0, "127.0.0.1")
   .setHandler(exchange -> {
    exchange.getResponseHeaders().put(CONTENT_TYPE, "text/plain; charset=UTF-8");
    exchange.getResponseSender().send("hello world");
   }).build();
 server.start();
 baseUrl = "http://127.0.0.1:" +
   ((InetSocketAddress) server.getListenerInfo().get(0).getAddress()).getPort();
 client = newClient();
 tracedClient = newClient(HttpTracing.create(
   Tracing.newBuilder().spanReporter(Reporter.NOOP).build()
 ));
 unsampledClient = newClient(HttpTracing.create(
   Tracing.newBuilder().sampler(Sampler.NEVER_SAMPLE).spanReporter(Reporter.NOOP).build()
 ));
}

代码示例来源:origin: resteasy/Resteasy

public UndertowJaxrsServer start(Undertow.Builder builder)
{
 server = builder.setHandler(root).build();
 server.start();
 return this;
}

代码示例来源:origin: pippo-java/pippo

@Override
public void start() {
  try {
    pippoDeploymentManager = createPippoDeploymentManager();
    HttpHandler pippoHandler = pippoDeploymentManager.start();
    HttpHandler contextHandler = createContextHandler(pippoHandler);
    GracefulShutdownHandler rootHandler = new GracefulShutdownHandler(contextHandler);
    server = createServer(rootHandler);
    String version = server.getClass().getPackage().getImplementationVersion();
    log.info("Starting Undertow Server {} on port {}", version, getSettings().getPort());
    server.start();
  } catch (Exception e) {
    throw new PippoRuntimeException(e);
  }
}

代码示例来源:origin: resteasy/Resteasy

public UndertowJaxrsServer start()
{
 server = Undertow.builder()
     .addHttpListener(PortProvider.getPort(), "localhost")
     .setHandler(root)
     .build();
 server.start();
 return this;
}

代码示例来源:origin: hantsy/spring-reactive-sample

public static void main(String[] args) throws Exception {
  ApplicationContext context = new AnnotationConfigApplicationContext(Application.class);  // (1)
  Undertow server = context.getBean(Undertow.class);
  server.start();
  System.out.println("Press ENTER to exit.");
  System.in.read();
}

代码示例来源:origin: allegro/hermes

public void start() {
  configureServer().start();
  messagePreviewPersister.start();
  throughputLimiter.start();
}

代码示例来源:origin: org.jboss.ws.projects/jaxws-undertow-httpspi

public void start()
{
 undertow = builder.setHandler(new BlockingHandler(pathHandler)).build();
 undertow.start();
}

代码示例来源:origin: io.nessus/nessus-ipfs-webui

protected void start() throws Exception {
  
  HttpHandler contentHandler = createHttpHandler(getApplicationName(), config);
  Undertow server = Undertow.builder()
      .addHttpListener(config.webuiPort, config.webuiHost, contentHandler)
      .build();
  server.start();
}

代码示例来源:origin: wildfly/wildfly-core

@Override
public synchronized void start(final StartContext context) {
  undertow = Undertow.builder()
      .addHttpsListener(port, address, sslContext.get())
      .setServerOption(UndertowOptions.ENABLE_HTTP2, true)
      .setHandler(handler)
      .build();
  undertow.start();
  Logger.getLogger(UndertowSSLService.class).infof("Started Undertow on %s:%d", address, port);
}

代码示例来源:origin: io.termd/termd-core

public void bootstrap(final Consumer<Boolean> completionHandler) {
 server = Undertow.builder()
   .addHttpListener(port, host)
   .setHandler(UndertowBootstrap.this::handleWebSocketRequests)
   .build();
 server.start();
 completionHandler.accept(true);
}

代码示例来源:origin: elastic/apm-agent-java

@BeforeAll
static void startServer() {
  server = Undertow.builder()
    .addHttpListener(0, "127.0.0.1")
    .setHandler(exchange -> {
      if (handler != null) {
        handler.handleRequest(exchange);
      }
    }).build();
  server.start();
  port = ((InetSocketAddress) server.getListenerInfo().get(0).getAddress()).getPort();
}

相关文章