All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jppf.ui.options.xml.LoadBalancingSettings.groovy Maven / Gradle / Ivy

There is a newer version: 6.3-alpha
Show newest version
void refresh() {
  StatsHandler.getInstance().getClientHandler().refreshLoadBalancer();
}

void apply() {
  def connection = StatsHandler.getInstance().getClientHandler().currentJmxConnection();
  if (connection == null) {
    option.findFirstWithName("/LoadBalancingMessages").append("Not connected to a server");
    return;
  }
  def algorithm =  option.findFirstWithName("/Algorithm").getValue();
  if (algorithm == null) {
    option.findFirstWithName("/LoadBalancingMessages").append("No algorithm selected, use the 'Refresh' button to fill the list of algorithms");
    return;
  }
  def params = new TypedProperties();
  params.load(new StringReader(option.findFirstWithName("/LoadBalancingParameters").getValue()));
  def msg = connection.changeLoadBalancerSettings(algorithm, params);
  if (msg != null) option.findFirstWithName("/LoadBalancingMessages").append(msg);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy