use of org.glassfish.loadbalancer.admin.cli.beans.WebModule in project Payara by payara.
the class ClusterVisitor method visit.
/**
* Visit reader class
*/
@Override
public void visit(BaseReader br) throws Exception {
// FIXME, make as assert here about no class cast exception
if (br instanceof ClusterReader) {
ClusterReader cRdr = (ClusterReader) br;
_c.setName(cRdr.getName());
_c.setPolicy(cRdr.getLbPolicy());
_c.setPolicyModule(cRdr.getLbPolicyModule());
InstanceReader[] iRdrs = null;
iRdrs = cRdr.getInstances();
if ((iRdrs != null) && (iRdrs.length > 0)) {
boolean[] values = new boolean[iRdrs.length];
// XXX check if setting to true is required and is ok.
for (int i = 0; i < iRdrs.length; i++) {
values[i] = true;
}
_c.setInstance(values);
for (int i = 0; i < iRdrs.length; i++) {
iRdrs[i].accept(new InstanceVisitor(_c, i));
}
}
HealthCheckerReader hcRdr = cRdr.getHealthChecker();
if (hcRdr != null) {
hcRdr.accept(new HealthCheckerVisitor(_c));
}
WebModuleReader[] wRdrs = cRdr.getWebModules();
if ((wRdrs != null) && (wRdrs.length > 0)) {
WebModule[] wMods = new WebModule[wRdrs.length];
for (int i = 0; i < wRdrs.length; i++) {
wMods[i] = new WebModule();
wRdrs[i].accept(new WebModuleVisitor(wMods[i], _c));
}
_c.setWebModule(wMods);
}
}
}
Aggregations