org.wildfly.extension.undertow.Host.getServer()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(7.8k)|赞(0)|评价(0)|浏览(159)

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

Host.getServer介绍

暂无

代码示例

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

@Override
  public int getConfidentialPort(HttpServerExchange exchange) {
    int port = exchange.getConnection().getLocalAddress(InetSocketAddress.class).getPort();
    if (port<0){
      UndertowLogger.ROOT_LOGGER.debugf("Confidential port not defined for port %s", port);
    }
    return host.getValue().getServer().getValue().lookupSecurePort(port);
  }
};

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

public void registerDeployment(final Deployment deployment, HttpHandler handler) {
  DeploymentInfo deploymentInfo = deployment.getDeploymentInfo();
  String path = getDeployedContextPath(deploymentInfo);
  registerHandler(path, handler);
  deployments.add(deployment);
  UndertowLogger.ROOT_LOGGER.registerWebapp(path, getServer().getName());
  undertowService.getValue().fireEvent(listener -> listener.onDeploymentStart(deployment, Host.this));
}

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

public void unregisterDeployment(final Deployment deployment) {
  DeploymentInfo deploymentInfo = deployment.getDeploymentInfo();
  String path = getDeployedContextPath(deploymentInfo);
  undertowService.getValue().fireEvent(listener -> listener.onDeploymentStop(deployment, Host.this));
  unregisterHandler(path);
  deployments.remove(deployment);
  UndertowLogger.ROOT_LOGGER.unregisterWebapp(path, getServer().getName());
}

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

private HttpHandler setupRoutes(HttpHandler handler) {
  final SimpleSessionIdentifierCodec codec = new SimpleSessionIdentifierCodec(new SimpleRoutingSupport(), this.host.getValue().getServer().getRoute());
  return exchange -> {
    exchange.addResponseCommitListener(ex -> {
      Cookie cookie = ex.getResponseCookies().get(JSESSIONID);
      if(cookie != null ) {
        cookie.setValue(codec.encode(cookie.getValue()));
      }
    });
    handler.handleRequest(exchange);
  };
}

代码示例来源:origin: org.jboss.eap/wildfly-mod_cluster-undertow

public boolean filter(Host host) {
  return host.getServer().getName().equals(serverName);
}

代码示例来源:origin: wildfly-extras/wildfly-camel

private void validateEndpointPort(URI httpURI) {
  // Camel HTTP endpoint port defaults are 0 or -1
  boolean portMatched = httpURI.getPort() == 0 || httpURI.getPort() == -1;
  // If a port was specified, verify that undertow has a listener configured for it
  if (!portMatched) {
    for (UndertowListener listener : defaultHost.getServer().getListeners()) {
      SocketBinding binding = listener.getSocketBinding();
      if (binding != null) {
        if (binding.getPort() == httpURI.getPort()) {
          portMatched = true;
          break;
        }
      }
    }
  }
  if (!"localhost".equals(httpURI.getHost())) {
    LOGGER.debug("Cannot bind to host other than 'localhost': {}", httpURI);
  }
  if (!portMatched) {
    LOGGER.debug("Cannot bind to specific port: {}", httpURI);
  }
}

代码示例来源:origin: org.jboss.eap/wildfly-webservices-server-integration

@Override
public Integer getVirtualHostPort(String hostname, boolean securePort) {
  ServerHostInfo hostInfo = new ServerHostInfo(hostname);
  Host undertowHost = getUndertowHost(hostInfo);
  if (undertowHost != null && !undertowHost.getServer().getListeners().isEmpty()) {
    for(UndertowListener listener : undertowHost.getServer().getListeners()) {
      if (listener.isSecure() == securePort) {
        return listener.getSocketBinding().getAbsolutePort();
      }
    }
  }
  return null;
}

代码示例来源:origin: org.wildfly/wildfly-webservices-server-integration

@Override
public Integer getVirtualHostPort(String hostname, boolean securePort) {
  ServerHostInfo hostInfo = new ServerHostInfo(hostname);
  Host undertowHost = getUndertowHost(hostInfo);
  if (undertowHost != null && !undertowHost.getServer().getListeners().isEmpty()) {
    for(UndertowListener listener : undertowHost.getServer().getListeners()) {
      if (listener.isSecure() == securePort) {
        return listener.getSocketBinding().getAbsolutePort();
      }
    }
  }
  return null;
}

代码示例来源:origin: org.wildfly/wildfly-undertow

@Override
  public int getConfidentialPort(HttpServerExchange exchange) {
    int port = exchange.getConnection().getLocalAddress(InetSocketAddress.class).getPort();
    if (port<0){
      UndertowLogger.ROOT_LOGGER.debugf("Confidential port not defined for port %s", port);
    }
    return host.getValue().getServer().getValue().lookupSecurePort(port);
  }
};

代码示例来源:origin: org.jboss.eap/wildfly-undertow

@Override
  public int getConfidentialPort(HttpServerExchange exchange) {
    int port = exchange.getConnection().getLocalAddress(InetSocketAddress.class).getPort();
    if (port<0){
      UndertowLogger.ROOT_LOGGER.debugf("Confidential port not defined for port %s", port);
    }
    return host.getValue().getServer().getValue().lookupSecurePort(port);
  }
};

代码示例来源:origin: org.wildfly/wildfly-undertow

public void unregisterDeployment(final Deployment deployment) {
  DeploymentInfo deploymentInfo = deployment.getDeploymentInfo();
  String path = getDeployedContextPath(deploymentInfo);
  undertowService.getValue().fireEvent(listener -> listener.onDeploymentStop(deployment, Host.this));
  unregisterHandler(path);
  deployments.remove(deployment);
  UndertowLogger.ROOT_LOGGER.unregisterWebapp(path, getServer().getName());
}

代码示例来源:origin: org.jboss.eap/wildfly-undertow

public void registerDeployment(final Deployment deployment, HttpHandler handler) {
  DeploymentInfo deploymentInfo = deployment.getDeploymentInfo();
  String path = getDeployedContextPath(deploymentInfo);
  registerHandler(path, handler);
  deployments.add(deployment);
  UndertowLogger.ROOT_LOGGER.registerWebapp(path, getServer().getName());
  undertowService.getValue().fireEvent(listener -> listener.onDeploymentStart(deployment, Host.this));
}

代码示例来源:origin: org.jboss.eap/wildfly-undertow

public void unregisterDeployment(final Deployment deployment) {
  DeploymentInfo deploymentInfo = deployment.getDeploymentInfo();
  String path = getDeployedContextPath(deploymentInfo);
  undertowService.getValue().fireEvent(listener -> listener.onDeploymentStop(deployment, Host.this));
  unregisterHandler(path);
  deployments.remove(deployment);
  UndertowLogger.ROOT_LOGGER.unregisterWebapp(path, getServer().getName());
}

代码示例来源:origin: org.wildfly/wildfly-undertow

public void registerDeployment(final Deployment deployment, HttpHandler handler) {
  DeploymentInfo deploymentInfo = deployment.getDeploymentInfo();
  String path = getDeployedContextPath(deploymentInfo);
  registerHandler(path, handler);
  deployments.add(deployment);
  UndertowLogger.ROOT_LOGGER.registerWebapp(path, getServer().getName());
  undertowService.getValue().fireEvent(listener -> listener.onDeploymentStart(deployment, Host.this));
}

代码示例来源:origin: org.jboss.eap/wildfly-undertow

private HttpHandler setupRoutes(HttpHandler handler) {
  final SimpleSessionIdentifierCodec codec = new SimpleSessionIdentifierCodec(new SimpleRoutingSupport(), this.host.getValue().getServer().getRoute());
  return exchange -> {
    exchange.addResponseCommitListener(ex -> {
      Cookie cookie = ex.getResponseCookies().get(JSESSIONID);
      if(cookie != null ) {
        cookie.setValue(codec.encode(cookie.getValue()));
      }
    });
    handler.handleRequest(exchange);
  };
}

代码示例来源:origin: org.wildfly/wildfly-undertow

private HttpHandler setupRoutes(HttpHandler handler) {
  final SimpleSessionIdentifierCodec codec = new SimpleSessionIdentifierCodec(new SimpleRoutingSupport(), this.host.getValue().getServer().getRoute());
  return exchange -> {
    exchange.addResponseCommitListener(ex -> {
      Cookie cookie = ex.getResponseCookies().get(JSESSIONID);
      if(cookie != null ) {
        cookie.setValue(codec.encode(cookie.getValue()));
      }
    });
    handler.handleRequest(exchange);
  };
}

代码示例来源:origin: org.jboss.eap/wildfly-mod_cluster-undertow

private Context createContext(Deployment deployment, Host host) {
  return new UndertowContext(deployment, new UndertowHost(host, new UndertowEngine(serverName, host.getServer().getValue(), this.configuration.getUndertowService(), this.connector)));
}

代码示例来源:origin: org.jboss.eap/wildfly-mod_cluster-undertow

private Context createContext(String contextPath, Host host) {
  return new LocationContext(contextPath, new UndertowHost(host, new UndertowEngine(serverName, host.getServer().getValue(), this.configuration.getUndertowService(), this.connector)));
}

相关文章