org.wildfly.extension.undertow.Host类的使用及代码示例

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

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

Host介绍

暂无

代码示例

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

protected void unregisterHost(Host host) {
  for (String hostName : host.getAllAliases()) {
    virtualHostHandler.removeHost(hostName);
    hosts.remove(host);
  }
  if (host.getName().equals(getDefaultHost())) {
    virtualHostHandler.setDefaultHandler(ResponseCodeHandler.HANDLE_404);
  }
}

代码示例来源: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

@Override
public void start() throws Exception {
  HttpHandler handler = manager.start();
  host.getValue().registerDeployment(manager.getDeployment(), handler);
}

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

protected void registerHost(final Host host) {
  hosts.add(host);
  for (String hostName : host.getAllAliases()) {
    virtualHostHandler.addHost(hostName, host.getRootHandler());
  }
  if (host.getName().equals(getDefaultHost())) {
    virtualHostHandler.setDefaultHandler(host.getRootHandler());
  }
}

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

@Override
public void stop(final StopContext stopContext) {
  final Host host = hostInjector.getValue();
  UndertowLogger.ROOT_LOGGER.debugf("Stopping console redirect for %s", host.getName());
  host.unregisterHandler(CONSOLE_PATH);
}

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

@Override
public void start(StartContext context) throws StartException {
  RequestController rq = requestControllerInjectedValue.getOptionalValue();
  if(rq != null) {
    controlPoint = rq.getControlPoint("", "org.wildfly.undertow.webhost." + server.getValue().getName() + "." + host.getValue().getName());
  }
}

代码示例来源: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

final Host service = new Host(name, aliases == null ? new LinkedList<>(): aliases, defaultWebModule, defaultResponseCode, queueRequestsOnStart);
    .addCapabilityRequirement(Capabilities.CAPABILITY_SERVER, Server.class, service.getServerInjection(), serverName)
    .addCapabilityRequirement(Capabilities.CAPABILITY_UNDERTOW, UndertowService.class, service.getUndertowService())
    .addDependency(SuspendController.SERVICE_NAME, SuspendController.class, service.getSuspendControllerInjectedValue())
    .addDependency(ControlledProcessStateService.SERVICE_NAME, ControlledProcessStateService.class, service.getControlledProcessStateServiceInjectedValue());

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

@Override
public void start(final StartContext startContext) throws StartException {
  final Host host = hostInjector.getValue();
  UndertowLogger.ROOT_LOGGER.debugf("Starting console redirect for %s", host.getName());
  final HttpManagement httpManagement = httpManagementInjector.getOptionalValue();
  if (httpManagement != null) {
    if (httpManagement.hasConsole()) {
      host.registerHandler(CONSOLE_PATH, new ConsoleRedirectHandler(httpManagement));
    } else {
      host.registerHandler(CONSOLE_PATH, new RedirectHandler(NO_CONSOLE));
    }
  } else {
    host.registerHandler(CONSOLE_PATH, new RedirectHandler(NO_CONSOLE));
  }
}

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

@Override
public Set<String> getAliases() {
  return this.host.getAllAliases();
}

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

@Override
public void stop() throws Exception {
  host.getValue().unregisterDeployment(manager.getDeployment());
  manager.stop();
}

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

@Override
public Context findContext(String path) {
  String findPath = "".equals(path) ? "/" : path;
  for (Deployment deployment : this.host.getDeployments()) {
    if (deployment.getDeploymentInfo().getContextPath().equals(findPath)) {
      return new UndertowContext(deployment, this);
    }
  }
  return null;
}

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

@Override
public Iterable<Context> getContexts() {
  List<Context> contexts = new ArrayList<>();
  for (Deployment deployment : this.host.getDeployments()) {
    contexts.add(new UndertowContext(deployment, this));
  }
  for (String path : this.host.getLocations()) {
    contexts.add(new LocationContext(path, this));
  }
  return contexts;
}

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

protected HttpHandler getOrCreateRootHandler() {
  HttpHandler root = rootHandler;
  if(root == null) {
    synchronized (this) {
      root = rootHandler;
      if(root == null) {
        return rootHandler = configureRootHandler();
      }
    }
  }
  return root;
}

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

protected void registerHost(final Host host) {
  hosts.add(host);
  for (String hostName : host.getAllAliases()) {
    virtualHostHandler.addHost(hostName, host.getRootHandler());
  }
  if (host.getName().equals(getDefaultHost())) {
    virtualHostHandler.setDefaultHandler(host.getRootHandler());
  }
}

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

d.setHostName(host.getValue().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.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.wildfly/wildfly-undertow

final Host service = new Host(name, aliases == null ? new LinkedList<>(): aliases, defaultWebModule, defaultResponseCode, queueRequestsOnStart);
    .addCapabilityRequirement(Capabilities.CAPABILITY_SERVER, Server.class, service.getServerInjection(), serverName)
    .addCapabilityRequirement(Capabilities.CAPABILITY_UNDERTOW, UndertowService.class, service.getUndertowService())
    .addDependency(SuspendController.SERVICE_NAME, SuspendController.class, service.getSuspendControllerInjectedValue())
    .addDependency(ControlledProcessStateService.SERVICE_NAME, ControlledProcessStateService.class, service.getControlledProcessStateServiceInjectedValue());

相关文章