use of org.glassfish.loadbalancer.admin.cli.beans.Property in project Payara by payara.
the class LoadbalancerVisitor 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 LoadbalancerReader) {
LoadbalancerReader lbRdr = (LoadbalancerReader) br;
PropertyReader[] pRdrs = lbRdr.getProperties();
if ((pRdrs != null) && (pRdrs.length > 0)) {
Property[] props = new Property[pRdrs.length];
for (int i = 0; i < pRdrs.length; i++) {
props[i] = new Property();
pRdrs[i].accept(new PropertyVisitor(props[i]));
}
_lb.setProperty2(props);
}
ClusterReader[] cRdrs = lbRdr.getClusters();
if ((cRdrs != null) && (cRdrs.length > 0)) {
Cluster[] cls = new Cluster[cRdrs.length];
for (int i = 0; i < cRdrs.length; i++) {
cls[i] = new Cluster();
cRdrs[i].accept(new ClusterVisitor(cls[i]));
}
_lb.setCluster(cls);
}
}
}
Aggregations