Class Runner
java.lang.Object
org.jgrapes.core.internal.ComponentVertex
org.jgrapes.core.Component
org.jdrupes.vmoperator.runner.qemu.Runner
- All Implemented Interfaces:
Iterable<ComponentType>,Channel,ComponentType,Eligible,Manager
The Runner is responsible for managing the Qemu process and
optionally a process that emulates a TPM (software TPM).
It’s main function is best described by the following state diagram.
The Runner associates an EventProcessor with the
Start event. This “runner event processor” must be used
for all events related to the application level function. Components
that handle events from other sources (and thus event processors)
must fire any resulting events on the runner event processor in order
to maintain synchronization.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jgrapes.core.Channel
Channel.Default -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionRunner(org.apache.commons.cli.CommandLine cmdLine) Instantiates a new runner. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidThe main method.voidProcess the initial configuration.voidonConfigureQemu(ConfigureQemu event) Whenever a new QEMU configuration is available, check if it is supposed to trigger a reset.voidAs last step when handling a new configuration, check if QEMU is suspended after startup and should be continued.voidOn exit.voidonFileChanged(FileChanged event) Watch for the creation of the swtpm socket and start the qemu process if it has been created.voidonHandlingError(HandlingError event) Log the exception when a handling error is reported.voidonInput(Input<?> event, ProcessManager.ProcessChannel channel) Forward output from the processes to to the log.voidonOsinfo(OsinfoEvent event) Receiving the OSinfo means that the OS has been booted.voidonProcessExited(ProcessExited event, ProcessManager.ProcessChannel channel) On process exited.voidonProcessStarted(ProcessStarted event, ProcessManager.ProcessChannel channel) Associate required data with the process channel and register the channel in the context.voidonQmpConfigured(QmpConfigured event) Note ready state and send aConfigureQemuevent for any pending configuration (initial or change).voidHandle the start event.voidHandle the started event.voidonStopFirst(Stop event) On stop.voidonStopLast(Stop event) On stop.Methods inherited from class org.jgrapes.core.Component
channel, component, defaultCriterion, isEligibleFor, setNameMethods inherited from class org.jgrapes.core.internal.ComponentVertex
activeEventPipeline, addHandler, attach, channelReplacements, children, componentPath, componentVertex, detach, fire, initComponentsHandlers, iterator, name, newEventPipeline, newEventPipeline, parent, registerAsGenerator, root, toString, unregisterAsGeneratorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Runner
Instantiates a new runner.- Parameters:
cmdLine- the cmd line- Throws:
IOException- Signals that an I/O exception has occurred.
-
-
Method Details
-
onHandlingError
@Handler(channels=org.jgrapes.core.Channel.class, priority=-10000) public void onHandlingError(HandlingError event) Log the exception when a handling error is reported.- Parameters:
event- the event
-
onConfigurationUpdate
Process the initial configuration.The initial configuration and any subsequent updates will be forwarded to other components only when the QMP connection is ready (see @link #onQmpConfigured(QmpConfigured)).
- Parameters:
event- the event
-
onQmpConfigured
Note ready state and send aConfigureQemuevent for any pending configuration (initial or change).- Parameters:
event- the event
-
onStart
Handle the start event.- Parameters:
event- the event
-
onStarted
Handle the started event.- Parameters:
event- the event
-
onFileChanged
Watch for the creation of the swtpm socket and start the qemu process if it has been created.- Parameters:
event- the event
-
onProcessStarted
@Handler public void onProcessStarted(ProcessStarted event, ProcessManager.ProcessChannel channel) throws InterruptedException Associate required data with the process channel and register the channel in the context.- Parameters:
event- the eventchannel- the channel- Throws:
InterruptedException- the interrupted exception
-
onInput
Forward output from the processes to to the log.- Parameters:
event- the eventchannel- the channel
-
onConfigureQemu
Whenever a new QEMU configuration is available, check if it is supposed to trigger a reset.- Parameters:
event- the event
-
onConfigureQemuFinal
As last step when handling a new configuration, check if QEMU is suspended after startup and should be continued.- Parameters:
event- the event
-
onOsinfo
Receiving the OSinfo means that the OS has been booted.- Parameters:
event- the event
-
onProcessExited
On process exited.- Parameters:
event- the eventchannel- the channel
-
onExit
On exit.- Parameters:
event- the event
-
onStopFirst
On stop.- Parameters:
event- the event
-
onStopLast
On stop.- Parameters:
event- the event
-
main
The main method.- Parameters:
args- the command
-