// servers will be registered with the listener's request mapper when
// the listener is started
List<VirtualServer> virtualServers =
getVirtualServersForHttpListenerId(httpService, networkListener.getName());
if (virtualServers != null) {
Mapper mapper = connector.getMapper();
for (VirtualServer vs : virtualServers) {
boolean found = false;
String[] listenerNames = vs.getNetworkListenerNames();
String name = connector.getName();
for (String listenerName : listenerNames) {
if (listenerName.equals(name)) {
found = true;
break;
}
}
if (!found) {
String[] newListenerNames = new String[listenerNames.length + 1];
System.arraycopy(listenerNames, 0, newListenerNames, 0, listenerNames.length);
newListenerNames[listenerNames.length] = connector.getName();
vs.setNetworkListenerNames(newListenerNames);
}
// Check if virtual server has default-web-module configured,
// and if so, configure the http listener's mapper with this
// information
String defaultWebModulePath = vs.getDefaultContextPath(
domain, appRegistry);
if (defaultWebModulePath != null) {
try {
mapper.setDefaultContextPath(vs.getName(),
defaultWebModulePath);
vs.setDefaultContextPath(defaultWebModulePath);
} catch (Exception e) {
throw new LifecycleException(e);
}