1 23 24 29 30 package com.sun.enterprise.tools.upgrade.cluster; 31 36 import java.util.*; 37 import org.w3c.dom.Element ; 38 import org.w3c.dom.Node ; 39 import org.w3c.dom.NodeList ; 40 41 public class LBCluster { 42 43 private List instances; 44 private List webModules; 45 private LBHealthChecker healthChecker; 46 47 public LBCluster(Element clusterElement) { 48 instances = new ArrayList(); 49 webModules = new ArrayList(); 50 NodeList inEles = clusterElement.getElementsByTagName("instance"); 51 for(int lh =0; lh < inEles.getLength(); lh++){ 52 instances.add(new LBInstance((Element )inEles.item(lh))); 53 } 54 NodeList webEles = clusterElement.getElementsByTagName("web-module"); 55 for(int ih =0; ih < webEles.getLength(); ih++){ 56 webModules.add(new LBWebModule((Element )webEles.item(ih))); 57 } 58 NodeList helEles = clusterElement.getElementsByTagName("health-checker"); 59 for(int ih =0; ih < helEles.getLength(); ih++){ 60 healthChecker = new LBHealthChecker((Element )helEles.item(ih)); 62 } 63 } 64 65 public LBHealthChecker getHealthChecker() { 66 return healthChecker; 67 } 68 public java.util.List getInstances() { 69 return instances; 70 } 71 public java.util.List getWebModules() { 72 return webModules; 73 } 74 } 75 | Popular Tags |