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
ConstructorDescriptionRunner
(org.apache.commons.cli.CommandLine cmdLine) Instantiates a new runner. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
The main method.void
On configuration update.void
onConfigureQemu
(ConfigureQemu event) On configure qemu.void
On configure qemu.void
On exit.void
onFileChanged
(FileChanged event) Watch for the creation of the swtpm socket and start the qemu process if it has been created.void
onHandlingError
(HandlingError event) Log the exception when a handling error is reported.void
onInput
(Input<?> event, ProcessManager.ProcessChannel channel) Forward output from the processes to to the log.void
onProcessExited
(ProcessExited event, ProcessManager.ProcessChannel channel) On process exited.void
onProcessStarted
(ProcessStarted event, ProcessManager.ProcessChannel channel) Associate required data with the process channel and register the channel in the context.void
onQmpConfigured
(QmpConfigured event) On monitor ready.void
Handle the start event.void
Handle the started event.void
onStopFirst
(Stop event) On stop.void
onStopLast
(Stop event) On stop.Methods inherited from class org.jgrapes.core.Component
channel, component, defaultCriterion, isEligibleFor, setName
Methods 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, unregisterAsGenerator
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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
On configuration update.- 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
-
onQmpConfigured
On monitor ready.- Parameters:
event
- the event
-
onConfigureQemuFinal
On configure qemu.- Parameters:
event
- the event
-
onConfigureQemu
On configure qemu.- 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
-