Rename event.
This commit is contained in:
parent
0c4cb7e9b4
commit
010b6fdce6
6 changed files with 17 additions and 17 deletions
|
|
@ -25,8 +25,8 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||
import org.jdrupes.vmoperator.runner.qemu.commands.QmpChangeMedium;
|
||||
import org.jdrupes.vmoperator.runner.qemu.commands.QmpOpenTray;
|
||||
import org.jdrupes.vmoperator.runner.qemu.commands.QmpRemoveMedium;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.ConfigureQemu;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.MonitorCommand;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.RunnerConfigurationUpdate;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.RunnerStateChange.State;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.TrayMovedEvent;
|
||||
import org.jgrapes.core.Channel;
|
||||
|
|
@ -68,7 +68,7 @@ public class CdMediaController extends Component {
|
|||
@Handler
|
||||
@SuppressWarnings({ "PMD.AvoidLiteralsInIfCondition",
|
||||
"PMD.AvoidInstantiatingObjectsInLoops" })
|
||||
public void onConfigureQemu(ConfigureQemu event) {
|
||||
public void onConfigureQemu(RunnerConfigurationUpdate event) {
|
||||
if (event.state() == State.TERMINATING) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,11 +27,11 @@ import java.util.Set;
|
|||
import org.jdrupes.vmoperator.runner.qemu.commands.QmpAddCpu;
|
||||
import org.jdrupes.vmoperator.runner.qemu.commands.QmpDelCpu;
|
||||
import org.jdrupes.vmoperator.runner.qemu.commands.QmpQueryHotpluggableCpus;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.ConfigureQemu;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.CpuAdded;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.CpuDeleted;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.HotpluggableCpuStatus;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.MonitorCommand;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.RunnerConfigurationUpdate;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.RunnerStateChange.State;
|
||||
import org.jgrapes.core.Channel;
|
||||
import org.jgrapes.core.Component;
|
||||
|
|
@ -45,7 +45,7 @@ public class CpuController extends Component {
|
|||
|
||||
private Integer currentCpus;
|
||||
private Integer desiredCpus;
|
||||
private ConfigureQemu suspendedConfigure;
|
||||
private RunnerConfigurationUpdate suspendedConfigure;
|
||||
|
||||
/**
|
||||
* Instantiates a new CPU controller.
|
||||
|
|
@ -62,7 +62,7 @@ public class CpuController extends Component {
|
|||
* @param event the event
|
||||
*/
|
||||
@Handler
|
||||
public void onConfigureQemu(ConfigureQemu event) {
|
||||
public void onConfigureQemu(RunnerConfigurationUpdate event) {
|
||||
if (event.state() == State.TERMINATING) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,12 +35,12 @@ import java.util.logging.Level;
|
|||
import org.jdrupes.vmoperator.runner.qemu.commands.QmpCapabilities;
|
||||
import org.jdrupes.vmoperator.runner.qemu.commands.QmpCommand;
|
||||
import org.jdrupes.vmoperator.runner.qemu.commands.QmpPowerdown;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.ConfigureQemu;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.MonitorCommand;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.MonitorEvent;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.MonitorReady;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.MonitorResult;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.PowerdownEvent;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.RunnerConfigurationUpdate;
|
||||
import org.jgrapes.core.Channel;
|
||||
import org.jgrapes.core.Component;
|
||||
import org.jgrapes.core.Components;
|
||||
|
|
@ -343,7 +343,7 @@ public class QemuMonitor extends Component {
|
|||
* @param event the event
|
||||
*/
|
||||
@Handler
|
||||
public void onConfigureQemu(ConfigureQemu event) {
|
||||
public void onConfigureQemu(RunnerConfigurationUpdate event) {
|
||||
int newTimeout = event.configuration().vm.powerdownTimeout;
|
||||
if (powerdownTimeout != newTimeout) {
|
||||
powerdownTimeout = newTimeout;
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@ package org.jdrupes.vmoperator.runner.qemu;
|
|||
import java.math.BigInteger;
|
||||
import java.util.Optional;
|
||||
import org.jdrupes.vmoperator.runner.qemu.commands.QmpSetBalloon;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.ConfigureQemu;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.MonitorCommand;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.RunnerConfigurationUpdate;
|
||||
import org.jgrapes.core.Channel;
|
||||
import org.jgrapes.core.Component;
|
||||
import org.jgrapes.core.annotation.Handler;
|
||||
|
|
@ -50,7 +50,7 @@ public class RamController extends Component {
|
|||
* @param event the event
|
||||
*/
|
||||
@Handler
|
||||
public void onConfigureQemu(ConfigureQemu event) {
|
||||
public void onConfigureQemu(RunnerConfigurationUpdate event) {
|
||||
Optional.ofNullable(event.configuration().vm.currentRam)
|
||||
.ifPresent(cr -> {
|
||||
if (currentRam != null && currentRam.equals(cr)) {
|
||||
|
|
|
|||
|
|
@ -51,9 +51,9 @@ import org.apache.commons.cli.DefaultParser;
|
|||
import org.apache.commons.cli.Option;
|
||||
import org.apache.commons.cli.Options;
|
||||
import org.jdrupes.vmoperator.runner.qemu.commands.QmpCont;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.ConfigureQemu;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.MonitorCommand;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.MonitorReady;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.RunnerConfigurationUpdate;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.RunnerStateChange;
|
||||
import org.jdrupes.vmoperator.runner.qemu.events.RunnerStateChange.State;
|
||||
import org.jdrupes.vmoperator.util.ExtendedObjectWrapper;
|
||||
|
|
@ -118,8 +118,8 @@ import org.jgrapes.util.events.WatchFile;
|
|||
* monitor --> configure: ClientConnected[for monitor]
|
||||
* monitor -> error: ConnectError[for monitor]
|
||||
*
|
||||
* configure: entry/fire ConfigureQemu
|
||||
* configure --> success: ConfigureQemu (last handler)/fire cont command
|
||||
* configure: entry/fire RunnerConfigurationUpdate
|
||||
* configure --> success: RunnerConfigurationUpdate (last handler)/fire cont command
|
||||
* }
|
||||
*
|
||||
* Initializing --> which: Started
|
||||
|
|
@ -238,7 +238,7 @@ public class Runner extends Component {
|
|||
}
|
||||
logger.fine(() -> "Updating configuration");
|
||||
var newConf = yamlMapper.convertValue(c, Configuration.class);
|
||||
rep.fire(new ConfigureQemu(newConf, state));
|
||||
rep.fire(new RunnerConfigurationUpdate(newConf, state));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -473,7 +473,7 @@ public class Runner extends Component {
|
|||
*/
|
||||
@Handler
|
||||
public void onMonitorReady(MonitorReady event) {
|
||||
fire(new ConfigureQemu(config, state));
|
||||
fire(new RunnerConfigurationUpdate(config, state));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -482,7 +482,7 @@ public class Runner extends Component {
|
|||
* @param event the event
|
||||
*/
|
||||
@Handler(priority = -1000)
|
||||
public void onConfigureQemu(ConfigureQemu event) {
|
||||
public void onConfigureQemu(RunnerConfigurationUpdate event) {
|
||||
if (state == State.STARTING) {
|
||||
fire(new MonitorCommand(new QmpCont()));
|
||||
state = State.RUNNING;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import org.jgrapes.core.Event;
|
|||
* on the event and only {@link Event#resumeHandling() resume handling}
|
||||
* when the adaption has completed.
|
||||
*/
|
||||
public class ConfigureQemu extends Event<Void> {
|
||||
public class RunnerConfigurationUpdate extends Event<Void> {
|
||||
|
||||
private final Configuration configuration;
|
||||
private final State state;
|
||||
|
|
@ -41,7 +41,7 @@ public class ConfigureQemu extends Event<Void> {
|
|||
*
|
||||
* @param channels the channels
|
||||
*/
|
||||
public ConfigureQemu(Configuration configuration, State state,
|
||||
public RunnerConfigurationUpdate(Configuration configuration, State state,
|
||||
Channel... channels) {
|
||||
super(channels);
|
||||
this.state = state;
|
||||
Loading…
Add table
Add a link
Reference in a new issue