Sets the current host - all future webapps will be added to this host. When tomcat starts, the host will be the default host. @param host The current host
(Host host)
| 554 | * @param host The current host |
| 555 | */ |
| 556 | public void setHost(Host host) { |
| 557 | Engine engine = getEngine(); |
| 558 | boolean found = false; |
| 559 | for (Container engineHost : engine.findChildren()) { |
| 560 | if (engineHost == host) { |
| 561 | found = true; |
| 562 | break; |
| 563 | } |
| 564 | } |
| 565 | if (!found) { |
| 566 | engine.addChild(host); |
| 567 | } |
| 568 | } |
| 569 | |
| 570 | /** |
| 571 | * Returns the default Host for this embedded Tomcat instance. |