private Context findContext() { for (Container child : this.tomcat.getHost().findChildren()) { if (child instanceof Context) { return (Context) child; } } throw new IllegalStateException("The host does not contain a Context"); }
private String getContextPath() { return Arrays.stream(this.tomcat.getHost().findChildren()) .filter(TomcatEmbeddedContext.class::isInstance) .map(TomcatEmbeddedContext.class::cast) .map(TomcatEmbeddedContext::getPath).collect(Collectors.joining(" ")); }
private void performDeferredLoadOnStartup() { try { for (Container child : this.tomcat.getHost().findChildren()) { if (child instanceof TomcatEmbeddedContext) { ((TomcatEmbeddedContext) child).deferredLoadOnStartup(); } } } catch (Exception ex) { if (ex instanceof WebServerException) { throw (WebServerException) ex; } throw new WebServerException("Unable to start embedded Tomcat connectors", ex); } }
private void rethrowDeferredStartupExceptions() throws Exception { Container[] children = this.tomcat.getHost().findChildren(); for (Container container : children) { if (container instanceof TomcatEmbeddedContext) { TomcatStarter tomcatStarter = ((TomcatEmbeddedContext) container) .getStarter(); if (tomcatStarter != null) { Exception exception = tomcatStarter.getStartUpException(); if (exception != null) { throw exception; } } } if (!LifecycleState.STARTED.equals(container.getState())) { throw new IllegalStateException(container + " failed to start"); } } }
@Override public List<Context> findContexts() { List<Context> results = new ArrayList<>(); for (Container child : host.findChildren()) { if (child instanceof Context) { results.add((Context) child); } } return results; }
private Optional<Context> findContext() { return Stream.of(this.webServer.getTomcat().getHost().findChildren()) .filter(Context.class::isInstance).map(Context.class::cast) .findFirst(); }
private Context findContext(TomcatWebServer tomcatWebServer) { for (Container container : tomcatWebServer.getTomcat().getHost().findChildren()) { if (container instanceof Context) { return (Context) container; } } return null; }
private void registerListenersForHost(Host host) { for (Container contextContainer : host.findChildren()) { Context context = (Context) contextContainer; registerContextListener(context); } }
private void registerListenersForHost(Host host) { for (Container contextContainer : host.findChildren()) { Context context = (Context) contextContainer; registerContextListener(context); } }
private void registerListenersForHost(Host host) { for (Container contextContainer : host.findChildren()) { Context context = (Context) contextContainer; registerContextListener(context); } }
private void registerListenersForHost(Host host) { for (Container contextContainer : host.findChildren()) { Context context = (Context) contextContainer; registerContextListener(context); } }
private void registerListenersForHost(Host host) { for (Container contextContainer : host.findChildren()) { Context context = (Context) contextContainer; registerContextListener(context); } }
private void registerListenersForHost(Host host) { for (Container contextContainer : host.findChildren()) { Context context = (Context) contextContainer; registerContextListener(context); } }
private void registerListenersForHost(Host host) { for (Container contextContainer : host.findChildren()) { Context context = (Context) contextContainer; registerContextListener(context); } }
private void registerListenersForHost(Host host) { for (Container contextContainer : host.findChildren()) { Context context = (Context) contextContainer; registerContextListener(context); } }
private Stream<Context> findContexts(final Host host) { return Stream.of(host.findChildren()) .filter(Context.class::isInstance) .map(Context.class::cast) .filter(ctx -> ctx.getState().isAvailable()); }
private Stream<Context> findContexts(final Host host) { return Stream.of(host.findChildren()) .filter(Context.class::isInstance) .map(Context.class::cast) .filter(ctx -> ctx.getState().isAvailable()); }
private Context findContext(TomcatEmbeddedServletContainer tomcatWebServer) { for (Container container : tomcatWebServer.getTomcat().getHost().findChildren()) { if (container instanceof Context) { return (Context) container; } } return null; }
private void addListeners() { for (Container container : tomcat.getHost().findChildren()) { ((Context) container).addServletContainerInitializer(new ServerExecutionRegistry(), null); log.info("LOG00230: Adding registry as listener ..."); } }
/** * Register host. */ private void registerHost(Host host) { String[] aliases = host.findAliases(); mapper.addHost(host.getName(), aliases, host); for (Container container : host.findChildren()) { registerContext((Context) container); } if(log.isDebugEnabled()) { log.debug(sm.getString("mapperListener.registerHost", host.getName(), domain, connector)); } }