if (engineMetaData.getHosts() != null)
{
Iterator<HostMetaData> hostMetaDatas = engineMetaData.getHosts().iterator();
while (hostMetaDatas.hasNext())
{
HostMetaData hostMetaData = hostMetaDatas.next();
org.apache.catalina.Host host =
(org.apache.catalina.Host) getInstance(hostMetaData, "org.apache.catalina.core.StandardHost");
addLifecycleListeners(host, hostMetaData.getListeners());
host.setName(hostMetaData.getName());
engine.addChild(host);
// Server/Service/Engine/Host/Realm
if (hostMetaData.getRealm() != null) {
host.setRealm((org.apache.catalina.Realm) getInstance(hostMetaData.getRealm(), null));
}
// Server/Service/Engine/Host/Valve
addValves(host, hostMetaData.getValves());
// Server/Service/Engine/Host/Alias
if (hostMetaData.getAliases() != null) {
Iterator<String> aliases = hostMetaData.getAliases().iterator();
while (aliases.hasNext()) {
host.addAlias(aliases.next());
}
}