Search in sources :

Example 1 with BaseReader

use of org.glassfish.loadbalancer.admin.cli.reader.api.BaseReader in project Payara by payara.

the class WebModuleVisitor 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 BaseReader) {
        WebModuleReader wRdr = (WebModuleReader) br;
        _w.setContextRoot(wRdr.getContextRoot());
        String url = wRdr.getErrorUrl();
        if ((url != null) && (!"".equals(url))) {
            // XXX start of bug fix for 6171814
            _c.createAttribute(Cluster.WEB_MODULE, "error-url", "ErrorUrl", AttrProp.CDATA, null, "");
            // XXX end of bug fix for 6171814
            _w.setErrorUrl(wRdr.getErrorUrl());
        }
        _w.setEnabled(Boolean.toString(wRdr.getLbEnabled()));
        _w.setDisableTimeoutInMinutes(wRdr.getDisableTimeoutInMinutes());
        IdempotentUrlPatternReader[] iRdrs = wRdr.getIdempotentUrlPattern();
        if ((iRdrs != null) && (iRdrs.length > 0)) {
            for (int i = 0; i < iRdrs.length; i++) {
                iRdrs[i].accept(new IdempotentUrlPatternVisitor(_w, i));
            }
        }
    }
}
Also used : BaseReader(org.glassfish.loadbalancer.admin.cli.reader.api.BaseReader) WebModuleReader(org.glassfish.loadbalancer.admin.cli.reader.api.WebModuleReader) IdempotentUrlPatternReader(org.glassfish.loadbalancer.admin.cli.reader.api.IdempotentUrlPatternReader)

Aggregations

BaseReader (org.glassfish.loadbalancer.admin.cli.reader.api.BaseReader)1 IdempotentUrlPatternReader (org.glassfish.loadbalancer.admin.cli.reader.api.IdempotentUrlPatternReader)1 WebModuleReader (org.glassfish.loadbalancer.admin.cli.reader.api.WebModuleReader)1