for(int i=0;i<clusterReaders.length;i++) {
String clusterWorkerList = "";
ClusterReader clusterReader = clusterReaders[i];
String clusterName = clusterReader.getName();
WebModuleReader webmoduleReaders[] = clusterReader.getWebModules();
InstanceReader instanceReaders[] = clusterReader.getInstances();
for(int j =0; j<instanceReaders.length;j++) {
InstanceReader instanceReader = instanceReaders[j];
String listenerHost = "";
String listenerPort = "";
StringTokenizer st = new StringTokenizer(instanceReader.getListeners(), " ");
while (st.hasMoreElements()) {
String listener = st.nextToken();
if (listener.contains("ajp://")) {
listenerHost = listener.substring(listener.lastIndexOf("/") + 1, listener.lastIndexOf(":"));
listenerPort = listener.substring(listener.lastIndexOf(":") + 1, listener.length());
break;
}
}
String listenterName = instanceReader.getName();
props.setProperty(WORKER + SEPARATOR + listenterName + SEPARATOR + HOST, listenerHost);
props.setProperty(WORKER + SEPARATOR + listenterName + SEPARATOR + PORT, listenerPort);
props.setProperty(WORKER + SEPARATOR + listenterName + SEPARATOR + TYPE, TYPE_VALUE);
props.setProperty(WORKER + SEPARATOR + listenterName + SEPARATOR + LBFACTOR, LBFACTOR_VALUE);