return(getWebServerInfo(cc, config, ref.getVirtualServers(), null, null));
}
private WebServerInfo getWebServerInfo(ConfigContext cc, Config config,
String virtualServers, String targetName, String targetHostName) throws ConfigException {
HttpService httpService = config.getHttpService();
VirtualServer[] vServers = null;
List httpListeners = new ArrayList();
if (virtualServers==null) {
vServers = httpService.getVirtualServer();
if (vServers!=null) {
for (int i=0;i<vServers.length;i++) {
VirtualServer vs = vServers[i];
// admin virtual server does not count
if (vs.getId().equals(com.sun.enterprise.web.VirtualServer.ADMIN_VS))
continue;
String httpListenersString = vs.getHttpListeners();
if (httpListenersString!=null) {
String[] httpListenerIDs = httpListenersString.split(",");
if (httpListenerIDs!=null) {
for (int j=0;j<httpListenerIDs.length;j++) {
httpListeners.add(httpService.getHttpListenerById(httpListenerIDs[j]));
}
}
}
}
}
} else {
String virtualServerNames[] = virtualServers.split(",");
if (virtualServerNames!=null) {
for (int i=0;i<virtualServerNames.length;i++) {
VirtualServer vs = httpService.getVirtualServerById(virtualServerNames[i]);
String httpListenersString = vs.getHttpListeners();
if (httpListenersString!=null) {
String[] httpListenerIDs = httpListenersString.split(",");
if (httpListenerIDs!=null) {
for (int j=0;j<httpListenerIDs.length;j++) {
httpListeners.add(httpService.getHttpListenerById(httpListenerIDs[i]));
}
}
}
}
}