public void createLBConfig(String configName, String responseTimeout,
String httpsRouting, String reloadInterval, String monitor,
String routeCookie, String target, Properties props)
throws MBeanException
{
LbConfigs lbConfigs = null;
LbConfig newConfig = null;
try {
lbConfigs = getLbConfigs();
newConfig = new LbConfig();
if (configName == null) {
if (target == null) {
target =
SystemPropertyConstants.DEFAULT_SERVER_INSTANCE_NAME;
}
// lb config name is derived by adding a suffix to the target
configName = target + "-http-lb-config";
}
newConfig.setName(configName);
newConfig.setResponseTimeoutInSeconds(
new Integer(responseTimeout).toString());
newConfig.setReloadPollIntervalInSeconds(
new Integer(reloadInterval).toString());
newConfig.setMonitoringEnabled(
Boolean.valueOf(monitor).booleanValue());
newConfig.setRouteCookieEnabled(
Boolean.valueOf(routeCookie).booleanValue());
newConfig.setHttpsRouting(
Boolean.valueOf(httpsRouting).booleanValue());
ElementProperty [] eProps = getElementProperty(props);
if (eProps != null) {
newConfig.setElementProperty(eProps);
}
// XXX do I need to use setConfig instead?
lbConfigs.addLbConfig(newConfig);
} catch(ConfigException ce) {
throw new MBeanException(ce);
}
try {
// creates a reference to the target
if (target != null) {
createLBRef(target, configName);
}
_logger.log(Level.INFO,_sMgr.getString(
"http_lb_admin.LbConfigCreated", configName));
} catch (MBeanException me) {
// remove lb config if created
try {
if ( newConfig != null) {
lbConfigs.removeLbConfig(newConfig);
}
} catch (Throwable t) {
}
throw me;
}